Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-13-2011, 09:24 AM   #1
LQ Newbie
Registered: Sep 2011
Location: Romania
Distribution: Ubuntu 11.04
Posts: 2

Rep: Reputation: Disabled
User login & lock screen monitor


I use Ubuntu 11.04 with GUI.

I want to monitor my user for login/logout and lock/unlock screen.
I want to see:
  • the total time I spend daily on computer: the time between first time I login or unlock screen and last time I logout or lock screen
  • and the real time: total time - the time that my user was logout or screen was locked.
There is a way to do this? There is a program that can do that?
I tried who/last and to retrieve information from utmp and wtmp files, but is not quite I want.

I don't mind if I have to write this code myself, but I don't know how to catch lock/unlock screen events.

Old 09-16-2011, 04:51 AM   #2
Registered: May 2010
Location: UK
Distribution: OpenSuse 64 bit
Posts: 45

Rep: Reputation: 15
Hi, maybe you could find this useful:

yum install psacct

chkconfig psacct on
# /etc/init.d/psacct start

ac -p

lastcomm username

lastcomm somecommand

lastcomm pts/1

sa -u



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to lock screen while login as root aquamarine Linux - Newbie 2 02-21-2011 02:07 AM
Disable lock session (lock screen) when switch user in KDE 4.x Murz Linux - Desktop 4 12-01-2010 09:28 AM
Num lock OFF and Caps & Screen Lock ON at Linux startup. Reversing? peteyperson Linux - Newbie 2 02-28-2009 12:44 PM
Another user login after lock screen devrajdp Linux - Enterprise 4 12-04-2008 02:09 AM
screen lock login ( from Screensaver) ptrbee Linux - Newbie 0 07-06-2004 09:42 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration