I run Openbox/LXDE on a somewhat special platform (a Banana Pi Pro) which doesn't have DPMS support. I have to run specific commands to put my HDMI screen to standby and switch it back on. My scripts work nicely when called directly, and now I want to call them the same way a screensaver is called: one script (let's call it screen_save) is to be called after X minutes of inactivity and another script (screen_restore) is to be called on an input event, provided screen_save was called in between this input event and the previous one.Do I have to write a daemon similar to xscreensaver which monitors the input and calls my scripts when necessary, or is there an existing screensaver daemon which could be configured to call my scripts? Or maybe there's a hook to xorg, openbox or lxde which I could use?
How to run custom script as screensaver in Openbox?
openbox;lxde;screensaver
There is xautolock which can start a script after some idle time.It is used like thisxautolock -time $MINUTES -locker $SCRIPTIt is supposed to be used with xlock which can lock the screen and starts a screensaver.Since you need to deactivate the screen when the timeout is reached and reactivate it when you move the mouse or press any key. You could do something like thisscreen_savexlock -nolock -mode blank -mousemotionscreen_restoreThe xlock process runs with a blank screen until the mouse is moved or a key is pressed and then it should reactivate your screen.To start it for Openbox you can addxautolock -time 10 -locker screen_lock&to your ~/.config/openbox/autostart. Don't forget the &.