Digital TV GUI & Linux vs AutoHotKey

This was made us Tk and TCL. AutoHotKey is fine if you are in Windows but people have said to me “sadly there is not a way of doing this in Linux”. This is such a misunderstanding of Linux that it’s almost tragic. The Linux system is designed from the bottom up to be easily understandable and accessible by the user. X and the Linux GUI, far from being “not desktop ready” (or insert any other tragically ignorant phrase here) is geared to do anything needed by the user using scripting if it’s using Tk and TCL or other scripting languages. Here is my Digital TV channel chooser script.

#!/usr/bin/wish

# Tk is the GUI language. Tcl is the programming language.
# See http://www.tkdocs.com/tutorial/intro.html

package require Tk

wm title . "MPlayer DVB Channels"
frame .clipaste_frame -relief raised -bd 1
label .1 -text "Digital TV" 
button .2 -text "301\(BBC\)" -command { exec xterm -e mplayer dvb://301\(BBC\) & }
button .3 -text "4Music" -command { exec xterm -e mplayer dvb://4Music & }
button .4 -text "Absolute\ Radio\(Absolute\ Radio\)" -command { exec xterm -e mplayer dvb://Absolute\ Radio\(Absolute\ Radio\) & }
button .5 -text "BBC\ 1Xtra\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ 1Xtra\(BBC\) & }
button .6 -text "BBC\ 6\ Music\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ 6\ Music\(BBC\) & }
button .7 -text "BBC\ Asian\ Net.\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ Asian\ Net.\(BBC\) & }
button .8 -text "BBC\ FOUR\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ FOUR\(BBC\) & }
button .9 -text "BBC\ NEWS\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ NEWS\(BBC\) & }
button .10 -text "BBC\ ONE\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ ONE\(BBC\) & }
button .11 -text "BBC\ Parliament\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ Parliament\(BBC\) & }
button .12 -text "BBC\ R5L\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ R5L\(BBC\) & }
button .13 -text "BBC\ R5SX\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ R5SX\(BBC\) & }
button .14 -text "BBC\ Radio\ 1\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ Radio\ 1\(BBC\) & }
button .15 -text "BBC\ Radio\ 2\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ Radio\ 2\(BBC\) & }
button .16 -text "BBC\ Radio\ 3\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ Radio\ 3\(BBC\) & }
button .17 -text "BBC\ Radio\ 4\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ Radio\ 4\(BBC\) & }
button .18 -text "BBC\ Radio\ 7\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ Radio\ 7\(BBC\) & }
button .19 -text "BBC\ THREE\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ THREE\(BBC\) & }
button .20 -text "BBC\ TWO\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ TWO\(BBC\) & }
button .21 -text "BBC\ World\ Sv.\(BBC\)" -command { exec xterm -e mplayer dvb://BBC\ World\ Sv.\(BBC\) & }
button .22 -text "bid\ tv\(Sit-Up\ Ltd\)" -command { exec xterm -e mplayer dvb://bid\ tv\(Sit-Up\ Ltd\) & }
button .23 -text "Channel\ 4+1\(Channel\ 4\ TV\)" -command { exec xterm -e mplayer dvb://Channel\ 4+1\(Channel\ 4\ TV\) & }
button .24 -text "Channel\ 4\(Channel\ 4\ TV\)" -command { exec xterm -e mplayer dvb://Channel\ 4\(Channel\ 4\ TV\) & }
button .25 -text "CNN\(CNN\)" -command { exec xterm -e mplayer dvb://CNN\(CNN\) & }
button .26 -text "Dave\ ja\ vu\(UKTV\)" -command { exec xterm -e mplayer dvb://Dave\ ja\ vu\(UKTV\) & }
button .27 -text "Dave\(UKTV\)" -command { exec xterm -e mplayer dvb://Dave\(UKTV\) & }
button .28 -text "E4+1\(Channel\ 4\ TV\)" -command { exec xterm -e mplayer dvb://E4+1\(Channel\ 4\ TV\) & }
button .29 -text "E4\(Channel\ 4\ TV\)" -command { exec xterm -e mplayer dvb://E4\(Channel\ 4\ TV\) & }
button .30 -text "ESPN\(ESPN\)" -command { exec xterm -e mplayer dvb://ESPN\(ESPN\) & }
button .31 -text "Film4\(Channel\ 4\ TV\)" -command { exec xterm -e mplayer dvb://Film4\(Channel\ 4\ TV\) & }
button .32 -text "FIVE\(five\)" -command { exec xterm -e mplayer dvb://FIVE\(five\) & }
button .33 -text "FIVER\(five\)" -command { exec xterm -e mplayer dvb://FIVER\(five\) & }
button .34 -text "FIVE\ USA\(five\)" -command { exec xterm -e mplayer dvb://FIVE\ USA\(five\) & }
button .35 -text "Gay\ Rabbit\(Teletext\ Limited\)" -command { exec xterm -e mplayer dvb://Gay\ Rabbit\(Teletext\ Limited\) & }
button .36 -text "G.O.L.D.\(five\)" -command { exec xterm -e mplayer dvb://G.O.L.D.\(five\) & }
button .37 -text "Heart\(Global\ Radio\)" -command { exec xterm -e mplayer dvb://Heart\(Global\ Radio\) & }
button .38 -text "heat" -command { exec xterm -e mplayer dvb://heat & }
button .39 -text "Ideal\ Extra\(Ideal\ Shopping\ Direct\ PLC\)" -command { exec xterm -e mplayer dvb://Ideal\ Extra\(Ideal\ Shopping\ Direct\ PLC\) & }
button .40 -text "Ideal\ World" -command { exec xterm -e mplayer dvb://Ideal\ World & }
button .41 -text "ITV1\(ITV\)" -command { exec xterm -e mplayer dvb://ITV1\(ITV\) & }
button .42 -text "ITV2\ +1\(ITV\)" -command { exec xterm -e mplayer dvb://ITV2\ +1\(ITV\) & }
button .43 -text "ITV2\(ITV\)" -command { exec xterm -e mplayer dvb://ITV2\(ITV\) & }
button .44 -text "ITV3\(ITV\)" -command { exec xterm -e mplayer dvb://ITV3\(ITV\) & }
button .45 -text "ITV4\(ITV\)" -command { exec xterm -e mplayer dvb://ITV4\(ITV\) & }
button .46 -text "Kerrang\!" -command { exec xterm -e mplayer dvb://Kerrang\! & }
button .47 -text "Kiss" -command { exec xterm -e mplayer dvb://Kiss & }
button .48 -text "Magic" -command { exec xterm -e mplayer dvb://Magic & }
button .49 -text "More\ 4\(Channel\ 4\ TV\)" -command { exec xterm -e mplayer dvb://More\ 4\(Channel\ 4\ TV\) & }
button .50 -text "Premier\ Radio\(London\ Christian\ Radio\ Ltd\)" -command { exec xterm -e mplayer dvb://Premier\ Radio\(London\ Christian\ Radio\ Ltd\) & }
button .51 -text "price-drop\ tv\(sit-up\ limited\)" -command { exec xterm -e mplayer dvb://price-drop\ tv\(sit-up\ limited\) & }
button .52 -text "Q" -command { exec xterm -e mplayer dvb://Q & }
button .53 -text "QUEST\(Discovery\)" -command { exec xterm -e mplayer dvb://QUEST\(Discovery\) & }
button .54 -text "QVC\(QVC\)" -command { exec xterm -e mplayer dvb://QVC\(QVC\) & }
button .55 -text "Rabbit\(Teletext\ Limited\)" -command { exec xterm -e mplayer dvb://Rabbit\(Teletext\ Limited\) & }
button .56 -text "Russia\ Today\(Information\ TV\)" -command { exec xterm -e mplayer dvb://Russia\ Today\(Information\ TV\) & }
button .57 -text "Sky\ News\(Sky\)" -command { exec xterm -e mplayer dvb://Sky\ News\(Sky\) & }
button .58 -text "Sky\ Spts\ News\(Sky\)" -command { exec xterm -e mplayer dvb://Sky\ Spts\ News\(Sky\) & }
button .59 -text "SKY\ THREE\(Sky\)" -command { exec xterm -e mplayer dvb://SKY\ THREE\(Sky\) & }
button .60 -text "Smash\ Hits\!\(EMAP\)" -command { exec xterm -e mplayer dvb://Smash\ Hits\!\(EMAP\) & }
button .61 -text "SMOOTH\ RADIO\(GMG\)" -command { exec xterm -e mplayer dvb://SMOOTH\ RADIO\(GMG\) & }
button .62 -text "talkSPORT\(talkSPORT\)" -command { exec xterm -e mplayer dvb://talkSPORT\(talkSPORT\) & }
button .63 -text "The\ Hits\ Radio" -command { exec xterm -e mplayer dvb://The\ Hits\ Radio & }
button .64 -text "Ttext\ Holidays\(Teletext\ Limited\)" -command { exec xterm -e mplayer dvb://Ttext\ Holidays\(Teletext\ Limited\) & }
button .65 -text "Virgin1+1\(Virgin\ Media\ Television\ Limited\)" -command { exec xterm -e mplayer dvb://Virgin1+1\(Virgin\ Media\ Television\ Limited\) & }
button .66 -text "Virgin1\(Virgin\ Media\ Television\ Limited\)" -command { exec xterm -e mplayer dvb://Virgin1\(Virgin\ Media\ Television\ Limited\) & }
button .67 -text "VIVA\(MTV\ Europe\)" -command { exec xterm -e mplayer dvb://VIVA\(MTV\ Europe\) & }
grid .1 -column 0 -row 1 -sticky w
grid .2 -column 0 -row 2 -sticky w
grid .3 -column 0 -row 3 -sticky w
grid .4 -column 0 -row 4 -sticky w
grid .5 -column 0 -row 5 -sticky w
grid .6 -column 0 -row 6 -sticky w
grid .7 -column 0 -row 7 -sticky w
grid .8 -column 0 -row 8 -sticky w
grid .9 -column 0 -row 9 -sticky w
grid .10 -column 0 -row 10 -sticky w
grid .11 -column 0 -row 11 -sticky w
grid .12 -column 0 -row 12 -sticky w
grid .13 -column 0 -row 13 -sticky w
grid .14 -column 0 -row 14 -sticky w
grid .15 -column 0 -row 15 -sticky w
grid .16 -column 0 -row 16 -sticky w
grid .17 -column 0 -row 17 -sticky w
grid .18 -column 0 -row 18 -sticky w
grid .19 -column 0 -row 19 -sticky w
grid .20 -column 0 -row 20 -sticky w
grid .21 -column 0 -row 21 -sticky w
grid .22 -column 0 -row 22 -sticky w
grid .23 -column 0 -row 23 -sticky w
grid .24 -column 0 -row 24 -sticky w
grid .25 -column 0 -row 25 -sticky w
grid .26 -column 0 -row 26 -sticky w
grid .27 -column 1 -row 1 -sticky w
grid .28 -column 1 -row 2 -sticky w
grid .29 -column 1 -row 3 -sticky w
grid .30 -column 1 -row 4 -sticky w
grid .31 -column 1 -row 5 -sticky w
grid .32 -column 1 -row 6 -sticky w
grid .33 -column 1 -row 7 -sticky w
grid .34 -column 1 -row 8 -sticky w
grid .35 -column 1 -row 9 -sticky w
grid .36 -column 1 -row 10 -sticky w
grid .37 -column 1 -row 11 -sticky w
grid .38 -column 1 -row 12 -sticky w
grid .39 -column 1 -row 13 -sticky w
grid .40 -column 1 -row 14 -sticky w
grid .41 -column 1 -row 15 -sticky w
grid .42 -column 1 -row 16 -sticky w
grid .43 -column 1 -row 17 -sticky w
grid .44 -column 1 -row 18 -sticky w
grid .45 -column 1 -row 19 -sticky w
grid .46 -column 1 -row 20 -sticky w
grid .47 -column 1 -row 21 -sticky w
grid .48 -column 1 -row 22 -sticky w
grid .49 -column 1 -row 23 -sticky w
grid .50 -column 2 -row 1 -sticky w
grid .51 -column 2 -row 2 -sticky w
grid .52 -column 2 -row 3 -sticky w
grid .53 -column 2 -row 4 -sticky w
grid .54 -column 2 -row 5 -sticky w
grid .55 -column 2 -row 6 -sticky w
grid .56 -column 2 -row 7 -sticky w
grid .57 -column 2 -row 8 -sticky w
grid .58 -column 2 -row 9 -sticky w
grid .59 -column 2 -row 10 -sticky w
grid .60 -column 2 -row 11 -sticky w
grid .61 -column 2 -row 12 -sticky w
grid .62 -column 2 -row 13 -sticky w
grid .63 -column 2 -row 14 -sticky w
grid .64 -column 2 -row 15 -sticky w
grid .65 -column 2 -row 16 -sticky w
grid .66 -column 2 -row 17 -sticky w
grid .67 -column 2 -row 18 -sticky w

My next project in my migration from windows on my main machine is to write a script that works on the paste buffer to make construction of links and image HTML easy. I would highlight a link and then use a keypress to make it into HTML. Other functions I could write are window manipulation functions like making all Gimp windows a specific size.

Advertisements

2 thoughts on “Digital TV GUI & Linux vs AutoHotKey

  1. Pingback: Autohotkey for Linux « DJ'ing, Music, Humour, Life

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s