Seattle is home to one of the world's great public radio stations- KEXP. Outside of NPR, it's the only radio my wife or I listen to. I tried mythstream, but it was difficult for my wife to use. So, I mapped the "radio" button on my Hauppauge grey remote to launch their streaming feed in mplayer. Once launched, the volume controls work and the stop key kills the stream. I'm not much of a programmer, so please critique and/or improve upon my little script- it's simply a derivative of the "wife friendly" reboot solution.
Here's my /home/mythtv/.mythtv/lircrc (still a work in progress)
Code:
# lircrc.example.HauppaugeGrey-nativelirc
# 2003-09-17, Robert Kulagowski
# mailto:rkulagow@rocketmail.com
# Save this file in ~/.mythtv/lircrc
# Wife Friendly Feature
# needs work
# Power Button
begin
prog = irexec
button = POWER
repeat = 4
config = /usr/local/bin/mythpowerbutton.sh
end
# stream kexp
begin
prog = irexec
button = Radio
config = /usr/local/bin/kexpbutton.sh
repeat = 0
end
# jumpoints
begin
prog = mythtv
button = TV
# switch to live tv
config = F5
end
begin
prog = mythtv
button = Blue
config = F6
# mythweather module
end
begin
prog = mythtv
button = Pictures
config = F7
# mythgallery module
end
begin
prog = mythtv
button = Music
config = F8
# mythmuisc module
end
begin
prog = mythtv
button = Videos
config = F12
# mythvideo module
end
# display help dialog
begin
prog = mythtv
button = Go
config = F1
end
begin
prog = mythtv
button = 1
config = 1
end
begin
prog = mythtv
button = 2
config = 2
end
begin
prog = mythtv
button = 3
config = 3
end
begin
prog = mythtv
button = 4
config = 4
end
begin
prog = mythtv
button = 5
config = 5
end
begin
prog = mythtv
button = 6
config = 6
end
begin
prog = mythtv
button = 7
config = 7
end
begin
prog = mythtv
button = 8
config = 8
end
begin
prog = mythtv
button = 9
config = 9
end
begin
prog = mythtv
button = Back/Exit
config = Esc
end
begin
prog = mythtv
button = 0
config = 0
end
begin
prog = mythtv
button = Guide
config = M
end
# Below are keys used with the Hauppauge Grey remote
begin
prog = mythtv
# This is the Red key
# We'll use it for "Delete"
button = Red
config = D
end
begin
prog = mythtv
# We'll use it for "Information"
button = Menu/i
config = I
end
# Note the "repeat =" strings in the volume and channel.
# This means that if you hold down the key, every nth instance will be
# passed. This depends on your system, so you may want to increase or
# decrease this and see what happens. repeat = 1 is probably too
# fast.
begin
prog = mythtv
button = Vol-
repeat = 3
config = F10
end
begin
prog = mythtv
button = Vol+
repeat = 3
config = F11
end
begin
prog = mythtv
button = Up
# This is the "up" on the central diamond
repeat = 3
config = Up
end
begin
prog = mythtv
button = Down
# This is the "down" on the central diamond
repeat = 3
config = Down
end
begin
prog = mythtv
button = Left
# This is the "left" on the central diamond
repeat = 3
config = Left
end
begin
prog = mythtv
button = Right
# This is the "right" on the central diamond
repeat = 3
config = Right
end
begin
prog = mythtv
# Middle button on the diamond
button = Ok
config = Return
end
begin
prog = mythtv
button = Mute
config = F9
end
# NA
begin
prog = mythtv
# Change focus for PiP (to change channel in the other window)
button = Blank
config = B
end
# NA
begin
prog = mythtv
# Toggle PiP on/off
button = Full
config = V
end
begin
prog = mythtv
button = Rewind
config = <
end
begin
prog = mythtv
button = Play
config = P
end
begin
prog = mythtv
button = Forward
config = >
end
begin
prog = mythtv
button = Record
config = R
end
# NA
begin
prog = mythtv
# Teletext
button = blank
config = T
end
begin
prog = mythtv
button = pause
config = P
end
begin
prog = mythtv
button = Replay/SkipBackward
# Use for backwards commercial skip
config = Q
end
begin
prog = mythtv
button = SkipForward
# Use for forward commercial skip
config = Z
end
#MPlayer
begin
prog = mplayer
button = BACK/EXIT
config = quit
end
begin
prog = mplayer
button = Stop
config = quit
end
begin
prog = mplayer
button = Menu/i
config = osd
end
begin
prog = mplayer
button = Rewind
config = seek -10
repeat = 1
end
begin
prog = mplayer
button = Forward
config = seek +10
repeat = 1
end
begin
prog = mplayer
button = Replay/SkipBackward
config = seek -60
repeat = 1
end
begin
prog = mplayer
button = SkipForward
config = seek +60
repeat = 1
end
begin
prog = mplayer
button = Pause
config = pause
end
begin
prog = mplayer
button = VOL+
config = volume +1
repeat = 1
end
begin
prog = mplayer
button = VOL-
config = volume -1
repeat = 1
end
begin
prog=mplayer
button=Mute
config=mute
end
And, here's the bash script /usr/local/bin/kexpbutton.sh
Code:
#!/bin/sh
i=`ps aux | grep mplayer | sed -e 's/.*grep.*//'`
if [ -n "$i" ]
then
killall mplayer
else
mplayer http://kexp-mp3-2.cac.washington.edu:8000
fi
Then, tell fvwm to launch irexec on login by adding this line to the bottom of /home/mythtv/.fvwm/.fvwm2rc
Code:
#Remove comment to start motion
#exec motion
#Start irexec for global buttons- KEXP and wife friendly feature
exec irexec &
exec KnoppMyth-run
#exec mythfrontend
#Enjoy! Cecil & Dale
#End
Make sure to chmod +x the bash script and set the permissions correct. Also, be aware that mythtv retains the remote's focus so that you can navigate the MythUI while the stream plays- I like to combine listening to KEXP with a gallery slide show.
Happy Friday everyone.
Mark