XFCE: Lock Screen With Slimlock and Systemd

The default configuration of Systemd does not allow XFCE’s power manager to utilize any software to lock screen after successful hibernation/suspend command is used. This is how to make it work…

Assumptions/Summary

I want to:

  • use XFCE PowerManager to manager the hibernation/suspend process
  • use slimlock (as part of the SLiM login manager) instead of the default xflock4 (as part of XFCE)

Hence, I need to:

  • enable settings in Xfce Settings:
    Hardware -> Power Manager -> System -> Lock screen when system is going for sleep
  • enable another setting in Xfce Settings:
    System -> Session and Startup -> Advanced -> Lock screen before sleep
  • disable systemd management to not manage related features (will be discussed in a jiffy)
  • create a symbolic link to “fake” the xflock4 binary (will be discussed later)

Disable systemd management of features you want

Edit /etc/systemd/logind.conf
and add:

HandlePowerKey=ignore
HandleLidSwitch=ignore
LidSwitchIgnoreInhibited=no

You can experiment with the other features later…

Create symbolic link

First check, that the system PATH variable contains the directories in the following order:

echo $PATH                                   
/usr/local/sbin:/usr/local/bin:/usr/bin

As root, create the symlink:

ln -s /usr/bin/slimlock /usr/local/bin/xflock4

And that’s it…

source — Thanks a lot, pal!

Advertisements
This entry was posted in Linux, Security and tagged , , , , , , , . Bookmark the permalink.