<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: How to Limit Daily Desktop Usage in Ubuntu</title>
	<atom:link href="http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/</link>
	<description>Dad, Geek, Christian... Just trying to get the Word out.</description>
	<pubDate>Thu, 28 Aug 2008 15:09:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16597</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Mon, 18 Aug 2008 00:10:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16597</guid>
		<description>The modifications were done by a helpful person (.nedberg) on the Ubuntu forums.  I take no credit for his hard work. I wish I knew how to program / script but it's way over my head.  Thanks to people like you and .nedberg, Ubuntu is a joy to run.</description>
		<content:encoded><![CDATA[<p>The modifications were done by a helpful person (.nedberg) on the Ubuntu forums.  I take no credit for his hard work. I wish I knew how to program / script but it&#8217;s way over my head.  Thanks to people like you and .nedberg, Ubuntu is a joy to run.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16596</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Mon, 18 Aug 2008 00:08:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16596</guid>
		<description>and extendlimits.sh

#!/bin/bash

if [ $# -ne 1 ]; then
	echo "Usage $(basename $0) "
	exit
fi

if [[ -e "/var/lib/timekpr/$1.allow" ]]; then
	rm "/var/lib/timekpr/$1.allow"
	echo
	echo "$1 has been disallowed to log in outside of normal logon hours"
	echo
else
	touch /var/lib/timekpr/$1.allow
	echo
	echo "$1 has been allowed to log in outside of normal logon hours"
	echo
fi</description>
		<content:encoded><![CDATA[<p>and extendlimits.sh</p>
<p>#!/bin/bash</p>
<p>if [ $# -ne 1 ]; then<br />
	echo &#8220;Usage $(basename $0) &#8221;<br />
	exit<br />
fi</p>
<p>if [[ -e "/var/lib/timekpr/$1.allow" ]]; then<br />
	rm &#8220;/var/lib/timekpr/$1.allow&#8221;<br />
	echo<br />
	echo &#8220;$1 has been disallowed to log in outside of normal logon hours&#8221;<br />
	echo<br />
else<br />
	touch /var/lib/timekpr/$1.allow<br />
	echo<br />
	echo &#8220;$1 has been allowed to log in outside of normal logon hours&#8221;<br />
	echo<br />
fi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16595</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Mon, 18 Aug 2008 00:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16595</guid>
		<description>Here is a rewards script called addtime.sh

#!/bin/bash

if [ $# -ne 2 ]; then
	echo "Usage $(basename $0)  "
	exit
fi  

adj=$(($2*60))
now=$(cat /var/lib/timekpr/$1.time)
new=$(($now-$adj))
echo $new &#62; /var/lib/timekpr/$1.time
limit=$(cat /var/lib/timekpr/$1)
left=$(($limit-$new))
echo
echo "$2 minute(s) added to ${1}s account."
echo "$1 now has $(($left/60)) minute(s) left."
echo</description>
		<content:encoded><![CDATA[<p>Here is a rewards script called addtime.sh</p>
<p>#!/bin/bash</p>
<p>if [ $# -ne 2 ]; then<br />
	echo &#8220;Usage $(basename $0)  &#8221;<br />
	exit<br />
fi  </p>
<p>adj=$(($2*60))<br />
now=$(cat /var/lib/timekpr/$1.time)<br />
new=$(($now-$adj))<br />
echo $new &gt; /var/lib/timekpr/$1.time<br />
limit=$(cat /var/lib/timekpr/$1)<br />
left=$(($limit-$new))<br />
echo<br />
echo &#8220;$2 minute(s) added to ${1}s account.&#8221;<br />
echo &#8220;$1 now has $(($left/60)) minute(s) left.&#8221;<br />
echo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16594</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Mon, 18 Aug 2008 00:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16594</guid>
		<description>Have a look at this...

#!/bin/bash
###
# timekpr.sh - simple 
# watches gnome sessions and logs them out once the user has exceeded a set, per day limit
# /var/lib/timekpr/$username.time hold a count of seconds user has had a gnome session
# /var/lib/timekpr/$username hold the daily allowed seconds for the user
#
# you may need to install notify-send with: $apt-get install libnotify-bin
#
# Copyright 2008 Chris Jackson 
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# See . 
#

default_limit=86400 # All day, new users is given this value
grace_period=60 # how much time do we give to let the user log out?
poll_time=20 # How often the script should check the timelogs
from=7 # When is the users allowed to log in
to=22 # When is the users no longer allowed to be loged in


#Ubuntu uses alternatives so we look for x-session-manager instead of gnome-session
SESSION_MANAGER=x-session-manager

function logOut() {
## get the display and xauthority used by out session manager
            UDISPLAY=`grep -z DISPLAY \
                /proc/$pid/environ &#124; sed -e 's/DISPLAY=//'`
            XAUTHORITY=`grep -z XAUTHORITY \
                /proc/$pid/environ &#124; sed -e 's/XAUTHORITY=//'`
            
            # find DBUS session bus for this session
            DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS \
                /proc/$pid/environ &#124; sed -e 's/DBUS_SESSION_BUS_ADDRESS=//'`
            # use it - give a warning, then another one 1/2 way through grace_period
            XAUTHORITY="$XAUTHORITY" DISPLAY="$UDISPLAY" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
                notify-send --icon=gtk-dialog-warning --urgency=critical -t 10000 "$1" "Your session is about to expire! You have $grace_period sec to save your work and logout."
            sleep $(($grace_period/2))   # FIXME: this gives other sessions a free grace_period added to their accounting

            XAUTHORITY="$XAUTHORITY" DISPLAY="$UDISPLAY" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
                notify-send --icon=gtk-dialog-warning --urgency=critical -t 10000 "$1" "Your session is about to expire! You have $(($grace_period/2)) sec to save your work and logout."
            sleep $(($grace_period/2))   # FIXME: this gives other sessions a free grace_period added to their accounting

            XAUTHORITY="$XAUTHORITY" DISPLAY="$UDISPLAY" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
                notify-send --icon=gtk-dialog-warning --urgency=critical -t 10 "Shutting Down" "Shutting down session ($pid) now!" 
            # FIXME - should really check to see if user has logged out yet 
            sleep 10
            kill -HUP $pid    #this is a pretty bad way of killing a gnome-session, but we warned 'em
            
            ## uncomment the following to brutally kill all of the users processes
            sleep 10
            pkill -u $username  
            
            ## killing gnome-session should be more like:
            #DISPLAY=":0" XAUTHORITY="/tmp/.gdmEQ0V5T" SESSION_MANAGER="local/wretched:/tmp/.ICE-unix/$pid" su -c 'gnome-session-save --kill --silent' $username
            ## but this can still leave processes to cleanup - plus it's not easy to get SESSION_MANAGER
        
}


	# get the usernames and PIDs of sessions

while(true); do
    pidlists=$( ps --no-heading -fC $SESSION_MANAGER &#124; awk 'BEGIN{ FS=" " } { print $1 "," $2 }' )
    for pidlist in $pidlists; do
		
		# split username and pid - FIXME - I bet this would be faster with bash arrays and substitution 
		username=$( echo $pidlist &#124; awk 'BEGIN{ FS=","} { print $1}' )
		pid=$( echo $pidlist &#124; awk 'BEGIN{ FS=","} { print $2}' )
	      
	      # If the user is not enabled, give him $default_limit
	      if [[ ! -e "/var/lib/timekpr/$username" ]]; then
	      	echo $default_limit &#62; /var/lib/timekpr/$username
	      fi
	      
	      if [[ -e "/var/lib/timekpr/$username.time" &#38;&#38; `( stat -c '%z' /var/lib/timekpr/$username.time &#124; cut -c9,10 )` == `date +%d` ]]; then
	      	# the time file exists and was last touched today, add $poll_time seconds to it
	            timekpr=$(( `cat /var/lib/timekpr/$username.time` + $poll_time ))
			echo $timekpr &#62; /var/lib/timekpr/$username.time
		else  # the time file is missing or was last touched yesterday
			timekpr=$poll_time
			echo $timekpr &#62; /var/lib/timekpr/$username.time
	      fi

	      echo $username, $pid, $timekpr
	      
	      # Is the user allowed to be loged in at this time?
	      # We take it for granted that if they are allowed to log in all day ($default_limit) then
	      # they can log in whenever they want, ie they are normal users
	      if [ $(cat /var/lib/timekpr/$username) -ne $default_limit ]; then
	      	# Are we out of hours?
		      if ( [ $(date +%k) -lt $from ] &#124;&#124; [ $(date +%k) -ge $to ] ); then
		      	# Has the user been given extended log in hours?
		      	if [[ -e "/var/lib/timekpr/$username.allow" ]]; then
		      		# Was the extended log in hours given today?
		      		if [[ $(stat -c '%z' /var/lib/timekpr/$username.allow &#124; cut -c9,10) != $(date +%d) ]]; then
						logOut "Only log in between $from and $to"
						rm /var/lib/timekpr/$username.allow
					fi
				else
					# User has not been given extended log in hours
					logOut "Only log in between $from and $to"
				fi
		      fi
		fi
		
		# Is the limit exeeded
	      if [[ $timekpr -ge `cat /var/lib/timekpr/$username` ]]
	      then
			logOut "Daily time limit"
		fi
	done
	# Wait a while before we check again
	sleep $poll_time
done</description>
		<content:encoded><![CDATA[<p>Have a look at this&#8230;</p>
<p>#!/bin/bash<br />
###<br />
# timekpr.sh - simple<br />
# watches gnome sessions and logs them out once the user has exceeded a set, per day limit<br />
# /var/lib/timekpr/$username.time hold a count of seconds user has had a gnome session<br />
# /var/lib/timekpr/$username hold the daily allowed seconds for the user<br />
#<br />
# you may need to install notify-send with: $apt-get install libnotify-bin<br />
#<br />
# Copyright 2008 Chris Jackson<br />
#<br />
# This program is free software: you can redistribute it and/or modify<br />
# it under the terms of the GNU General Public License as published by<br />
# the Free Software Foundation, either version 3 of the License, or<br />
# (at your option) any later version.<br />
#<br />
# This program is distributed in the hope that it will be useful,<br />
# but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br />
# GNU General Public License for more details.<br />
#<br />
# See .<br />
#</p>
<p>default_limit=86400 # All day, new users is given this value<br />
grace_period=60 # how much time do we give to let the user log out?<br />
poll_time=20 # How often the script should check the timelogs<br />
from=7 # When is the users allowed to log in<br />
to=22 # When is the users no longer allowed to be loged in</p>
<p>#Ubuntu uses alternatives so we look for x-session-manager instead of gnome-session<br />
SESSION_MANAGER=x-session-manager</p>
<p>function logOut() {<br />
## get the display and xauthority used by out session manager<br />
            UDISPLAY=`grep -z DISPLAY \<br />
                /proc/$pid/environ | sed -e &#8217;s/DISPLAY=//&#8217;`<br />
            XAUTHORITY=`grep -z XAUTHORITY \<br />
                /proc/$pid/environ | sed -e &#8217;s/XAUTHORITY=//&#8217;`</p>
<p>            # find DBUS session bus for this session<br />
            DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS \<br />
                /proc/$pid/environ | sed -e &#8217;s/DBUS_SESSION_BUS_ADDRESS=//&#8217;`<br />
            # use it - give a warning, then another one 1/2 way through grace_period<br />
            XAUTHORITY=&#8221;$XAUTHORITY&#8221; DISPLAY=&#8221;$UDISPLAY&#8221; DBUS_SESSION_BUS_ADDRESS=&#8221;$DBUS_SESSION_BUS_ADDRESS&#8221; \<br />
                notify-send &#8211;icon=gtk-dialog-warning &#8211;urgency=critical -t 10000 &#8220;$1&#8243; &#8220;Your session is about to expire! You have $grace_period sec to save your work and logout.&#8221;<br />
            sleep $(($grace_period/2))   # FIXME: this gives other sessions a free grace_period added to their accounting</p>
<p>            XAUTHORITY=&#8221;$XAUTHORITY&#8221; DISPLAY=&#8221;$UDISPLAY&#8221; DBUS_SESSION_BUS_ADDRESS=&#8221;$DBUS_SESSION_BUS_ADDRESS&#8221; \<br />
                notify-send &#8211;icon=gtk-dialog-warning &#8211;urgency=critical -t 10000 &#8220;$1&#8243; &#8220;Your session is about to expire! You have $(($grace_period/2)) sec to save your work and logout.&#8221;<br />
            sleep $(($grace_period/2))   # FIXME: this gives other sessions a free grace_period added to their accounting</p>
<p>            XAUTHORITY=&#8221;$XAUTHORITY&#8221; DISPLAY=&#8221;$UDISPLAY&#8221; DBUS_SESSION_BUS_ADDRESS=&#8221;$DBUS_SESSION_BUS_ADDRESS&#8221; \<br />
                notify-send &#8211;icon=gtk-dialog-warning &#8211;urgency=critical -t 10 &#8220;Shutting Down&#8221; &#8220;Shutting down session ($pid) now!&#8221;<br />
            # FIXME - should really check to see if user has logged out yet<br />
            sleep 10<br />
            kill -HUP $pid    #this is a pretty bad way of killing a gnome-session, but we warned &#8216;em</p>
<p>            ## uncomment the following to brutally kill all of the users processes<br />
            sleep 10<br />
            pkill -u $username  </p>
<p>            ## killing gnome-session should be more like:<br />
            #DISPLAY=&#8221;:0&#8243; XAUTHORITY=&#8221;/tmp/.gdmEQ0V5T&#8221; SESSION_MANAGER=&#8221;local/wretched:/tmp/.ICE-unix/$pid&#8221; su -c &#8216;gnome-session-save &#8211;kill &#8211;silent&#8217; $username<br />
            ## but this can still leave processes to cleanup - plus it&#8217;s not easy to get SESSION_MANAGER</p>
<p>}</p>
<p>	# get the usernames and PIDs of sessions</p>
<p>while(true); do<br />
    pidlists=$( ps &#8211;no-heading -fC $SESSION_MANAGER | awk &#8216;BEGIN{ FS=&#8221; &#8221; } { print $1 &#8220;,&#8221; $2 }&#8217; )<br />
    for pidlist in $pidlists; do</p>
<p>		# split username and pid - FIXME - I bet this would be faster with bash arrays and substitution<br />
		username=$( echo $pidlist | awk &#8216;BEGIN{ FS=&#8221;,&#8221;} { print $1}&#8217; )<br />
		pid=$( echo $pidlist | awk &#8216;BEGIN{ FS=&#8221;,&#8221;} { print $2}&#8217; )</p>
<p>	      # If the user is not enabled, give him $default_limit<br />
	      if [[ ! -e "/var/lib/timekpr/$username" ]]; then<br />
	      	echo $default_limit &gt; /var/lib/timekpr/$username<br />
	      fi</p>
<p>	      if [[ -e "/var/lib/timekpr/$username.time" &amp;&amp; `( stat -c '%z' /var/lib/timekpr/$username.time | cut -c9,10 )` == `date +%d` ]]; then<br />
	      	# the time file exists and was last touched today, add $poll_time seconds to it<br />
	            timekpr=$(( `cat /var/lib/timekpr/$username.time` + $poll_time ))<br />
			echo $timekpr &gt; /var/lib/timekpr/$username.time<br />
		else  # the time file is missing or was last touched yesterday<br />
			timekpr=$poll_time<br />
			echo $timekpr &gt; /var/lib/timekpr/$username.time<br />
	      fi</p>
<p>	      echo $username, $pid, $timekpr</p>
<p>	      # Is the user allowed to be loged in at this time?<br />
	      # We take it for granted that if they are allowed to log in all day ($default_limit) then<br />
	      # they can log in whenever they want, ie they are normal users<br />
	      if [ $(cat /var/lib/timekpr/$username) -ne $default_limit ]; then<br />
	      	# Are we out of hours?<br />
		      if ( [ $(date +%k) -lt $from ] || [ $(date +%k) -ge $to ] ); then<br />
		      	# Has the user been given extended log in hours?<br />
		      	if [[ -e "/var/lib/timekpr/$username.allow" ]]; then<br />
		      		# Was the extended log in hours given today?<br />
		      		if [[ $(stat -c '%z' /var/lib/timekpr/$username.allow | cut -c9,10) != $(date +%d) ]]; then<br />
						logOut &#8220;Only log in between $from and $to&#8221;<br />
						rm /var/lib/timekpr/$username.allow<br />
					fi<br />
				else<br />
					# User has not been given extended log in hours<br />
					logOut &#8220;Only log in between $from and $to&#8221;<br />
				fi<br />
		      fi<br />
		fi</p>
<p>		# Is the limit exeeded<br />
	      if [[ $timekpr -ge `cat /var/lib/timekpr/$username` ]]<br />
	      then<br />
			logOut &#8220;Daily time limit&#8221;<br />
		fi<br />
	done<br />
	# Wait a while before we check again<br />
	sleep $poll_time<br />
done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16593</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Sun, 17 Aug 2008 23:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16593</guid>
		<description>Cris,

I added the libnotify package and it worked out great.  I also have a modified version of your script I'd like to send you.  It limits the users login so that if they are logged out at 10pm (for instance), they can't simply wait until midnight and start over.  You can set the allowed time frame for usage to prevent sneaky kids.

I have one problem though.  I added the line indicated above that should start the script upon reboot but it doesn't restart.  My youngest has already learned all she needs to do is reboot the computer and she has unlimited time (unless I login and launch the script).

I added a line to /etc/rc.local

/usr/local/bin/timekpr &#38;

This isn't working, can you help me with this?</description>
		<content:encoded><![CDATA[<p>Cris,</p>
<p>I added the libnotify package and it worked out great.  I also have a modified version of your script I&#8217;d like to send you.  It limits the users login so that if they are logged out at 10pm (for instance), they can&#8217;t simply wait until midnight and start over.  You can set the allowed time frame for usage to prevent sneaky kids.</p>
<p>I have one problem though.  I added the line indicated above that should start the script upon reboot but it doesn&#8217;t restart.  My youngest has already learned all she needs to do is reboot the computer and she has unlimited time (unless I login and launch the script).</p>
<p>I added a line to /etc/rc.local</p>
<p>/usr/local/bin/timekpr &amp;</p>
<p>This isn&#8217;t working, can you help me with this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16592</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 14 Aug 2008 19:38:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16592</guid>
		<description>bucknasty:
Yes, there is a bit of a bug that allows one loop or so worth of time before checking for live sessions so, 20 - 40 seconds passes before a new login gets kicked.  
The code depends on a utility called 'notify-send' which I think is in the libnotify package on Fedora and Ubuntu. Without this, notification area applet, and d-bus running, you don't get alerts, but these are common defaults on current Ubuntu and Fedora systems.
If you still have issues, drop a message here - I have been needing to put some time into making this more useful to people other than myself, so the feedback helps.</description>
		<content:encoded><![CDATA[<p>bucknasty:<br />
Yes, there is a bit of a bug that allows one loop or so worth of time before checking for live sessions so, 20 - 40 seconds passes before a new login gets kicked.<br />
The code depends on a utility called &#8216;notify-send&#8217; which I think is in the libnotify package on Fedora and Ubuntu. Without this, notification area applet, and d-bus running, you don&#8217;t get alerts, but these are common defaults on current Ubuntu and Fedora systems.<br />
If you still have issues, drop a message here - I have been needing to put some time into making this more useful to people other than myself, so the feedback helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16591</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Wed, 13 Aug 2008 05:05:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16591</guid>
		<description>Okay, I got past the permissions error by running sudo -i and then running the command.

The file was made and I set it to 300 for testing.  I watched it tick away, and then several more minutes went bye.  Then suddenly it logged me off.  It NEVER displayed a warning.  I'm fine with that.

PROBLEM:  Once it logged me out of my test user, it let me log right back in again.  I waiting to see if this will kick me off again.

There needs to be a way to prevent the person from logging back in and stealing yet a few more minutes.</description>
		<content:encoded><![CDATA[<p>Okay, I got past the permissions error by running sudo -i and then running the command.</p>
<p>The file was made and I set it to 300 for testing.  I watched it tick away, and then several more minutes went bye.  Then suddenly it logged me off.  It NEVER displayed a warning.  I&#8217;m fine with that.</p>
<p>PROBLEM:  Once it logged me out of my test user, it let me log right back in again.  I waiting to see if this will kick me off again.</p>
<p>There needs to be a way to prevent the person from logging back in and stealing yet a few more minutes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16590</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Wed, 13 Aug 2008 04:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16590</guid>
		<description>I can't get this to work on Hardy 8.04.1 32bit.  Here is the error

test@MSI-K8N-NEO4-PLAT-SLI:~$ sudo echo 300 &#62; /var/lib/timekpr/test
bash: /var/lib/timekpr/test: Permission denied
test@MSI-K8N-NEO4-PLAT-SLI:~$ 

I logged in as the primary original and as the newly created test account and get the same error each time.

Help me make this work please.</description>
		<content:encoded><![CDATA[<p>I can&#8217;t get this to work on Hardy 8.04.1 32bit.  Here is the error</p>
<p>test@MSI-K8N-NEO4-PLAT-SLI:~$ sudo echo 300 &gt; /var/lib/timekpr/test<br />
bash: /var/lib/timekpr/test: Permission denied<br />
test@MSI-K8N-NEO4-PLAT-SLI:~$ </p>
<p>I logged in as the primary original and as the newly created test account and get the same error each time.</p>
<p>Help me make this work please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucknasty</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16589</link>
		<dc:creator>bucknasty</dc:creator>
		<pubDate>Tue, 12 Aug 2008 21:46:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16589</guid>
		<description>Wow!  I really want to thank you for this.  I've been looking for EXACTLY this script at the request of my wife.  She had my back against the wall and was going to make me install windows so that NetNanny could be installed.  I sure hope this works as described on my system.  Life will be good again.  Thanks.  I use Ubuntu 8.04.1</description>
		<content:encoded><![CDATA[<p>Wow!  I really want to thank you for this.  I&#8217;ve been looking for EXACTLY this script at the request of my wife.  She had my back against the wall and was going to make me install windows so that NetNanny could be installed.  I sure hope this works as described on my system.  Life will be good again.  Thanks.  I use Ubuntu 8.04.1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hogyan?</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16588</link>
		<dc:creator>Hogyan?</dc:creator>
		<pubDate>Sat, 09 Aug 2008 21:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16588</guid>
		<description>&lt;strong&gt;Napi számítógéphasználat korlátozása Ubuntun...&lt;/strong&gt;

Ebben a leírásban egy olyan, Ubuntu alatt használható módszert mutatok be, amivel a rendszer felhasználóinak számítógép használati idejét lehet korlátozni. Amennyiben az el?re beállított id? lejár, a felhasználó kijelentkezik, és ...</description>
		<content:encoded><![CDATA[<p><strong>Napi számítógéphasználat korlátozása Ubuntun&#8230;</strong></p>
<p>Ebben a leírásban egy olyan, Ubuntu alatt használható módszert mutatok be, amivel a rendszer felhasználóinak számítógép használati idejét lehet korlátozni. Amennyiben az el?re beállított id? lejár, a felhasználó kijelentkezik, és &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16587</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 01 Aug 2008 13:25:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16587</guid>
		<description>redbob -
You must be using Ubuntu? Ubuntu has changed the default shell from bash to dash. I coded this for bash so running it with:

$ sh /usr/local/bin/timekpr.sh

will over ride the #! line in the script and use the wrong shell. To fix it, either run as:

$ bash /usr/local/bin/timekpr.sh

or set it executable ( "$ chmod 755 /usr/local/bin/timekpr.sh" ) and execute it directly.

I'll have to look at making it "dash" compatible at some point.</description>
		<content:encoded><![CDATA[<p>redbob -<br />
You must be using Ubuntu? Ubuntu has changed the default shell from bash to dash. I coded this for bash so running it with:</p>
<p>$ sh /usr/local/bin/timekpr.sh</p>
<p>will over ride the #! line in the script and use the wrong shell. To fix it, either run as:</p>
<p>$ bash /usr/local/bin/timekpr.sh</p>
<p>or set it executable ( &#8220;$ chmod 755 /usr/local/bin/timekpr.sh&#8221; ) and execute it directly.</p>
<p>I&#8217;ll have to look at making it &#8220;dash&#8221; compatible at some point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: redbob</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16586</link>
		<dc:creator>redbob</dc:creator>
		<pubDate>Thu, 31 Jul 2008 12:29:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16586</guid>
		<description>Hy Chris! I tried to use your script, but no way. I tried to execute it at console, then  CLI sends a error message like this:

/usr/local/bin/timekpr.sh: 94: [[: not found
/usr/local/bin/timekpr.sh: 94: [[: not found
robson, 6202, 20

The value stored in /var/lib/timekpr/robson.time is 20, never more than it.

Could you help me?</description>
		<content:encoded><![CDATA[<p>Hy Chris! I tried to use your script, but no way. I tried to execute it at console, then  CLI sends a error message like this:</p>
<p>/usr/local/bin/timekpr.sh: 94: [[: not found<br />
/usr/local/bin/timekpr.sh: 94: [[: not found<br />
robson, 6202, 20</p>
<p>The value stored in /var/lib/timekpr/robson.time is 20, never more than it.</p>
<p>Could you help me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16585</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 30 May 2008 02:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16585</guid>
		<description>Thanks for the ideas, wagnerpereirasp! I have just started to play with pygtk to see how easy a UI would be and have been thinking about moving the time and limits data to sqlite3.
I  currently limit access to the data files by making them only editable but root or an sudoer - there should be a better way. The script has to run as root to force shutdown someone anyone's session. I wish there was a cleaner way to shutdown gnome-session other than just killing it, but I haven't found one yet.

A system tray applet that displays the remaining time and can launch the time editor (after a gksudo login) sounds like a great idea!

Translations is also a great idea - I am afraid I'm personally limited to English, so any help is appreciated!</description>
		<content:encoded><![CDATA[<p>Thanks for the ideas, wagnerpereirasp! I have just started to play with pygtk to see how easy a UI would be and have been thinking about moving the time and limits data to sqlite3.<br />
I  currently limit access to the data files by making them only editable but root or an sudoer - there should be a better way. The script has to run as root to force shutdown someone anyone&#8217;s session. I wish there was a cleaner way to shutdown gnome-session other than just killing it, but I haven&#8217;t found one yet.</p>
<p>A system tray applet that displays the remaining time and can launch the time editor (after a gksudo login) sounds like a great idea!</p>
<p>Translations is also a great idea - I am afraid I&#8217;m personally limited to English, so any help is appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wagnerpereirasp</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16584</link>
		<dc:creator>wagnerpereirasp</dc:creator>
		<pubDate>Tue, 27 May 2008 21:48:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16584</guid>
		<description>Hi Chris, I loved this script. I'll put it to use as is to do the same need you mentioned.

But I'll also try to upgrade it, here is a list of functionalities I believe we can improve:

Must Have
1) Different limitations per day of the week
2) Limit not only by seconds in use, also by specific times of the day, it would be like the user connects but has only 30 seconds to logout (or will be forced logout) if he is not inside a allowed window.
3) Hability to extend the allowed time for the current day if an administrator types in a password and how many time to extend (this would attend your need to give extra time as reward).

Good to Have
4) A graphical interface to administer these options
5) Prevent the user to manually change his control file to "obtain" extra time.
6) A better logout method, something that pushes a logout allowing to save data
7) Support for different languages, best if it is done by plug ins (will allow anyone to create a plug in)
8) Create a control window for the user, so he can check the remaining time at any time and giving him some options, could be the ability to use extra credit (off course reducing the credit from a pool)
9) Create a .deb package

I personally don't have much available time, but I also need to ensure proper usage for my teenagers (that is thought) so I will try, first thing first, I will translate the script to Brazilian-Portuguese as I am from Brazil and post it for anyone else to use.</description>
		<content:encoded><![CDATA[<p>Hi Chris, I loved this script. I&#8217;ll put it to use as is to do the same need you mentioned.</p>
<p>But I&#8217;ll also try to upgrade it, here is a list of functionalities I believe we can improve:</p>
<p>Must Have<br />
1) Different limitations per day of the week<br />
2) Limit not only by seconds in use, also by specific times of the day, it would be like the user connects but has only 30 seconds to logout (or will be forced logout) if he is not inside a allowed window.<br />
3) Hability to extend the allowed time for the current day if an administrator types in a password and how many time to extend (this would attend your need to give extra time as reward).</p>
<p>Good to Have<br />
4) A graphical interface to administer these options<br />
5) Prevent the user to manually change his control file to &#8220;obtain&#8221; extra time.<br />
6) A better logout method, something that pushes a logout allowing to save data<br />
7) Support for different languages, best if it is done by plug ins (will allow anyone to create a plug in)<br />
 <img src='http://www.91courtstreet.net/wordpress/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Create a control window for the user, so he can check the remaining time at any time and giving him some options, could be the ability to use extra credit (off course reducing the credit from a pool)<br />
9) Create a .deb package</p>
<p>I personally don&#8217;t have much available time, but I also need to ensure proper usage for my teenagers (that is thought) so I will try, first thing first, I will translate the script to Brazilian-Portuguese as I am from Brazil and post it for anyone else to use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16583</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 12 May 2008 12:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16583</guid>
		<description>I had tried timeoutd - one of the problems I found with it is that it doesn't seem to give any warnings to the desktop when it is about to kill your session. I does fit a real need, it can limit console and shell sessions as well, but it doesn't really fit my need/want as well.

My script is in active use at our house and has been effective in limiting my teens computer time - that being said, I really need to add a GUI so my wife can control their time allotments and I would like to add some kind of a reward system where Mom can give them extra time to use when they want when they have earned it.</description>
		<content:encoded><![CDATA[<p>I had tried timeoutd - one of the problems I found with it is that it doesn&#8217;t seem to give any warnings to the desktop when it is about to kill your session. I does fit a real need, it can limit console and shell sessions as well, but it doesn&#8217;t really fit my need/want as well.</p>
<p>My script is in active use at our house and has been effective in limiting my teens computer time - that being said, I really need to add a GUI so my wife can control their time allotments and I would like to add some kind of a reward system where Mom can give them extra time to use when they want when they have earned it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aliencam</title>
		<link>http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16582</link>
		<dc:creator>aliencam</dc:creator>
		<pubDate>Sun, 11 May 2008 07:24:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.91courtstreet.net/wordpress/2008/02/03/how-to-limit-daily-desktop-usage-in-ubuntu/#comment-16582</guid>
		<description>Hi, I was looking for a program that does exactly this, and I found something called timeoutd in the repos as well.  I was wondering if you have seen this or if you have made any changes to your script since the last update.</description>
		<content:encoded><![CDATA[<p>Hi, I was looking for a program that does exactly this, and I found something called timeoutd in the repos as well.  I was wondering if you have seen this or if you have made any changes to your script since the last update.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
