Skip to content

Instantly share code, notes, and snippets.

@outoftime
Created July 18, 2012 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save outoftime/3136544 to your computer and use it in GitHub Desktop.
Save outoftime/3136544 to your computer and use it in GitHub Desktop.
Set away status in xchat on screensaver events
#!/usr/bin/env ruby
IO.popen('/usr/bin/xscreensaver-command -watch') do |io|
while line = io.gets
case line
when /^BLANK\b/, /^LOCK\b/
system('xchat', '-e', '--command=away')
when /^UNBLANK\b/
system('xchat', '-e', '--command=back')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment