I was wondering how to measure the time elapsed after, say, screensaver starts and then show that time on a freedesktop notification when back.

  • 3
    The xprintidle command gives you the idle time in milliseconds for the corresponding display – Stéphane Chazelas Mar 12 '14 at 15:28
  • At least in my archlinux KDE4 system the command is not available if not installed from AUR, I'm looking for something more native if possible – Nico Rodsevich Mar 12 '14 at 18:15
  • There's also xssstate -i from suckless.org – Stéphane Chazelas Mar 12 '14 at 19:59
  • @NicoRodsevich What do you mean by "more native"? "In official Arch repos" doesn't necessarily equate to "more native". – Sparhawk Jul 27 '14 at 1:47
  • @Sparhawk I mean something that is common to most GNU/Linux distros, that comes from the very beginning, with the install of the system – Nico Rodsevich Jul 28 '14 at 3:19

Add the following lines to your XResources file


This is if xcreensaver is your screensaver, you can replace it with your favorite screensaver utility.

You can then grep the log file.

  • Sorry I didn't comment before, didn't have the reputation to do so. I don't have that file in ~, only .Xdefaults and .Xauthority – Nico Rodsevich Jul 30 '14 at 15:40
  • You can create the file, I think Xdefaults also works. – delta24 Jul 31 '14 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.