Topic: sleep mode after a few minutes of inactivity
Is there a simple way, like a bash script or something similar, to make the computer go into sleep mode after a few minutes of inactivity?
You are not logged in. Please login or register.
We are very pleased and happy to announce the newest release of Hyperbola GNU/Linux-libre with v0.4.4.
See our official news for further details.
HyperForum → System → sleep mode after a few minutes of inactivity
Is there a simple way, like a bash script or something similar, to make the computer go into sleep mode after a few minutes of inactivity?
You can do it with xidle, doas and zzz
xidle -timeout 120 -program 'doas zzz' &
For easyness, you can place that at ~/.xinitrc, above the last line you would put to start the window manager, such as 'exec icewm-session':
xidle -timeout 120 -program 'doas zzz' &
exec icewm-session
You need to add yourself to the 'power' group.
Thank you very much, I will try it
After several attempts I managed to get it working.
xidle -program "/usr/bin/doas zzz" -timeout 7200 &
Xidle has a problem when the machine wakes up, after a few seconds it goes back to sleep mode, so I found this solution with Xautolock.
xidle -program "/usr/bin/xtrlock" -timeout 300 &
xautolock -time 30 -locker "/usr/bin/doas zzz" -detectsleep &
HyperForum → System → sleep mode after a few minutes of inactivity
Powered by PunBB, supported by Informer Technologies, Inc.