Xprintidle is a utility that queries the X server for the user’s idle time and prints it to stdout (in milliseconds). You could use it to check if anyone was sitting on your computer while you were away 😛 or even write scripts to perfom simple tasks like limiting your total idle time or send mails and notices.
# apt-get install xprintidle
while [ 1 ]; do if [ `xprintidle` -gt 120000 ]; then notify-send "You have been idle for 2 mins" break fi sleep 1 done
This script will send a notification when idle is more than 2mins and stop.
Be creative 😀
A nice way to send commands to xchat from the command line is by using D-Bus. D-Bus is a system for software applications to communicate with one another. A nice command tool for that job is dbus-send and comes with the “dbus” package in debian.
First of all you need to install the following packages.
For debian/ubuntu users:
# aptitude install imagemagick html2ps lm-sensors
*lm-sensors needs to be configured before you can use it
Now download this script and execute it as normal user.
$ sh drawinfo.sh
A file called “Drawinfo.png” will be created and it looks something like that.