Can bash check if screensaver is running?
I have a bash script that messages the user periodically.
Is there any way in the script to check if the screensaver is running, so the script doesn't spam messages while the user is away? The xscreensaver process is always running in the background, I've noticed. What would be the best way to go about this? |
The gnome-screensaver offers the possibility to query the state of the screensaver with the following command:
Code:
gnome-screensaver-command -q |
Interestingly gnome screensaver shows up in the process list. The query responds with "inactive" and "not inhibited".
The things you learn ... |
Code:
xscreensaver-command -time |
Thanks Bratmon. But no cigar. I've created this script:
Code:
#!/bin/bash Code:
xscreensaver-command: no screensaver is running on display :0.0 So, I'm still at square one. |
All times are GMT -5. The time now is 10:23 PM. |