LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-28-2003, 07:44 PM   #1
slightcrazed
Member
 
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Rep: Reputation: 30
xgamma startup script


OK,

This is something that was more of an annoyance than anything else, but I figured it couldn't hurt to post incase anyone else might have the same pet peeves that I do.

For the longest time I have had:

xgamma -gamma 2.4

in my .bash_profile so that it would automatically change my gamma on startup. The annoying part is when I log into a terminal outside of X and I get
"xgamma - command not found"

Now, as I am a stickler for having things operate correctly, I set to the task of writing a little script to correct this error. I searched the forums for a while and found several instances where people seemed to want to do the same thing I am doing (change gamma while in X automatically on startup) but all of the offered solutions would have resulted in the same error message. So I came up with the idea of adding:

ses=$(printenv | grep DISPLAY)
if [ -n "$ses" ]; then
xgamma -gamma 2.4
fi

to my .bash_profile and voila! Now the gamma settings will change on startup, but ONLY IF X IS RUNNING. If X is not running, the xgamma command does not get run, and the previously mentioned error message is gone.

I am probably not the first person to ever do this, but it was a small personal accomplishment for myself that I felt was necessary to share.

slight

P.S. I realize that this is probably more suited for "success stories", but I figured it would be more helpful here.

Last edited by slightcrazed; 05-28-2003 at 07:46 PM.
 
Old 05-28-2003, 08:52 PM   #2
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
add xgamma -gamma 2.4 to ~/.xinitrc and it'll do the trick too
 
Old 05-28-2003, 08:56 PM   #3
slightcrazed
Member
 
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Original Poster
Rep: Reputation: 30
Hmm.... never tried that one.

slight

Last edited by slightcrazed; 05-28-2003 at 08:57 PM.
 
Old 05-28-2003, 08:59 PM   #4
slightcrazed
Member
 
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Original Poster
Rep: Reputation: 30
OK, I don't have that file in my home dir. I do have an .Xclients file, and I attempted to run the command from their, to no avail. That is the main reason that I defaulted to the .bash_profile option.

slight
 
Old 05-28-2003, 09:21 PM   #5
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
just create the file then
 
  


Reply



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
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM
Script at startup rohde Linux - Newbie 2 09-12-2004 09:32 AM
xgamma kills Xserver slightcrazed Linux - General 1 12-13-2003 08:52 AM
Adding xgamma commands to startup on RH8 HellBound Linux - Software 2 03-12-2003 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:02 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
Open Source Consulting | Domain Registration