What to consider when writing up an xsession or xinitrc ?
Hey. I'd like to tweak my xintrc, mostly to scope out another WM, but it seems to be a somewhat daunting and important script. What all should I take into consideration when heading out to mess with xintrc?
I, unfortunately, do not have an example of my system defaults or anything. |
There's not much that needs to be taken into account really.
Those scripts are intended mainly to launch a wm and maybe some other little things. They can used to configure some stuff (xbindkeys, set a wallpaper...). Those files will be run as shell scripts. So, the same universal law that applies for all the shell scripts are still valid here. For example, if you run "program_A" from xinitrc, and program_A never ends, then the script will sit there until that program is closed by you. That means that any program that goes after that is not going to run until program_A has ended. To prevent this behavior you can just launch program_A in background, by adding an ampersand (&) to the end of the command, just like you would do in a bash script or in command line. Some programs have a short life, so you don't need to do this for them. For example, if you use feh --bg-scale to set your wallpaper, you can put & after it, but that's not gonna give you any benefit, since feh sets the wallpaper and automatically exits anyway. You might as well want to capture the pid of one process to do something with it later. For example, to make sure it's closed after the session ends. X programs usually die when X is closed. But sometimes there are programs that needs to be killed explicitly. An example is urxvtd, if you use it (it's a daemon for urxvt which greatly reduces the usage of memory when you use lots of terminals). For this, you can use $! like you would do in a regular bash script. Here you are one script illustrating all of these. It's my actual xinitrc with some comments added so you can make sense of some parts. Code:
# you can export some vars if you need them inside X, this one tells qtcurve to use Code:
feh --bg-scale ~/myfile.png ;) |
Thanks. I guess I won't worry too much.
|
do a backup and tweak to your hearts content.
|
don't have anything I can find to back-up. :(
|
^ if you dont have the cp command then modifying xinitrc is the least of your problems...
what i meant was make a backup of any file you plan to modify. in that case if something goes horribly wrong, one quick cp command will make it all better. |
All times are GMT -5. The time now is 08:56 PM. |