How to fix lock screen after changing gdm to LightDM

this isnt the first time this has been discussed but im hoping for it to be a new approach to fixing the issue.
a few weeks ago i followed @linux-aarhus 's tutorial on switching from gdm to lightdm on gnome, all worked out great except for one issue where gnome does not want to let lightdm lock upon sleep/suspend .
ive tried light-locker,light-locker-settings, tried playing in gconf without solution. ive searched arch,antergos,google,bing,etc… the problem seems to exist on each of those forums but no solid solution has been figured out as far as i know. the lockscreen button does nothing, xset only flashes the screen.

*THE ONLY thing ive found to lock the screen properly without issue is a gnome extension called “LightDM Lock Screen” , this puts a lock icon on the top bar, click it and it locks sending you to the normal lightdm lock screen which is what i want . the problem being is i would like this extension to activate upon sleep/suspend automatically .

is it possible and how would i go about doing it?

any help would be appreciated, thanks.

The existence of a distinct extension for this signifies a… Gnome feature.
IIRC Gnome works fine only with Gdm, as I read in Archwiki.

putting this in /etc/lightdm/Xsession allows light-locker to function but it also causes some undesireable side effects like dash to dock losing its ability to auto-hide so its not in the way all the time.

/usr/bin/light-locker &
echo "X session wrapper complete, running session $@"

exec $@

is there no way to just hook the “LightDM Lock Screen” gnome extension automatically when the system is about to suspend?

You could try with a systemd service, or hook.

thats what im attempting to aim for, i just lack the know how and i cant seem to find it in terms i understand

Then you will stay with the manual solution.

Find the right systemd service and add the command to it.

i guess so, this didnt even bother me until yesterday when i seen someone else wondering why they cant lock lightdm/gnome. so i set off to find answers and ended up with only 1 solution that does not screw up something else in the process and it seems to be that gnome extension. im looking for how i could hook it upon sleep/suspend but coming up empty.
to just give up would irk me

i guess i could figure that out if i knew the command to activate the lightdm lock screen extension, any ideas?

light-locker --help

or

man light-locker

There should be some stuff in the Archwiki as well. But honestly i did not get it to work yet either. I am using i3wm and this is here done by

i3exit lock

the light-locker doesnt seem like the answer, when i do get it to actually work and lock the screen it screws up my dash to dock when it wakes from sleep and i have to restart to fix it.
im trying to figure out how to activate the “lightdm lock screen” extension, it sits on my top bar and if i click it, locks perfectly, so it gives me hope that this is possible, maybe if i knew the mechanism of action of how that extension works

LOL! It was just that easy :wink:
https://duckduckgo.com/?q=lightdm+lock+screen&t=ffnt&ia=qa

1 Like

i wish, when that is used it locks>flashes>unlocks>restarts session its as if you logged out and closed your session but with the added benefit of watching gnome have a seizure.
i think for you that may work, ive come across it a few times in quest to fix this

Yes, it works perfectly with i3 and is supposed todo the same in gnome. The thing with gnome is that they make it harder with every new version to get things configured. This is why i am not touching it.

if i do dm-tool list-seats i get this

[dglt@dglt-1 ~]$ dm-tool list-seats
Seat0
  CanSwitch=true
  HasGuestAccount=false
  Session0
    UserName='dglt'

(process:5144): GLib-CRITICAL **: 14:53:31.136: g_variant_iter_free: assertion 'is_valid_heap_iter (iter)' failed


Same here:

$ dm-tool list-seats
Seat0
  CanSwitch=true
  HasGuestAccount=false
  Session0
    UserName='suchus'

(process:2019): GLib-CRITICAL **: 14:59:46.016: g_variant_iter_free: assertion 'is_valid_heap_iter (iter)' failed

(process:2019): GLib-CRITICAL **: 14:59:46.017: g_variant_iter_free: assertion 'is_valid_heap_iter (iter)' failed

What happens when you use

dm-tool switch-to-greeter

i tried that too, but im gonna take out what i added to Xsession, reboot and try it again

dm-tool lock = chaos
dm-tool switch-to-greeter = seems to work

i can work with that, now i just need to include it in whichever service is used to suspend right?

Right. But I don’t know which one. I am still not used to systemd. Maybe it’s time to really dig in.
Edit: Maybe @tbg knows how to get it done. He’s doing some stuff with systemd services lately.

Forum kindly sponsored by Bytemark