TIP Run Commands at X Startup
From Gentoo Linux Wiki
| Terminals / Shells • Network • X Window System • Portage • System • Filesystems • Kernel • Other |
Do you run xmodmap or other commands everytime you start an X session, or everytime you login via KDM/GDM/etc? There are two lovely options available! The first is your best bet and solves most situations.
[edit] After X Starts
The ~/.xprofile file is executed after X starts, regardless of the way it is started: xstart, xinit, KDM, XDM, GDM, et cetera. All you have to do is fill up the file like the example below:
| File: ~/.xprofile |
#Put the commands you want to run at startup in here. xmodmap -e "5 4 3 2 1 9 10 6 7 8" xmodmap .xmodmap ~/myscript.sh gaim & thunderbird & |
The ampersand (&) makes the process go to the background and therefore not make your script wait before continuing.
[edit] Before X starts
If you're not sure what you are doing, ignore this.
If you are starting X via xstart or xinit, you can modify the ~/.xinitrc file to contain commands to be executed before X finishes starting. This file is not executed for users of most login managers: KDM, XDM, GDM, etc.
| File: ~/.xinitrc |
#Put the commands you want to run at startup in here. ~/myscript.sh exec openbox |
