Created
July 18, 2012 14:34
-
-
Save outoftime/3136544 to your computer and use it in GitHub Desktop.
Set away status in xchat on screensaver events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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