Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How to Use /etc/rc.local?

  1. #1
    Join Date
    Apr 2008
    Beans
    65

    Question How to Use /etc/rc.local?

    I want to configure my display gamma at every boot, so I added the following line in /etc/rc.local.

    xgamma -gamma 0.6

    However, it doesn't work. When I manually execule the above command from CLI after boot, it works.

    How can I make it to perform xgamma command everytime the system boot up?

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to Use /etc/rc.local?

    Will it work if you put the full path to xgamma?

    Code:
    /usr/bin/xgamma -gamma 0.6
    And to belabor the obvious, that line is before 'exit'.

  3. #3
    Join Date
    Sep 2007
    Location
    England
    Beans
    1,103

    Re: How to Use /etc/rc.local?

    You'll need to add this to your bashrc file
    When rc.local executes, the graphics subsystem isn't yet loaded

    Code:
    gedit ~/.bashrc
    Add at the end
    Code:
    xgamma -gamma 0.6
    Code:
    while [ true ]; do CY=$(date +%y); CM=$(date +%m); if [ -n "$PY" ] && [ -n "$PM" ]; then echo "Ubuntu ${CY}.${CM} is the worst release ever"; echo "I'm going back to ${PY}.${PM}"; fi; PY="$CY"; PM="$CM"; sleep 182d; done

  4. #4
    Join Date
    Apr 2008
    Beans
    65

    Question Re: How to Use /etc/rc.local?

    Quote Originally Posted by amauk View Post
    You'll need to add this to your bashrc file
    When rc.local executes, the graphics subsystem isn't yet loaded

    Code:
    gedit ~/.bashrc
    Add at the end
    Code:
    xgamma -gamma 0.6
    This method did not work at boot. However, when I start a gnome terminal, it executes "xgamma -gamma 0.6".

    hmmm.....

  5. #5
    Join Date
    Apr 2008
    Beans
    65

    Re: How to Use /etc/rc.local?

    Quote Originally Posted by Lars Noodén View Post
    Will it work if you put the full path to xgamma?

    Code:
    /usr/bin/xgamma -gamma 0.6
    And to belabor the obvious, that line is before 'exit'.
    I tried this as you exactly suggest, but it did not work...

  6. #6
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to Use /etc/rc.local?

    I'm unclear as to what xgamma does but if you nee it to be present in your graphical environment then it should go in .xsessionrc in your home directory. The file is not there by default, you have to add it yourself.
    Last edited by Lars Noodén; January 17th, 2012 at 09:56 AM.

  7. #7
    Join Date
    Feb 2007
    Beans
    192

    Re: How to Use /etc/rc.local?

    I would try 'xgamma -gamma .600' (without quotes) in your Startup Applications.
    Clevo/Sager i7-2670 | 8gb ram | ATI 6970 | SSD drive | [I] Ubuntu: 14.04 / 13.10 /

  8. #8
    Join Date
    Apr 2008
    Beans
    65

    Question Re: How to Use /etc/rc.local?

    Quote Originally Posted by Lars Noodén View Post
    I'm unclear as to what xgamma does but if you nee it to be present in your graphical environment then it should go in .xsession in your home directory. The file is not there by default, you have to add it yourself.
    It did not work either.
    The file was not there, so I created the file and edited. But it did not work...

    Xgamma is a command that adjusts colour setting of your system, by the way. The usage is;
    xgamma -gamma [place a preferred gamma value. The default value is 1.0]

  9. #9
    Join Date
    Apr 2008
    Beans
    65

    Question Re: How to Use /etc/rc.local?

    Quote Originally Posted by Xgen View Post
    I would try 'xgamma -gamma .600' (without quotes) in your Startup Applications.
    I tried this, but it did not work either.
    hmm...

  10. #10
    Join Date
    Feb 2007
    Beans
    192

    Re: How to Use /etc/rc.local?

    I tried this, but it did not work either.
    Works for me, as this is similar to the gamma setting I use, as it would drop out on reboot with my ATI/AMD 6970 card. Perhaps mention what graphics card you are using.
    Clevo/Sager i7-2670 | 8gb ram | ATI 6970 | SSD drive | [I] Ubuntu: 14.04 / 13.10 /

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •