LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   automatically running commands... (https://www.linuxquestions.org/questions/linux-general-1/automatically-running-commands-14768/)

lhoff 02-21-2002 05:37 AM

automatically running commands...
 
Whenever I launch X, I would like my desktop environment (right now it's Gnome, last week it was KDE, next week it may be Blackbox...) to run
xgamma -gamma 2.4
automatically. (I have to go into the shell to do this everytime, and it's getting to be a drag.) I have to do this because my display is pretty dark at its default gamma.

I have no prior experience running commands automatically, so please talk to me like a child. :)

trickykid 02-21-2002 09:22 AM

ok children.. :D today's lesson in Linux...

ummmm.. you could possibly add it to your startup scripts..

neo77777 02-21-2002 09:30 AM

look at /etc/rc.d directory (if I am not mistaken) for rc.* entries(* is ranging from 0 to 6 and corresponds to run level) look at rc.5 (init 5) and add one-line script there (actually 2 lines, first would be #!/bin/bash or whatever shell you preffer, second line is the line you specified), another alternative edit your /etc/rc.local file to include aforementioned line don't do #!/bin/bash
just the command you want to execute.

Malicious 02-21-2002 11:27 AM

I think that all you need to do is to add the command line for the program to the .Xclients file in the home directory of the user who starts X.

Baloo 02-21-2002 11:27 AM

I think we are missing the point, doesn't this command need to go in .xinitrc?

Baloo*

Syncrm 02-21-2002 11:32 AM

Quote:

Originally posted by Baloo
I think we are missing the point, doesn't this command need to go in .xinitrc?

Baloo*

yep, needs to go right BEFORE the "exec /your/window/manager"; also very important to put a & after the command, so the script won't stop there.

dnar 02-21-2002 11:37 AM

You could add it to the start of /etc/X11/xinit/Xclients

Malicious 02-21-2002 11:56 AM

Forget what I said about .Xclients, that's not KDE. Like Baloo said, .xinitrc is a good place to have it started. You can also put a shell script to start the program in ~/.kde2/Autostart. Or add a shortcut in the panel by adding a "legacy" app to the panel menu.

therion12 02-21-2002 12:26 PM

What i used to do is just open up the .xinitrc file in your home directory (if your distro has such file) and type the code to execute the desktop, for example this is what i used to launch kde.

exec startkde

for gnome it would be:

exec /opt/gnome/path/to/gnome/executable

lhoff 02-21-2002 02:34 PM

Lots of replies: thanks!

I've put it in .xinitrc and it's working a treat!

:cool:


All times are GMT -5. The time now is 06:42 AM.