5 set STREAM "https://rawk.distorted.org.uk/rawk"
6 catch { source $env(HOME)/.play-rawk }
9 gst-launch-1.0 uridecodebin uri=$STREAM ! \
10 pulsesink client-name=play-rawk]
14 set status "\[Not started]"
16 proc update-status {} {
17 global kidstat playing status
18 set r [gets $kidstat line]
21 } elseif {[eof $kidstat]} {
24 .play configure -text "Play"
25 set status "\[Stopped]"
30 global playing kidstat
32 if {$playing} { catch { kill [pid $kidstat] } }
35 proc toggle-playing {} {
36 global CMD playing kidstat
41 set kidstat [open "|$CMD 2>@1"]
42 fconfigure $kidstat -blocking false -buffering line
43 fileevent $kidstat readable update-status
44 .play configure -text "Stop"
56 -command "toggle-playing"
61 pack .play -side left -padx 2 -pady 2
62 pack .status -side left -padx 2 -pady 2 -fill x -expand true
64 bind . "z" { wm iconify . }
65 bind . <space> { .play invoke }
66 ##bind . <KeyPress> { puts "key <%K>" }
67 wm protocol . "WM_DELETE_WINDOW" { byebye }