Skip to content

Instantly share code, notes, and snippets.

@guysoft
Last active October 11, 2015 03:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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