2

Every time after I restart I have to enter this in the terminal to set the brightness:

xrandr -q | grep " connected"
xrandr --output LVDS --brightness 0.5

Could someone tell me if there is there any way to set up the brightness and remain like that even after a restart?

Universal Electricity
  • 1,675
  • 2
  • 13
  • 18
XPDIN
  • 577

2 Answers2

6

You can take that code, turn it into a script , and add that script to startup applications, so that on every login this runs automatically.

Script would be like so:

#!/bin/bash


xrandr --output LVDS --brightness 0.5

Save it in a file, e.g. myscript.sh. , preferably in /usr/bin, but not necessarily. Give that script executable permissions with chmod +x scriptname.sh

Then add full path to script in Startup Applications or make your own .desktop file in /home/yourusername/.config/autostart

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • 1
    Why do you need the xrandr -q | grep " connected" in the script? – A.B. Jun 05 '15 at 15:27
  • @A.B. I simply copied OP's two lines over when I was speed-writing the answer >_< – Sergiy Kolodyazhnyy Jun 05 '15 at 15:30
  • Thank you very much Serg, I will do it, but tell me please shouldn't be normal to can adjust the brightness from the keyboard shortcuts(windows+f7 in my case, like in Wondows OS) or from other settings from the Xubuntu system, without do add any script to the startup? Thanks. – XPDIN Jun 05 '15 at 15:38
  • @XPDIN yes, you should be able to use function keys. For instance on my machine it's fn + f6 and fn + f7, but sometimes there's issues, probably related to drivers. You can post another question here, and guys can take a look – Sergiy Kolodyazhnyy Jun 05 '15 at 15:50
0

clone the script on my https://github.com/el-beth/backlight.sh.git and paste the backlight.sh script file in any of the directories in $PATH of your shell for instance /bin or /usr/bin and make backlight.sh executable. After doing this, just create a .desktop file in /home/USERNAME/.config/autostart.

endrias
  • 597