Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Player
- def liquidsoap
- pid = fork do
- Signal.trap("HUP") { exit }
- Process.spawn "cd ~/Pulpit; liquidsoap serwer.liq"
- end
- Process.kill("HUP", pid)
- Process.wait
- end
- def mplayer
- pid_2 = fork do
- Signal.trap("HUP") { exit }
- Process.spawn "mplayer http://127.0.0.1:8000/stream.ogg"
- end
- Process.kill("HUP", pid_2)
- Process.wait
- end
- def pavucontrol
- pid_3 = fork do
- Signal.trap("HUP") { exit }
- Process.spawn "pavucontrol"
- end
- Process.kill("HUP", pid_3)
- Process.wait
- end
- end
- run = Player.new
- run.liquidsoap
- run.mplayer
- run.pavucontrol
- at_exit {
- exec("killall liquidsoap; killall mplayer; killall pavucontrol")
- puts "Zdechły"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement