You are not logged in.

#1 2014-11-06 10:52:38

TheKing42
Member
Registered: 2014-10-08
Posts: 40

Set up light-locker with XFCE action buttons.

Light-Locker is working with suspend and stuff, but how do I get it to use light-locker when I press the Lockscreen button. I hear it has something to do with xflock4, but I am not sure what.


That question on the noobie form freaked me out. I was able to figure it out, but why do we have that?

Offline

#2 2014-11-06 11:39:35

toz
Member
Registered: 2011-10-28
Posts: 316

Re: Set up light-locker with XFCE action buttons.

The Xfce action buttons "lockscreen" command executes xflock4 to perform the lock screen action. Unfortunately, the xflock4 script that is shipped with Arch doesn't include an option to use the light-locker, so you'll need to either patch the file to include light-locker or use a workaround.

If light-locker is the only locker on your system that you use, you can for a single user:

alias xflock4='light-locker-command -l"

...in your ~/.bashrc file, or for all users, create the file /usr/local/bin/xflock4 (to override the existing file) with the content:

#!/bin/bash
light-locker-command -l

...make sure the file is executable.


If you need to patch xflock4, edit the section that reads:

# Lock by xscreensaver or gnome-screensaver, if a respective daemon is running
for lock_cmd in \
    "xscreensaver-command -lock" \
    "gnome-screensaver-command --lock"
do
    $lock_cmd >/dev/null 2>&1 && exit
done

...to read:

# Lock by light-locker, xscreensaver or gnome-screensaver, if a respective daemon is running
for lock_cmd in \
    "light-locker-command -l"\
    "xscreensaver-command -lock" \
    "gnome-screensaver-command --lock"
do
    $lock_cmd >/dev/null 2>&1 && exit
done

Offline

#3 2016-01-20 10:52:31

avalon
Member
Registered: 2013-12-12
Posts: 5

Re: Set up light-locker with XFCE action buttons.

much better is to use:

$ xfconf-query -c xfce4-session -p /general/LockCommand -s "light-locker-command -l"

or if you don't have the variable yet:

$ xfconf-query -c xfce4-session -p /general/LockCommand -s "light-locker-command -l" --create -t string

Offline

#4 2016-01-20 13:37:06

toz
Member
Registered: 2011-10-28
Posts: 316

Re: Set up light-locker with XFCE action buttons.

True.

But for clarity sake, you should also mention that the /general/Lockcommand enhancement is not currently part of the xfce4-session package that Arch ships and is currently only in the Xfce git tree upstream. You would have access to this parameter if:

  1. You are using the xfce4-session-git package from the AUR (or building directly from upstream)

  2. You manually edited the /usr/bin/xflock4 script to use this xfconf parameter.

Back in 2014 when this post was created, this was the only option.

Offline

#5 2016-01-20 14:05:58

avalon
Member
Registered: 2013-12-12
Posts: 5

Re: Set up light-locker with XFCE action buttons.

@toz, I don't know these details. I just hit this post searching on the internet so decided to update it with recent information. It doesn't matter for me what situation was at the time of writing. Also here's the upstream bug to make that work OOB:
https://bugzilla.xfce.org/show_bug.cgi?id=12415

Offline

#6 2016-01-20 14:23:25

toz
Member
Registered: 2011-10-28
Posts: 316

Re: Set up light-locker with XFCE action buttons.

avalon wrote:

@toz, I don't know these details. I just hit this post searching on the internet so decided to update it with recent information.

Unfortunately, the information wasn't totally accurate - hence my post to clarify for others who may stumble on this thread.

Offline

#7 2016-01-20 14:30:30

avalon
Member
Registered: 2013-12-12
Posts: 5

Re: Set up light-locker with XFCE action buttons.

You are right, thank you.

Offline

Board footer

Powered by FluxBB