Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Bookworm XFCE: Screen locker configuration

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
chrisgeli
Posts: 5
Joined: 2024-04-02 23:09
Has thanked: 1 time

[Solved] Bookworm XFCE: Screen locker configuration

#1 Post by chrisgeli »

Hi all,

I'm unable to lock my screen via clicking the whiskermenu's Lock Screen button.

When I look under Settings -> Power Manager (xfce4-power-manager-settings), there is a tab Security which mentions Light Locker, however the Panel -> Items -> Whisker Menu -> Commands tab shows `xflock4` as the command being used. When I enter the command in a terminal, nothing happens, there doesn't appear to be `man xflock4` of `xflock4 --help`, so I'm not sure why it isn't locking.

Investigating Light Locker (not sure this is relevant):

Code: Select all

$ light-locker

** (light-locker:383465): ERROR **: 10:18:16.151: Environment variable XDG_SESSION_PATH not set. Is LightDM running?
Trace/breakpoint trap
$ light-locker-command --lock
** Message: 10:18:40.307: Received error message from the locker: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
Since I'm running XFCE, I'm not sure the XDG_SESSION_PATH should be set at all and whether Light Locker is relevant at all in my case.

What can I do to debug the issue?

Thanks for your time.
Last edited by chrisgeli on 2024-04-05 04:11, edited 1 time in total.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2140
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 233 times

Re: Bookworm XFCE: Screen locker configuration

#2 Post by FreewheelinFrank »

First thing to do would be to answer the question in the output: Is LightDM running? Are you using LightDM?

xflock4 is configured in /usr/bin/xflock4:

Code: Select all

# Try our screensaver first
xfce4-screensaver-command --lock </dev/null 2>/dev/null && exit

# This list should be kept in sync with XfceScreensaver (libxfce4ui)
xdg-screensaver lock </dev/null 2>/dev/null && exit
for lock_cmd in \
    xscreensaver-command \
    light-locker-command \
    gnome-screensaver-command \
    mate-screensaver-command
do
    $lock_cmd --lock </dev/null 2>/dev/null && exit
done
For me xflock4 works and seems to be calling

Code: Select all

light-locker-command --lock </dev/null 2>/dev/null && exit
light-locker seems to be running:

Code: Select all

$ light-locker

** (light-locker:2897): WARNING **: 03:21:16.028: screensaver already running in this session
This is with LightDM as the display manager. If you are using a different display manager, it could be the cause of the issue.

chrisgeli
Posts: 5
Joined: 2024-04-02 23:09
Has thanked: 1 time

Re: Bookworm XFCE: Screen locker configuration

#3 Post by chrisgeli »

First thing to do would be to answer the question in the output: Is LightDM running? Are you using LightDM?
Not that I'm aware of. I'm trying to figure that out:

Code: Select all

$ pgrep -a light
$ pgrep -a dm
374 [kdmflush/254:0]
375 [kdmflush/254:1]
417 [jbd2/dm-0-8]
1485 /usr/sbin/gdm3
2121 gdm-session-worker [pam/gdm-password]
2247 /usr/libexec/gdm-x-session --register-session --run-script startxfce4
Looks like I'm running gdm3 - GNOME Display Manager!?
xflock4 is configured in /usr/bin/xflock4
Oh, I wasn't aware that this is a script, thanks for the hint. Mine looks as follows:

Code: Select all

# [...copyleft and other comments left out for brevity...]
# Wait a bit so that user have time to raise finger from a key if
# the script is run in terminal.
[ -t 0 ] && sleep 1

# First test for the command set in the session's xfconf channel
LOCK_CMD=$(xfconf-query -c xfce4-session -p /general/LockCommand)

if [ -n "$LOCK_CMD" ]; then
    /bin/sh -c "$LOCK_CMD" && exit
    exit_code=$?
    >&2 printf "'%s' exited with status %d\n" "$LOCK_CMD" $exit_code
    exit $exit_code
fi

for lock_cmd in \
    xscreensaver-command \
    light-locker-command \
    xfce4-screensaver-command \
    gnome-screensaver-command \
    mate-screensaver-command
do
    $lock_cmd --lock </dev/null 2>/dev/null && exit
done

# else access locking failed
exit 1
I ran a slightly modified version of its core directly in my terminal for debugging:

Code: Select all

$ xfconf-query -c xfce4-session -p /general/LockCommand

