Xfce xfce4-screensaver lock screen after suspend

Hello folks,

I haven't managed to get x11/xfce4-screensaver's lock screen feature working when suspend happens on closing laptop's lid. Unfortunately no hints on xfce's bug reports/forums for such a case and launching it with verbose/debug flags doesn't produce anything useful (nor /var/log/messages either).

I suspect some devd(8) events involved as locking the screen manually or automatically after x minutes is working as it should.

Anyone got it working?
 
I sorted this out by making a devd(8) custom rules which launch /usr/local/bin/xfce4-screensaver-command --lock when lid is closed:
Code:
% cat /usr/local/etc/devd/acpi-suspend.conf 
notify 10 {
    match "system"         "ACPI";
    match "subsystem"     "Lid";
    match "notify"         "0x00";
    action "/usr/local/bin/xfce4-screensaver-command --lock";
};

To avoid a race condition, disable "Lock screen when system is suspended" under Lock screen tab of screensaver preferences panel (approx. english translation as I'm running xfce4 in french) :cool:
 
I sorted this out by making a devd(8) custom rules which launch /usr/local/bin/xfce4-screensaver-command --lock when lid is closed:
Code:
% cat /usr/local/etc/devd/acpi-suspend.conf
notify 10 {
    match "system"         "ACPI";
    match "subsystem"     "Lid";
    match "notify"         "0x00";
    action "/usr/local/bin/xfce4-screensaver-command --lock";
};

To avoid a race condition, disable "Lock screen when system is suspended" under Lock screen tab of screensaver preferences panel (approx. english translation as I'm running xfce4 in french) :cool:

Hello

I tried the same thing, but the screen doesn't lock.

xfce4-screensaver needs to be run as normal user no?

Code:
root@beastie:/usr/local/etc/devd # cat acpi-suspend.conf
notify 1000 {
match "system" "ACPI";
match "subsystem" "Suspend";
action "/usr/local/bin/xfce4-screensaver-command --lock";
};
 
Back
Top