# Pirate radio - where are the scripts installed to?

**URL:** <https://forums.pimoroni.com/t/pirate-radio-where-are-the-scripts-installed-to/6484>\
**Category:** Support\
**Created:** [November 29, 2017, 3:02pm UTC](https://forums.pimoroni.com/t/pirate-radio-where-are-the-scripts-installed-to/6484 "2017-11-29T15:02:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0rvj](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/m0rvj/32/3456_2.png) [@m0rvj](https://forums.pimoroni.com/u/m0rvj)\
**Post date:** [November 29, 2017, 3:02pm UTC](https://forums.pimoroni.com/t/pirate-radio-where-are-the-scripts-installed-to/6484/1 "2017-11-29T15:02:56Z")

</div>

So I’ve got my pirate radio working as a web radio and also as an airplay device. I can start and stop each service etc. I’d like to configure it so that I hold down the power button to switch between these two modes. I’ve found the projects on github and I think I understand the scripts but I can’t figure where they get installed onto the system. I’d be grateful if someone could tell me where to look! I want to edit phatbeatd! Thanks!

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [November 30, 2017, 12:04am UTC](https://forums.pimoroni.com/t/pirate-radio-where-are-the-scripts-installed-to/6484/2 "2017-11-30T00:04:48Z")

</div>

The `vlc-radio` project folder consists of `phatbeatd` and `vlcd` which both contain folders that are relative to root (/) on your Pi. So stuff in `phat-beat/projects/vlc-radio/vlcd/etc/` is installed into `/etc`

You may possibly be able to just run the services alongside each other and audio played by each source would be mixed by Pulse Audio.

Alternatively to stop vlc you can `sudo systemctl stop vlcd` but this will break the socket connection between `phatbeatd` and `vlcd` so you’d have to tweak that and make it able to recover when `vlc` comes back up.

---

<div class="post-metadata">

**Author:** ![m0rvj](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/m0rvj/32/3456_2.png) [@m0rvj](https://forums.pimoroni.com/u/m0rvj)\
**Post date:** [November 30, 2017, 11:42am UTC](https://forums.pimoroni.com/t/pirate-radio-where-are-the-scripts-installed-to/6484/3 "2017-11-30T11:42:10Z")

</div>

Unfortunately no mixing happens, I found quite a tidy solution…

I edited phatbeatd such that the on/off button toggles which service is running but when held down does it’s original power function.

Thanks!

> ```
> @phatbeat.on(phatbeat.BTN_ONOFF)
> def perform_toggle_vlc(pin):
> if vlc.connect():
> log(vlc.communicate("pause"))
> os.system("sudo service vlcd stop")
> SPEED = 50
> BRIGHTNESS = 64
> SPREAD = 20
> for x in range(phatbeat.CHANNEL_PIXELS):
> h = (time.time() * SPEED + (x * SPREAD)) % 360 / 360.0
> r, g, b = [int(c*BRIGHTNESS) for c in colorsys.hsv_to_rgb(h, 1.0, 1.0)]
> phatbeat.set_pixel(x, r, g, b, channel=0)
> phatbeat.set_pixel(x, r, g, b, channel=1)
> phatbeat.show()
> time.sleep(0.1)
> phatbeat.clear()
> phatbeat.show()
> else: 
> phatbeat.set_all(128,0,0,0.1)
> phatbeat.show()
> time.sleep(0.5)
> phatbeat.clear()
> phatbeat.show()
> os.system("sudo service vlcd start")
> 
> @phatbeat.hold(phatbeat.BTN_ONOFF)
> def perform_shutdown(pin):
> 
> ```
