You are not logged in.
Hi all,
I'm currently moving from XDM to LightDM and have a hard time figuring out how to clean up after myself when my session ends.
Here's the problem:
I start two non-graphical applications in ~/.xprofile
offlineimap
ssh-agent
I want to cleanly kill these when my graphical session ends
What would be the best way to achieve this?
What I tried until now:
Add ~/.xlogout which does the cleanup
Create /etc/lightdm/Xsession-mine which calls /etc/lightdm/Xsession and then ~/.xlogout
Modify /etc/lightdm/lightdm.conf to use /etc/lightdm/Xsession-mine as session wrapper
Result: ~/.xlogout doesn't seem to be called, probably due to exec in Xsession
History:
With XDM I would start my window manager in the foreground (without exec) in ~/.xinitrc and when it returns call my cleanup code.
Thanks in advance for all help and suggestions!
Timo
Offline
Haven't used lightdm in a long time... does it have a PostLogout function similar to lxdm?
https://wiki.archlinux.org/index.php/Lxdm#Configuration
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Hi graysky,
Haven't used lightdm in a long time... does it have a PostLogout function similar to lxdm?
https://wiki.archlinux.org/index.php/Lxdm#Configuration
it does have something alike:
# session-cleanup-script = Script to run when quitting a user session (runs as root)
However, as the documentation states, this script is run as root, so I can't clean up on a per-user basis (or can I?).
Kind regards,
Timo
Offline
Not sure... is using lxdm out of the question? It has this ability via that config file. If you cannot, perhaps others can help you.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Hey again,
actually, your first answer got me thinking. I wrote a little script to run as the session-cleanup-script and printed both $(whoami) and $USER. $(whoami) always yields "root", but $USER is either the user currently logging out (yay!) or empty (if I restart lightdm via systemctl).
So I'll just let root run ~/.Xlogout (if it exists) as the user logging out (or nothing if $USER is empty). I think that'll do for my use case.
Thanks for your input!
Kind regards,
Timo
Offline