Trying to use xss-lock + xsecurelock


#1

Hi, I’m trying to use xss-lock and xsecurelock to provide a lock screen with LXQt/OpenBox+SDDM. However, even though I’m using the version of xss-lock that allows you to specify the session, XDG_SESSION_ID doesn’t seem to be set in the systemd unit files. I’ve also tried placing a custom script in /etc/X11/xinit/xinit.rc.d but this hasn’t worked either, and I can’t figure out where the logs for this go (or if it’s even being run).

If I manually run xss-lock xsecurelock from a terminal after I’ve signed in, it does work, but this is obviously undesirable compared to starting it up in the background.

Can anyone help? Thanks.


(palinek) #2

So you are trying to run a daemon, but you’re missing particular env variable, right? I see to options:

  1. create a .desktop starting your daemon and place it in /etc/xdg/autostart (for LXQt you can use the X-LXQt-Module=true, then lxqt-session will also restart the daemon in case of its crash)
  2. if you need it to be run a systemd unit, a quick google-fu found this one https://naftuli.wtf/2017/12/28/systemd-user-environment/ (but I would suggest to just use the ...import-environment XDG_SESSION_ID of particular variable and not import all existing variables)

For me the 1. is the preferred way to go as the 2. is more-or-less a workaround and not a proper solution.


(Stefano) #3

I don’t know xss-lock, but I’using without issues slock in debian buster.

cat /etc/systemd/system/slock@.service 

[Unit]
Description=Lock X session using slock for user %i
Before=sleep.target

[Service]
User=%i
Environment=DISPLAY=:0
ExecStartPre=/usr/bin/xset dpms force suspend
ExecStart=/usr/bin/slock

[Install]
WantedBy=sleep.target

and

$ ls -l /usr/bin/xscreensaver
lrwxrwxrwx 1 root root 14 dic  7 10:12 /usr/bin/xscreensaver -> /usr/bin/slock

(Shrinivas Kumbhar) #4

i am using

kscreenlocker as screenlocker/screensaver instead of xscreensaver

with lxqt-kwin

my

~/.config/lxqt/lxqt.conf

[General]
__userfile__=true
icon_follow_color_scheme=true
icon_theme=Tela-dark
single_click_activate=true
theme=system

[Qt]
font="Noto Sans,10,-1,5,50,0,0,0,0,0"
style=kvantum

[Screensaver]
lock_command=/usr/lib/kscreenlocker_greet