[systemd-devel] Execute a script/program at the start of a graphical session
Andrea Pappacoda
andrea at pappacoda.it
Thu May 12 15:01:32 UTC 2022
Il giorno gio 12 mag 2022 alle 13:31:41 +02:00:00, Gerion Entrup
<entrup at sra.uni-hannover.de> ha scritto:
> Is there a possibility to trigger systemd to execute
> some script under the current user when logind detects a new graphical
> session? This way, it would not depend on the login manager and
> desktop
> environment.
>
> The broader question is: Is there a way to start a script at the
> beginning of a graphical session (but after X or the Wayland
> compositor
> have started) which is independent of the login manager or desktop
> environment?
Maybe user services could help. I personally have a service that starts
redshift when I login to my (Xfce) session.
To make it available for every user I've put it in
/etc/xdg/systemd/user/redshift.service, and than enabled it globally
with systemctl --global enable redshift.service
More information about the systemd-devel
mailing list