You are not logged in.
Hi all.
Whenever I press the 'Hibernate' button on the Logout dialog the system hibernates fine; however on resuming I find that although the screen is locked, there is no screensaver. There is supposed to be, since I enabled the following code as a service:
[Unit]
Description=LightLocker
Before=sleep.target
[Service]
User=guajardo
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/xscreensaver-command -lock
[Install]
WantedBy=sleep.target
This doesn't happen when I type 'systemctl hibernate' or 'xfce4-session-logout --hibernate' on a terminal. Is it possible to edit the target of the button "Hibernate" on the Logout dialog so as to execute the first one? I understand that pressing the button executes the second one.
Thanks!
Last edited by AdbekunkusMX (2018-05-21 23:14:16)
Quid non intellegas aut tace aut disce.
Offline
Hello and welcome.
One way is to override the xfce4-session-logout executable. Create the file /usr/local/bin/xfce4-session-logout with the following content:
#!/bin/bash
case $1 in
"--hibernate")
systemctl hibernate
;;
*)
/usr/bin/xfce4-session-logout "$1"
;;
esac
exit 0
...and make it executable. When Xfce executes xfce4-session-logout, this executable will run first (because the folder is earlier in your PATH) and will act differently if "--hibernate" is passed as a parameter. Otherwise it passes it on to the real xfce4-session-logout executable.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Hello and welcome.
One way is to override the xfce4-session-logout executable. Create the file /usr/local/bin/xfce4-session-logout with the following content:
#!/bin/bash case $1 in "--hibernate") systemctl hibernate ;; *) /usr/bin/xfce4-session-logout "$1" ;; esac exit 0
...and make it executable. When Xfce executes xfce4-session-logout, this executable will run first (because the folder is earlier in your PATH) and will act differently if "--hibernate" is passed as a parameter. Otherwise it passes it on to the real xfce4-session-logout executable.
Thanks! Works perfectly! Many kudos to you.
Quid non intellegas aut tace aut disce.
Offline
[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 521.23 KiB (Peak: 522.07 KiB) ]