I sometimes fall asleep when using my computer. Is it possible to determine what time the screen saver turned on and therefore when I stopped using the computer and fell asleep?
You can just write a bash script to check if the screensaver is running.
I wrote a quick one that you could background, of course things can be added to make it work nicely according to your needs
You can add a sleep 2 or something in the middle, and then just background it, but the program will have to be run again after every time your screensaver is run, you could probably set something up to check if its running or not in a cron, really the sky's the limit with these scripts.
in the end you'll get a ps aux line printed to a file and within that line it will have the time that the program started.
if you want to to continue, like a log for when the screen falls asleep, you can always change the
I hope that this helps!
I just realized an easy way to make this more of a constant service: