I want to access the screensaver state of ubuntu (when my laptop is idle for some minute) . And run an application if screensaver start and if I click or stir mouse pad then application should exit as screensaver exit.

After searching on google I come to a command

  xssstate -i 

But I don't know what it does and How can I use it?


You can use xssstate -s to check out screensaver's status:

$ xssstate -s

then based on the output decide what you have to do.

-i returns X's idle time.

You can create a simple script and run it using cron then on that script use xssstate to see if you have to run or end your program.

  • Is there any other command that I can use to capture the status of screensaver. I don't want to install any extra package. – ironman Sep 26 '18 at 11:56
  • What's wrong with xssstate? it's from "suckless-tools" and really lightweight. You can also use xprintidle but you have to install that too. – Ravexina Sep 26 '18 at 12:02

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.