This question already has an answer here:
for my job I want to track the time I am actually working on my computer. Therefore, I am wondering how it is possible to track the time I am logged in in Gnome but not locked the screen. Does anyone know if there is either a program or script for this purpose. Alternatively, it would also help, if somebody could point me to hooks for login, logout, lock screen, unlock screen, which i could use in order log the times of these events into a file.
Thanks in advance, Arnd