Well, portability looks like it is still a ways off, mean time I came up with a highly portable, and very crude edition. You all are the pro's so I'm posting it here for some critiques.
Code:
#!/bin/bash
# This script depends upon wmtimer, it is a crude script to log off a user after a certain amount of time. Idea is all based on timekpr (https://launchpad.net/timekpr) , however they are more talented than I. :)
#Now requires: wmtimer zenity
time1=00:45:00
time2=00:15:00
time3=00:02:00
wmtimer -a -c -t $time1 -b & sleep 45m
killall wmtimer
zenity --info --text "You have 15 minutes left." &&
wmtimer -color red -a -c -t 00:00:10 -b & sleep 13m
zenity --info --text "Save your work! 2 Min Warning!" & sleep 2m
killall wmtimer
pkill -KILL -u $USER
exit
I named it timelimit, and put it in /usr/bin then created a .profile for each user, and put timelimit & in the profile. It is crude, but functional for the time being. Any bash script improvements are appreciated. Thanks.
Shane
Bookmarks