Run shell script after XServer is started?
According to this link .xinitrc in your home directory will be read and executed, otherwise the default /etc/X11/xinit/xinitrc
is used. So you should be able to create this file and have the shell script started.
How do I automatically start an application that needs X in Linux
Rather than defining an init script, you should be having X (or your window manager) start the process automatically. X, KDE, and Gnome all have ways of automatically starting things up (i.e. ~/.kde4/Autostart).
If this IS just X, go modify your /etc/X11/xinit/xinitrc file (or equivalent) to have it run your command. Mine looks like this at the bottom of the file:
if [ -n "$failsafe" ]; then
twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login
else
exec $command
fi
So you would change that to run whatever command you want.
Execution of some command every time a xerser starts: Turn on keyboard leds on startup by `xset led led on`
You could edit the /etc/rc.local file which will be executed after boot and run level changes. You can just throw the command right in there. You may also be able to use ~/.xinitrc or ~/.xsession depending on your specific setup (I'm not familiar with Ubuntu Mate).
Related Topics
How to Get Perf to Find Symbols in My Program
Differencebetween Xterm-Color & Xterm-256Color
What Is the Linux Process Table? What Does It Consist Of
Linux-Shell: Renaming Files to Creation Time
What Does Anon-Rss and Total-Vm Mean
Fuse Error: Transport Endpoint Is Not Connected
Permanently Change Disassembly Flavor in Gdb
Examining Berkeley Db Files from the Cli
Getting Stty: Standard Input: Inappropriate Ioctl for Device When Using Scp Through an Ssh Tunnel
Count Occurrences of Character Per Line/Field on Unix
Linux Commands to Copy One File to Many Files
Limiting the Time a Program Runs in Linux
How to Mount from Command Line Like the Nautilus Does
Replace Only If String Exists in Current Line
How to Prepend a Directory the Library Path When Loading a Core File in Gdb on Linux