LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-21-2002, 06:37 AM   #1
lhoff
Member
 
Registered: Jun 2001
Location: Chicago
Distribution: Mandrake 10.0 Official
Posts: 181

Rep: Reputation: 30
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.
 
Old 02-21-2002, 10:22 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
ok children.. today's lesson in Linux...

ummmm.. you could possibly add it to your startup scripts..
 
Old 02-21-2002, 10:30 AM   #3
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
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.
 
Old 02-21-2002, 12:27 PM   #4
Malicious
Member
 
Registered: Jan 2002
Location: Galveston Island
Distribution: suse, redhat
Posts: 208

Rep: Reputation: 30
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.
 
Old 02-21-2002, 12:27 PM   #5
Baloo
Member
 
Registered: Feb 2002
Distribution: LFS
Posts: 41

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

Baloo*
 
Old 02-21-2002, 12:32 PM   #6
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
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.
 
Old 02-21-2002, 12:37 PM   #7
dnar
Member
 
Registered: Feb 2002
Location: Perth, Australia
Distribution: FC5 ::: Coyote ::: SCO Unixware :::
Posts: 201

Rep: Reputation: 30
You could add it to the start of /etc/X11/xinit/Xclients
 
Old 02-21-2002, 12:56 PM   #8
Malicious
Member
 
Registered: Jan 2002
Location: Galveston Island
Distribution: suse, redhat
Posts: 208

Rep: Reputation: 30
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.
 
Old 02-21-2002, 01:26 PM   #9
therion12
Member
 
Registered: Dec 2001
Location: chicago, IL
Distribution: Gentoo 1.4_rc1
Posts: 913

Rep: Reputation: 30
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
 
Old 02-21-2002, 03:34 PM   #10
lhoff
Member
 
Registered: Jun 2001
Location: Chicago
Distribution: Mandrake 10.0 Official
Posts: 181

Original Poster
Rep: Reputation: 30
Lots of replies: thanks!

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

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running scripts automatically skguha Linux - Newbie 4 08-03-2005 04:11 AM
automatically running KDE 3.1.4 cjheeney Linux - Newbie 2 04-29-2004 02:23 PM
cp and rm commands automatically overwrite m_yates Debian 2 04-04-2004 10:59 PM
running commands automatically via SSH tpfraz Linux - General 1 02-13-2004 10:12 AM
Automatically running commands azebuski Linux - Newbie 3 02-11-2004 10:36 PM


All times are GMT -5. The time now is 07:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration