Skip to content

Instantly share code, notes, and snippets.

@Noxn
Created October 24, 2010 14:40
Show Gist options
  • Save Noxn/643574 to your computer and use it in GitHub Desktop.
Save Noxn/643574 to your computer and use it in GitHub Desktop.
$ 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 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment