On 2010-11-30, mpnordland <mpnordl...@gmail.com> wrote: > I have situation where I need to be able to get the current active > user, and catch user switching eg user1 locks screen, leaves computer, > user2 comes, and logs on. > basically, when there is any type of user switch my script needs to > know.
Well you could use inotify to trigger on any changes to /var/log/wtmp. When a change is detected, you could check of deltas in the output of "who -a" to figure out what has changed since the last time wtmp triggered. -- http://mail.python.org/mailman/listinfo/python-list