1

Is it possible, on Linux, to execute a program when the screensaver starts without using 3rd party tools?

For example:

I have a script that will run a who command and log the output to a file. I want this script to execute when I leave my computer and the screensaver starts, how would I do this without using third party software?

1

From the XScreenSaver Faq:

How do I run a particular program when the screen blanks/unblanks?

You can do that using xscreensaver-command -watch.

Explanation and example from the manual:

-watch

  • Credit to user ST34M for finding this link. It was posted as a link-only answer that was deleted in the LQ Post review queue before I could finish editing it. – fixer1234 Dec 31 '15 at 10:00
  • This is awesome, I've been searching for an answer to this question for days. Would there also be a way to tell how long it's been idle? – 13aal Dec 31 '15 at 12:49
  • 1
    @Ekult3k: Click on the Manual link in the answer and scroll to -time. That gets you pretty close. – fixer1234 Dec 31 '15 at 13:14

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.