dotfiles/scripts/.local
Marty Oehme 47a96a2d42
scripts: Fix powermenu log out without elogind
On my current voidlinux system I have no access to elogind and riverwm
will just be restarted when I exit it (since it is watched over by a
user service).

My session is started by the display manager 'greetd' (which in turn
runs tuigreet but that is not important here). So, to log out of the
session - we do a search for the 'greetd' process and if we find it we
search its _child_ processes which are the ones that we can kill without
being a super user.

If we kill the right process here, the session will close (since the
'watched' process exits and greetd just takes over again). This would be
a little easier if we started riverwm through greetd directly but I like
this indirection for stability (automatic service restarts), flexibility
(I can stop the riverwm service independent of my session), and adaption
(we can use Turnstile environment variables between my session
services).

So we just close all the processes that are children of greetd --
perhaps we accidentally catch a process which is _not_ the root session
process run by greetd but we'll kill it nevertheless since all child
processes might stop greetd from taking over (and they would be closed
anyway when ending the session afaik).

I have no linger enabled on my system so far (user processes staying
enabled after log-out) and I do not know how that would interact with
this method.
2025-03-10 20:22:00 +01:00
..
bin scripts: Fix powermenu log out without elogind 2025-03-10 20:22:00 +01:00
share scripts: Change nxsiv-rifle to uoeia 2023-01-08 21:05:16 +01:00