Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.