$ ruby TheSIGnal.rb ~/untz-untz.ogg # start music deamon
Started as 13561
$ kill -s SIGSTOP 13561 # pause
$ kill -s SIGCONT 13561 # unpause
Note left by Noxn: Not tested because I lack rubygame and dont want it on my vps.
# gem install rubygame | |
# | |
# Rubygame needs the SDL lib | |
require "rubygame" | |
Process.daemon | |
puts "Started as #{$$}" | |
song = Rubygame::Music.load(ARGV[0]) | |
song.play | |
Signal.trap(:STOP) { song.pause } | |
Signal.trap(:CONT) { song.unpause } | |