I am trying to execute two commands one on logon and one on logoff.
For the log on one, I put my script into
/etc/X11/xinit/xinitrc.d and this works.
I'd like it to be system-wide so I can use any WM.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Have a look at your display manager (lightdm, gdm, kdm, xdm, wdm).
Newer lightdm versions can have a
session-cleanup-script entry in the
[SeatDefaults] section of
For gdm, you can put a script in the PostSession directory.
For kdm, xdm and wdm have a look at this answer at SuperUser.