$ for lock_cmd in \
>    xscreensaver-command \
>    light-locker-command \
>    xfce4-screensaver-command \
>    gnome-screensaver-command \
>    mate-screensaver-command
> do
>    $lock_cmd --lock
>    echo "$lock_cmd exited with $?"
> done
bash: xscreensaver-command: command not found
xscreensaver-command exited with 127
** Message: 09:38:07.854: Received error message from the locker: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
light-locker-command exited with 1
bash: xfce4-screensaver-command: command not found
xfce4-screensaver-command exited with 127
bash: gnome-screensaver-command: command not found
gnome-screensaver-command exited with 127
bash: mate-screensaver-command: command not found
mate-screensaver-command exited with 127
Looks like the only command supported by `xflock4` which is also installed is `light-locker-command`, but it's failing with that DBus.Error.ServiceUnknown.

Since I'd like to keep my configuration changes to a minimum, I'm now wondering if I'd be better off
  1. trying to get `light-locker-command` working or
  2. installing `gnome-screensaver` or
  3. something else.
Any guidance would be appreciated!

User avatar
pbear
Posts: 387
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 63 times

Re: Bookworm XFCE: Screen locker configuration

#4 Post by pbear »

Would be interesting to know how you ended up with GDM. LightDM is the default for XFCE, at least in Bookworm (Debian 12).

Another way to lock the screen would be to open Power Manager > Security tab > tick box to lock when going to sleep.
Then use Suspend (on the Log Out menu) when you want to lock the computer.

dlu2021
Posts: 213
Joined: 2021-08-13 19:55
Location: Minnesota
Has thanked: 7 times
Been thanked: 42 times

Re: Bookworm XFCE: Screen locker configuration

#5 Post by dlu2021 »

According to the package description of light-locker, it requires lightdm to work, that is probably why light-locker has a hard dependency on lightdm:

https://packages.debian.org/bookworm/light-locker

chrisgeli
Posts: 5
Joined: 2024-04-02 23:09
Has thanked: 1 time

Re: Bookworm XFCE: Screen locker configuration

#6 Post by chrisgeli »

pbear wrote: 2024-04-04 02:45 Another way to lock the screen would be to open Power Manager > Security tab > tick box to lock when going to sleep.
Then use Suspend (on the Log Out menu) when you want to lock the computer.
Wouldn't that be a roundabout way to call the same *lock commands we already discussed above? In any case, I'd like to be able to just lock the PC, without having to put it to sleep.
pbear wrote: 2024-04-04 02:45 Would be interesting to know how you ended up with GDM. LightDM is the default for XFCE, at least in Bookworm (Debian 12).
That's a good question, and since I'm mostly confused by how DMs, WMs, sessions and DEs interact, I'm having a hard time tracking down issues around their interactions. LightDM is in fact installed, it just doesn't seem to be started by default.

My memory of the installation process is fading, but there might've been a choice of DM and I (for some reason) chose GDM instead of LightDM, under the (as it turns out incorrect) assumption all configuration would sort itself automagically.

Another potential reason could my environment being bit unusual in that my home folder is a network drive and there are other PCs on that network that use GNOME as their DE, which I regularly use. So it is certainly possible that one of these PCs has changed a configuration file in my home folder that controls which DM to start.

Any pointers to track down the issue would be welcome.
Last edited by chrisgeli on 2024-04-04 05:28, edited 1 time in total.

dlu2021
Posts: 213
Joined: 2021-08-13 19:55
Location: Minnesota
Has thanked: 7 times
Been thanked: 42 times

Re: Bookworm XFCE: Screen locker configuration

#7 Post by dlu2021 »

You can switch back to lightdm by using the following commmand as root:

Code: Select all

# dpkg-reconfigure lightdm
It should prompt you to pick which display manager to use as default.

If you want to read up on display managers, here is a wiki article:

https://wiki.debian.org/DisplayManager

User avatar
pbear
Posts: 387
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 63 times

Re: Bookworm XFCE: Screen locker configuration

#8 Post by pbear »

chrisgeli wrote: 2024-04-04 05:26 ... I'd like to be able to ...
You have several expectations, some of which conflict with each other. Good luck.

chrisgeli
Posts: 5
Joined: 2024-04-02 23:09
Has thanked: 1 time

Re: Bookworm XFCE: Screen locker configuration

#9 Post by chrisgeli »

pbear wrote: 2024-04-04 17:35 You have several expectations, some of which conflict with each other.
Which ones are conflicting?

chrisgeli
Posts: 5
Joined: 2024-04-02 23:09
Has thanked: 1 time

Re: Bookworm XFCE: Screen locker configuration

#10 Post by chrisgeli »

dlu2021 wrote: 2024-04-04 14:16 You can switch back to lightdm by using the following commmand as root:

Code: Select all

# dpkg-reconfigure lightdm
That was the solution, thank you. Since I was running these commands as root (`su -` in my terminal), I was confident it wouldn't change my user configuration which would've been potentially bad for logging in on the CentOS/GNOME machines.

Post Reply