Skip to content

Instantly share code, notes, and snippets.

@guysoft
Last active October 11, 2015 03:18
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 guysoft/3794888 to your computer and use it in GitHub Desktop.
Save guysoft/3794888 to your computer and use it in GitHub Desktop.
A simple script that makes pidgin go automaticly idle away when AFK (uses xprintidle and purple-remote)
#!/bin/bash
#Simple pidgin Auto-Away
#By Guy Sheffer (GuySoft) <guysoft at gmail dot com>
#Set time
IDLE_TIME_MIN=15
FIX=60000
#SHIFT=16200000
SHIFT=0
IDLE_TIME=$(($IDLE_TIME_MIN * $FIX + $SHIFT))
status="none"
while true ; do
if [[ `xprintidle` -lt $IDLE_TIME ]]; then
if [[ $status != "avilable" ]]; then
status=avilable
purple-remote "setstatus?status=available"
fi
else
if [[ $status != "away" ]]; then
status=away
purple-remote "setstatus?status=away"
fi
fi
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment