One of the most basic security features of any laptop or workstation is the ability to lock the sscreen. It might be convenient in many other, non-security related, scenarios as well. In most cases, this feature works without user's intervention on most of the Linux distributions, yet it did not work for me in Xfce4 with LightDM on Arch Linux. As I understand, Xfce does not have its display manager, so it relies on third-party solutions, mostly Gnome Display Manager (GDM). As I prefer Xfce as my desktop environment, I did not want to install GDM as it needs many Gnome libraries to work. Because of this, I decided to use LighDM as my display manager, which is more desktop environment agnostic and lightweight. Unfortunately, Xfce lacks proper integration with it (at least in Arch Linux). In this post, I want to provide a solution to this problem. Moreover, I believe that information in this post might give some ideas to the users of the other desktop environments and window managers on how to integrate them with LightDM.

To some extent, this post is a continuation of the other LightDM related post which I have posted earlier.

If the first two buttons from the image below do not work on your system, you might want to continue reading this post.

How Xfce Initiates Screen Locking and User Switching Xfce does not do screen locking or user switching itself, it delegates this functionality to the other programs. For screen locking Xfce executes xflock4 program which is a shell script. The script locks the session by calling the following programs if they are present on the system (in the following order): xscreensaver-command gnome-screensaver-command xlock slock Similarly, Xfce delegates user switching to the gdmplexiserver which is (or was) a part of the Gnome Display Manager package. As you can see, Xfce is attuned to reuse some of the parts of the GNOME desktop environment. Considering that LightDM has its utility to control itself, the dm-tool , we might try to "deceive" Xfce to invoke the dm-tool instead. We could accomplish that by placing the scripts which call the dm-tool with a required parameter ( lock or switch-to-greeter ) and are named as above mentioned programs into a directory from the $PATH environmental variable ( /usr/local/bin seems like the right choice).