run script after xserver started

0

I have a script which I would love to run after xserver has started. This file is located at /home/karl/.scripts/startup/sensei-raw-startup.sh.

How to I invoke this file after xserver has started?

Karl Morrison

Posted 2015-12-02T04:05:08.437

Reputation: 1 507

Answers

0

Depends on what you want to do. All DEs (KDE, Gnome,...) provide ways to run programs at start, for instance in KDE you can put an executable into /home/YourName/.kde/Autostart. This is good enough for me, the details for you depend on your DE.

EDIT

As suggested by @grawity in the following comment, there is a method valid for all DEs, which is to place the executable in /home/YourName/.config/autostart.

Alternatively, you can place an executable file in /etc/X11/Xsession.d, and this will be executed for all users of your system; for most people this is just as good as the above solutions since they are the only users of their laptop/desktop/whatever... Just remember to give this file a name starting with 99z, so that it is executed last: the other files in the directory need to be executed before custom scripts.

MariusMatutiae

Posted 2015-12-02T04:05:08.437

Reputation: 41 321

The cross-DE method is ~/.config/autostart/.

– user1686 – 2015-12-02T12:45:00.253