How to change LCD brightness from command line (or via script)?
To work around bug #1005495 (changing LCD brightness via hotkeys impossible), I'd like to have one command line query for increasing and one for reducing the brightness of my LCD. I could then map a hotkey to each one of this queries.
The problem is: I don't know how to increase and reduce the LCD brightness on the command line. Do you?
command-line brightness
add a comment |
To work around bug #1005495 (changing LCD brightness via hotkeys impossible), I'd like to have one command line query for increasing and one for reducing the brightness of my LCD. I could then map a hotkey to each one of this queries.
The problem is: I don't know how to increase and reduce the LCD brightness on the command line. Do you?
command-line brightness
1
possible duplicate of Unable to change brightness in a Lenovo laptop
– Lekensteyn
Jun 10 '12 at 17:30
2
Thanks, Lekensteyn, but it's not a duplicate since lsmod | grep ^i915 gives me no output (see accepted solution). Still looking for a solution.
– user69748
Dec 14 '12 at 11:56
add a comment |
To work around bug #1005495 (changing LCD brightness via hotkeys impossible), I'd like to have one command line query for increasing and one for reducing the brightness of my LCD. I could then map a hotkey to each one of this queries.
The problem is: I don't know how to increase and reduce the LCD brightness on the command line. Do you?
command-line brightness
To work around bug #1005495 (changing LCD brightness via hotkeys impossible), I'd like to have one command line query for increasing and one for reducing the brightness of my LCD. I could then map a hotkey to each one of this queries.
The problem is: I don't know how to increase and reduce the LCD brightness on the command line. Do you?
command-line brightness
command-line brightness
edited Jun 10 '12 at 17:30
Eliah Kagan
81.5k21227364
81.5k21227364
asked Jun 10 '12 at 17:28
user69748user69748
8532912
8532912
1
possible duplicate of Unable to change brightness in a Lenovo laptop
– Lekensteyn
Jun 10 '12 at 17:30
2
Thanks, Lekensteyn, but it's not a duplicate since lsmod | grep ^i915 gives me no output (see accepted solution). Still looking for a solution.
– user69748
Dec 14 '12 at 11:56
add a comment |
1
possible duplicate of Unable to change brightness in a Lenovo laptop
– Lekensteyn
Jun 10 '12 at 17:30
2
Thanks, Lekensteyn, but it's not a duplicate since lsmod | grep ^i915 gives me no output (see accepted solution). Still looking for a solution.
– user69748
Dec 14 '12 at 11:56
1
1
possible duplicate of Unable to change brightness in a Lenovo laptop
– Lekensteyn
Jun 10 '12 at 17:30
possible duplicate of Unable to change brightness in a Lenovo laptop
– Lekensteyn
Jun 10 '12 at 17:30
2
2
Thanks, Lekensteyn, but it's not a duplicate since lsmod | grep ^i915 gives me no output (see accepted solution). Still looking for a solution.
– user69748
Dec 14 '12 at 11:56
Thanks, Lekensteyn, but it's not a duplicate since lsmod | grep ^i915 gives me no output (see accepted solution). Still looking for a solution.
– user69748
Dec 14 '12 at 11:56
add a comment |
13 Answers
13
active
oldest
votes
One more way we have to do this is with another new program named as xbacklight , open your terminal and type this
sudo apt-get install xbacklight
then type this xbacklight -set 50
there 50 stands for brightness range we can get it upto 100 from 0 .
you can also increase and decrease the brightness from present value to specified level.as you mentioned if you want to increase to 10% from current value of brightness then you can give this
xbacklight -inc 10
and to decrease 10% you can give this
xbacklight -dec 10
Warning: xbacklight only works with Intel, not properly on Radeon and not at all with modesetting driver (source).
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Aug 24 '12 at 9:31
1
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10
– rɑːdʒɑ
Aug 24 '12 at 16:53
1
Ok, now it's in your answer. Thanks a lot, I'll try that out.
– user69748
Aug 27 '12 at 7:28
32
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless.
– user69748
Sep 4 '12 at 14:38
1
Additionally, there's a shorthand you can use:xbacklight +10; xbacklight -10; xbacklight =50;
– Fordi
Mar 9 '16 at 18:48
|
show 6 more comments
Open your terminal and type this
xrandr -q | grep " connected"
it will gives you the output as
LVDS1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
There LVDS1 Stands for your display. So now you have to do as
xrandr --output LVDS1 --brightness 0.5
there 0.5 stands for brightness level and it ranges from 0.0 to 1.0 .
0.0 -> Full black .so you have to choose the required value of brightness .
This doesn't change brightness at a hardware level. From randr manual:
--brightness brightnessMultiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.
2
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
44
this doesn't seem to change the brightness at a hardware level
– erjoalgo
Oct 18 '13 at 6:29
11
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker.
– Mephisto
Nov 16 '14 at 15:47
2
Thanx it saved my day and eyes too.. :)
– Shylendra Madda
Nov 8 '15 at 11:51
6
It fakes the brightness. The brightness does not change, it is rendered by software.
– user1970939
Apr 1 '16 at 20:58
|
show 15 more comments
The following works for me:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness
I guess the maximum possible value is in the /sys/class/backlight/intel_backlight/max_brightness file.
Replace intel_backlight with an asterisk to apply to all backlights.
15
@Ray Try this:echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness.
– Mygod
Nov 28 '15 at 17:39
10
@Ray when you dosudo echo 400 > /sys/class . .. ./brightnessredirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is whyteeworks.
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:37
4
echo 400 | sudo tee /sys/class/backlight/radeon_bl0/brightnessfor radeon APUs and cards
– Suici Doga
Apr 1 '16 at 11:40
13
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if yousudo chmod 0646thebrightnessfile, sosudoisn't needed for setting brightness anymore.
– leftaroundabout
May 24 '16 at 21:00
7
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry. So be careful tweaking the permissions on this.
– RyanNerd
Oct 21 '16 at 16:21
|
show 7 more comments
For Laptops,sudo setpci -s 00:02.0 F4.B=80
Change 80 by [0-FF] to get lowest-highest brightness.
The value specified is in hex, so 80 will give you a 50% of max brightness.
For Desktops [not tested by me],xgamma -gamma .75
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
thank you for this answer, it's good to know how things are done at the lower levels
– erjoalgo
Oct 18 '13 at 6:30
1
This was the only answer that worked for me on a Samsung NB30 Plus.
– OSE
Oct 21 '13 at 18:33
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values?
– Rasmus
Oct 2 '14 at 8:27
Thanks I'm on a laptop,setpcididn't work butxgammadid.
– Philip Kirkbride
May 2 '18 at 13:26
add a comment |
Try this in terminal:
xrandr --output LVDS1 --brightness 0.9
You can change the last value as you like, eg. 0.2
1
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity
– erjoalgo
Oct 18 '13 at 6:31
add a comment |
Make this script:
set-brightness.sh
#!/bin/bash
TARGET="acpi_video0"
cd /sys/class/backlight
MAX="$(cat "${TARGET}/max_brightness")"
# The `/1` at the end forced bc to cast the result
# to an integer, even if $1 is a float (which it
# should be)
LOGIC="$(echo "($1 * ${MAX})/1" | bc)"
for i in */; do
if [[ "${TARGET}/" != "$i" && -e "${i}brightness" ]]; then
cat "${i}max_brightness" > "${i}brightness"
fi
done
echo "$LOGIC" > "${TARGET}/brightness"
Run it as root, with any value between 0 and 1.
sudo ./set-brightness.sh 0.5
- If your system doesn't have an
/sys/class/backlight/acpi_video0, there should be at least one directory in there, which may be device-specific (I also have aradeon_bl0, for example). - If you have others, keep in mind their values stack (hence the loop; pushing all the other values to 1.0, then setting the target one to the desired amount).
- While
acpi_video0should always work, it doesn't always have the full range of physical brightnesses available. Try each one, and use the one with the largest gamut as your "TARGET"
2
Consider using/sys/class/backlight/*/brightnessinstead of trying to hard-codeacpi_video0into the script. It will allow for generalizing the path to file, which can be different - i for example haveintel_backlight, notacpi_video0. That's what I've used in my script here
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:41
add a comment |
KDE 4.12:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightness 55
KDE Plasma Version: 5.14.3:
The above code is still valid. It will only work if you are a KDE user. However in that case it will require no additional piece of software. It will have the exact same behavior as when using the "battery and brightness" widget. AFAIK it changes the physical backlight, in contrast with xrandr which does does not.
Beware that the 55 above is not a fraction of 100, the latter being the max brightness.
Instead it is related to max_brightness:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl brightnessMax
There is also a "silent" version that you might prefer in a script:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightnessSilent 2000
Refs: qdbus, solid, brightness
can you explain what It will do ?
– rɑːdʒɑ
Apr 8 '14 at 18:27
@inkbottle Thanks a lot for the additions!
– int_ua
Dec 21 '18 at 9:41
add a comment |
Here's a short line that can help you relax your eyes. Just create a crontaab with the line or make a script
xrandr --output VGA1 --brightness 0.5; sleep 20; xrandr --output VGA1 --brightness 1
add a comment |
As @palacsint said, echo 244 > /sys/class/backlight/intel_backlight/brightness path works for me.
But max and min values are resent in /sys/class/backlight/intel_backlight/max_brightness and /sys/class/backlight/intel_backlight/bl_power files respectively.
Also, the actual brightness that your computer is running now is present in /sys/class/backlight/intel_backlight/actual_brightness
add a comment |
Using the above answers, I created this script (saved in my home directory as brightness.sh) to modify display brightness (as the laptop's keyboard suffered a spilled tea issue and became unusable). Feel free to use it (if you have the designated files...otherwise tinkering to point to your variation of them will be necessary).
#!/bin/bash
function main_menu
{
sudo clear
cursetting=$(cat /sys/class/backlight/intel_backlight/brightness)
maxsetting=$(cat /sys/class/backlight/intel_backlight/max_brightness)
powersave=$((maxsetting/5))
conservative=$((powersave*2))
medium=$((powersave*3))
performance=$((powersave*4))
echo ""
echo "----------------------- Brightness -----------------------"
echo " 1. Set Display to Minimum (Powersave) brightness setting."
echo " 2. Set Display to Low (Conservative) brightness setting."
echo " 3. Set Display to Medium brightness setting."
echo " 4. Set Display to High (Performance) brightness setting."
echo " 5. Set Display to Maximum brightness setting."
echo " 6. Exit."
echo "----------------------------------------------------------"
if [ $cursetting -eq $powersave ]; then
cursetting='Minimum'
else
if [ $cursetting -eq $conservative ]; then
cursetting='Conservative'
else
if [ $cursetting -eq $medium ]; then
cursetting='Medium'
else
if [ $cursetting -eq $performance ]; then
cursetting='Performance'
else
if [ $cursetting -eq $maxsetting ]; then
cursetting='Maximum'
fi
fi
fi
fi
fi
echo " Current Display Setting - "$cursetting;
choice=7
echo ""
echo -e "Please enter your choice: c"
}
function press_enter
{
echo ""
echo -n "Press Enter to continue."
read
main_menu
}
main_menu
while [ $choice -eq 7 ]; do
read choice
if [ $choice -eq 1 ]; then
echo $powersave | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 2 ]; then
echo $conservative | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 3 ]; then
echo $medium | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 4 ]; then
echo $performance | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 5 ]; then
echo $maxsetting | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 6 ]; then
exit;
else
echo -e "Please enter the NUMBER of your choice: c"
choice = 7
fi
fi
fi
fi
fi
fi
done
You could do better than just nesting a lot of if conditions, likeelifor even bettercase. Also I suggest reading a style guide like google.github.io/styleguide/shell.xml and trying a linter like shellcheck as it helps you create better code. I wish someone told me this when I started scripting years ago. :)
– LiveWireBT
Jan 2 at 5:38
add a comment |
ddccontrol is another option for controlling backlighting for external monitors. Here I can set the backlight of my external monitor to 50% of its power with:
ddccontrol -p -r 0x10 -w 50
I looked in possible solutions for this problem to improve the way Redshift handles brightness changes. Through there I found that there is a patchset for the Linux kernel to improve compatibility across devices, so that laptops and external screens could work similarly, through sysfs.
In the meantime, ddccontrol is the only thing that works for me here. As usual, the Arch wiki has good overall documentation on the topic as well.
add a comment |
Interactive ncurses-like UI using xbacklight
A poor man's ncurses. Hit h and it goes down 10%, hit l and it goes up 10%. Then show the current luminosity.
xback() (
done=false;
echo "less: h, more: l, quit: q"
while ! $done; do
read -rsn1 key
if [ "$key" = h ]; then
xbacklight -dec 10
elif [ "$key" = l ]; then
xbacklight -inc 10
elif [ "$key" = q ]; then
done=true
fi
printf "r$(xbacklight -get) "
done
)
add a comment |
Using DBus with Gnome
Steps in brightness for keyboard contol can be implemented with this method as well.
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown
Notes
No root privileges needed! As the/sys/class/backlightway.
xbacklightnot always work.
xrandrjust do a gamma correction
- For KDE check this answer
add a comment |
protected by rɑːdʒɑ Apr 23 '14 at 13:28
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
13 Answers
13
active
oldest
votes
13 Answers
13
active
oldest
votes
active
oldest
votes
active
oldest
votes
One more way we have to do this is with another new program named as xbacklight , open your terminal and type this
sudo apt-get install xbacklight
then type this xbacklight -set 50
there 50 stands for brightness range we can get it upto 100 from 0 .
you can also increase and decrease the brightness from present value to specified level.as you mentioned if you want to increase to 10% from current value of brightness then you can give this
xbacklight -inc 10
and to decrease 10% you can give this
xbacklight -dec 10
Warning: xbacklight only works with Intel, not properly on Radeon and not at all with modesetting driver (source).
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Aug 24 '12 at 9:31
1
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10
– rɑːdʒɑ
Aug 24 '12 at 16:53
1
Ok, now it's in your answer. Thanks a lot, I'll try that out.
– user69748
Aug 27 '12 at 7:28
32
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless.
– user69748
Sep 4 '12 at 14:38
1
Additionally, there's a shorthand you can use:xbacklight +10; xbacklight -10; xbacklight =50;
– Fordi
Mar 9 '16 at 18:48
|
show 6 more comments
One more way we have to do this is with another new program named as xbacklight , open your terminal and type this
sudo apt-get install xbacklight
then type this xbacklight -set 50
there 50 stands for brightness range we can get it upto 100 from 0 .
you can also increase and decrease the brightness from present value to specified level.as you mentioned if you want to increase to 10% from current value of brightness then you can give this
xbacklight -inc 10
and to decrease 10% you can give this
xbacklight -dec 10
Warning: xbacklight only works with Intel, not properly on Radeon and not at all with modesetting driver (source).
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Aug 24 '12 at 9:31
1
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10
– rɑːdʒɑ
Aug 24 '12 at 16:53
1
Ok, now it's in your answer. Thanks a lot, I'll try that out.
– user69748
Aug 27 '12 at 7:28
32
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless.
– user69748
Sep 4 '12 at 14:38
1
Additionally, there's a shorthand you can use:xbacklight +10; xbacklight -10; xbacklight =50;
– Fordi
Mar 9 '16 at 18:48
|
show 6 more comments
One more way we have to do this is with another new program named as xbacklight , open your terminal and type this
sudo apt-get install xbacklight
then type this xbacklight -set 50
there 50 stands for brightness range we can get it upto 100 from 0 .
you can also increase and decrease the brightness from present value to specified level.as you mentioned if you want to increase to 10% from current value of brightness then you can give this
xbacklight -inc 10
and to decrease 10% you can give this
xbacklight -dec 10
Warning: xbacklight only works with Intel, not properly on Radeon and not at all with modesetting driver (source).
One more way we have to do this is with another new program named as xbacklight , open your terminal and type this
sudo apt-get install xbacklight
then type this xbacklight -set 50
there 50 stands for brightness range we can get it upto 100 from 0 .
you can also increase and decrease the brightness from present value to specified level.as you mentioned if you want to increase to 10% from current value of brightness then you can give this
xbacklight -inc 10
and to decrease 10% you can give this
xbacklight -dec 10
Warning: xbacklight only works with Intel, not properly on Radeon and not at all with modesetting driver (source).
edited Jan 4 at 22:31
Pablo Bianchi
2,4151529
2,4151529
answered Jun 11 '12 at 5:28
rɑːdʒɑrɑːdʒɑ
57.1k84216301
57.1k84216301
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Aug 24 '12 at 9:31
1
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10
– rɑːdʒɑ
Aug 24 '12 at 16:53
1
Ok, now it's in your answer. Thanks a lot, I'll try that out.
– user69748
Aug 27 '12 at 7:28
32
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless.
– user69748
Sep 4 '12 at 14:38
1
Additionally, there's a shorthand you can use:xbacklight +10; xbacklight -10; xbacklight =50;
– Fordi
Mar 9 '16 at 18:48
|
show 6 more comments
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Aug 24 '12 at 9:31
1
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10
– rɑːdʒɑ
Aug 24 '12 at 16:53
1
Ok, now it's in your answer. Thanks a lot, I'll try that out.
– user69748
Aug 27 '12 at 7:28
32
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless.
– user69748
Sep 4 '12 at 14:38
1
Additionally, there's a shorthand you can use:xbacklight +10; xbacklight -10; xbacklight =50;
– Fordi
Mar 9 '16 at 18:48
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Aug 24 '12 at 9:31
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Aug 24 '12 at 9:31
1
1
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10
– rɑːdʒɑ
Aug 24 '12 at 16:53
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10
– rɑːdʒɑ
Aug 24 '12 at 16:53
1
1
Ok, now it's in your answer. Thanks a lot, I'll try that out.
– user69748
Aug 27 '12 at 7:28
Ok, now it's in your answer. Thanks a lot, I'll try that out.
– user69748
Aug 27 '12 at 7:28
32
32
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless.
– user69748
Sep 4 '12 at 14:38
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless.
– user69748
Sep 4 '12 at 14:38
1
1
Additionally, there's a shorthand you can use:
xbacklight +10; xbacklight -10; xbacklight =50;– Fordi
Mar 9 '16 at 18:48
Additionally, there's a shorthand you can use:
xbacklight +10; xbacklight -10; xbacklight =50;– Fordi
Mar 9 '16 at 18:48
|
show 6 more comments
Open your terminal and type this
xrandr -q | grep " connected"
it will gives you the output as
LVDS1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
There LVDS1 Stands for your display. So now you have to do as
xrandr --output LVDS1 --brightness 0.5
there 0.5 stands for brightness level and it ranges from 0.0 to 1.0 .
0.0 -> Full black .so you have to choose the required value of brightness .
This doesn't change brightness at a hardware level. From randr manual:
--brightness brightnessMultiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.
2
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
44
this doesn't seem to change the brightness at a hardware level
– erjoalgo
Oct 18 '13 at 6:29
11
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker.
– Mephisto
Nov 16 '14 at 15:47
2
Thanx it saved my day and eyes too.. :)
– Shylendra Madda
Nov 8 '15 at 11:51
6
It fakes the brightness. The brightness does not change, it is rendered by software.
– user1970939
Apr 1 '16 at 20:58
|
show 15 more comments
Open your terminal and type this
xrandr -q | grep " connected"
it will gives you the output as
LVDS1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
There LVDS1 Stands for your display. So now you have to do as
xrandr --output LVDS1 --brightness 0.5
there 0.5 stands for brightness level and it ranges from 0.0 to 1.0 .
0.0 -> Full black .so you have to choose the required value of brightness .
This doesn't change brightness at a hardware level. From randr manual:
--brightness brightnessMultiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.
2
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
44
this doesn't seem to change the brightness at a hardware level
– erjoalgo
Oct 18 '13 at 6:29
11
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker.
– Mephisto
Nov 16 '14 at 15:47
2
Thanx it saved my day and eyes too.. :)
– Shylendra Madda
Nov 8 '15 at 11:51
6
It fakes the brightness. The brightness does not change, it is rendered by software.
– user1970939
Apr 1 '16 at 20:58
|
show 15 more comments
Open your terminal and type this
xrandr -q | grep " connected"
it will gives you the output as
LVDS1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
There LVDS1 Stands for your display. So now you have to do as
xrandr --output LVDS1 --brightness 0.5
there 0.5 stands for brightness level and it ranges from 0.0 to 1.0 .
0.0 -> Full black .so you have to choose the required value of brightness .
This doesn't change brightness at a hardware level. From randr manual:
--brightness brightnessMultiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.
Open your terminal and type this
xrandr -q | grep " connected"
it will gives you the output as
LVDS1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
There LVDS1 Stands for your display. So now you have to do as
xrandr --output LVDS1 --brightness 0.5
there 0.5 stands for brightness level and it ranges from 0.0 to 1.0 .
0.0 -> Full black .so you have to choose the required value of brightness .
This doesn't change brightness at a hardware level. From randr manual:
--brightness brightnessMultiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.
edited Jan 4 at 22:48
Pablo Bianchi
2,4151529
2,4151529
answered Jun 11 '12 at 5:25
rɑːdʒɑrɑːdʒɑ
57.1k84216301
57.1k84216301
2
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
44
this doesn't seem to change the brightness at a hardware level
– erjoalgo
Oct 18 '13 at 6:29
11
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker.
– Mephisto
Nov 16 '14 at 15:47
2
Thanx it saved my day and eyes too.. :)
– Shylendra Madda
Nov 8 '15 at 11:51
6
It fakes the brightness. The brightness does not change, it is rendered by software.
– user1970939
Apr 1 '16 at 20:58
|
show 15 more comments
2
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
44
this doesn't seem to change the brightness at a hardware level
– erjoalgo
Oct 18 '13 at 6:29
11
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker.
– Mephisto
Nov 16 '14 at 15:47
2
Thanx it saved my day and eyes too.. :)
– Shylendra Madda
Nov 8 '15 at 11:51
6
It fakes the brightness. The brightness does not change, it is rendered by software.
– user1970939
Apr 1 '16 at 20:58
2
2
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
44
44
this doesn't seem to change the brightness at a hardware level
– erjoalgo
Oct 18 '13 at 6:29
this doesn't seem to change the brightness at a hardware level
– erjoalgo
Oct 18 '13 at 6:29
11
11
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker.
– Mephisto
Nov 16 '14 at 15:47
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker.
– Mephisto
Nov 16 '14 at 15:47
2
2
Thanx it saved my day and eyes too.. :)
– Shylendra Madda
Nov 8 '15 at 11:51
Thanx it saved my day and eyes too.. :)
– Shylendra Madda
Nov 8 '15 at 11:51
6
6
It fakes the brightness. The brightness does not change, it is rendered by software.
– user1970939
Apr 1 '16 at 20:58
It fakes the brightness. The brightness does not change, it is rendered by software.
– user1970939
Apr 1 '16 at 20:58
|
show 15 more comments
The following works for me:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness
I guess the maximum possible value is in the /sys/class/backlight/intel_backlight/max_brightness file.
Replace intel_backlight with an asterisk to apply to all backlights.
15
@Ray Try this:echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness.
– Mygod
Nov 28 '15 at 17:39
10
@Ray when you dosudo echo 400 > /sys/class . .. ./brightnessredirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is whyteeworks.
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:37
4
echo 400 | sudo tee /sys/class/backlight/radeon_bl0/brightnessfor radeon APUs and cards
– Suici Doga
Apr 1 '16 at 11:40
13
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if yousudo chmod 0646thebrightnessfile, sosudoisn't needed for setting brightness anymore.
– leftaroundabout
May 24 '16 at 21:00
7
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry. So be careful tweaking the permissions on this.
– RyanNerd
Oct 21 '16 at 16:21
|
show 7 more comments
The following works for me:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness
I guess the maximum possible value is in the /sys/class/backlight/intel_backlight/max_brightness file.
Replace intel_backlight with an asterisk to apply to all backlights.
15
@Ray Try this:echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness.
– Mygod
Nov 28 '15 at 17:39
10
@Ray when you dosudo echo 400 > /sys/class . .. ./brightnessredirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is whyteeworks.
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:37
4
echo 400 | sudo tee /sys/class/backlight/radeon_bl0/brightnessfor radeon APUs and cards
– Suici Doga
Apr 1 '16 at 11:40
13
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if yousudo chmod 0646thebrightnessfile, sosudoisn't needed for setting brightness anymore.
– leftaroundabout
May 24 '16 at 21:00
7
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry. So be careful tweaking the permissions on this.
– RyanNerd
Oct 21 '16 at 16:21
|
show 7 more comments
The following works for me:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness
I guess the maximum possible value is in the /sys/class/backlight/intel_backlight/max_brightness file.
Replace intel_backlight with an asterisk to apply to all backlights.
The following works for me:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness
I guess the maximum possible value is in the /sys/class/backlight/intel_backlight/max_brightness file.
Replace intel_backlight with an asterisk to apply to all backlights.
edited Jan 4 at 22:26
Pablo Bianchi
2,4151529
2,4151529
answered May 19 '14 at 9:51
palacsintpalacsint
1,227109
1,227109
15
@Ray Try this:echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness.
– Mygod
Nov 28 '15 at 17:39
10
@Ray when you dosudo echo 400 > /sys/class . .. ./brightnessredirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is whyteeworks.
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:37
4
echo 400 | sudo tee /sys/class/backlight/radeon_bl0/brightnessfor radeon APUs and cards
– Suici Doga
Apr 1 '16 at 11:40
13
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if yousudo chmod 0646thebrightnessfile, sosudoisn't needed for setting brightness anymore.
– leftaroundabout
May 24 '16 at 21:00
7
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry. So be careful tweaking the permissions on this.
– RyanNerd
Oct 21 '16 at 16:21
|
show 7 more comments
15
@Ray Try this:echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness.
– Mygod
Nov 28 '15 at 17:39
10
@Ray when you dosudo echo 400 > /sys/class . .. ./brightnessredirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is whyteeworks.
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:37
4
echo 400 | sudo tee /sys/class/backlight/radeon_bl0/brightnessfor radeon APUs and cards
– Suici Doga
Apr 1 '16 at 11:40
13
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if yousudo chmod 0646thebrightnessfile, sosudoisn't needed for setting brightness anymore.
– leftaroundabout
May 24 '16 at 21:00
7
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry. So be careful tweaking the permissions on this.
– RyanNerd
Oct 21 '16 at 16:21
15
15
@Ray Try this:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness.– Mygod
Nov 28 '15 at 17:39
@Ray Try this:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness.– Mygod
Nov 28 '15 at 17:39
10
10
@Ray when you do
sudo echo 400 > /sys/class . .. ./brightness redirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is why tee works.– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:37
@Ray when you do
sudo echo 400 > /sys/class . .. ./brightness redirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is why tee works.– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:37
4
4
echo 400 | sudo tee /sys/class/backlight/radeon_bl0/brightness for radeon APUs and cards– Suici Doga
Apr 1 '16 at 11:40
echo 400 | sudo tee /sys/class/backlight/radeon_bl0/brightness for radeon APUs and cards– Suici Doga
Apr 1 '16 at 11:40
13
13
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if you
sudo chmod 0646 the brightness file, so sudo isn't needed for setting brightness anymore.– leftaroundabout
May 24 '16 at 21:00
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if you
sudo chmod 0646 the brightness file, so sudo isn't needed for setting brightness anymore.– leftaroundabout
May 24 '16 at 21:00
7
7
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry. So be careful tweaking the permissions on this.
– RyanNerd
Oct 21 '16 at 16:21
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry. So be careful tweaking the permissions on this.
– RyanNerd
Oct 21 '16 at 16:21
|
show 7 more comments
For Laptops,sudo setpci -s 00:02.0 F4.B=80
Change 80 by [0-FF] to get lowest-highest brightness.
The value specified is in hex, so 80 will give you a 50% of max brightness.
For Desktops [not tested by me],xgamma -gamma .75
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
thank you for this answer, it's good to know how things are done at the lower levels
– erjoalgo
Oct 18 '13 at 6:30
1
This was the only answer that worked for me on a Samsung NB30 Plus.
– OSE
Oct 21 '13 at 18:33
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values?
– Rasmus
Oct 2 '14 at 8:27
Thanks I'm on a laptop,setpcididn't work butxgammadid.
– Philip Kirkbride
May 2 '18 at 13:26
add a comment |
For Laptops,sudo setpci -s 00:02.0 F4.B=80
Change 80 by [0-FF] to get lowest-highest brightness.
The value specified is in hex, so 80 will give you a 50% of max brightness.
For Desktops [not tested by me],xgamma -gamma .75
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
thank you for this answer, it's good to know how things are done at the lower levels
– erjoalgo
Oct 18 '13 at 6:30
1
This was the only answer that worked for me on a Samsung NB30 Plus.
– OSE
Oct 21 '13 at 18:33
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values?
– Rasmus
Oct 2 '14 at 8:27
Thanks I'm on a laptop,setpcididn't work butxgammadid.
– Philip Kirkbride
May 2 '18 at 13:26
add a comment |
For Laptops,sudo setpci -s 00:02.0 F4.B=80
Change 80 by [0-FF] to get lowest-highest brightness.
The value specified is in hex, so 80 will give you a 50% of max brightness.
For Desktops [not tested by me],xgamma -gamma .75
For Laptops,sudo setpci -s 00:02.0 F4.B=80
Change 80 by [0-FF] to get lowest-highest brightness.
The value specified is in hex, so 80 will give you a 50% of max brightness.
For Desktops [not tested by me],xgamma -gamma .75
edited Sep 26 '17 at 3:00
answered Jun 10 '12 at 17:37
Gaurav GandhiGaurav Gandhi
9001819
9001819
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
thank you for this answer, it's good to know how things are done at the lower levels
– erjoalgo
Oct 18 '13 at 6:30
1
This was the only answer that worked for me on a Samsung NB30 Plus.
– OSE
Oct 21 '13 at 18:33
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values?
– Rasmus
Oct 2 '14 at 8:27
Thanks I'm on a laptop,setpcididn't work butxgammadid.
– Philip Kirkbride
May 2 '18 at 13:26
add a comment |
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
thank you for this answer, it's good to know how things are done at the lower levels
– erjoalgo
Oct 18 '13 at 6:30
1
This was the only answer that worked for me on a Samsung NB30 Plus.
– OSE
Oct 21 '13 at 18:33
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values?
– Rasmus
Oct 2 '14 at 8:27
Thanks I'm on a laptop,setpcididn't work butxgammadid.
– Philip Kirkbride
May 2 '18 at 13:26
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too?
– user69748
Dec 14 '12 at 11:50
thank you for this answer, it's good to know how things are done at the lower levels
– erjoalgo
Oct 18 '13 at 6:30
thank you for this answer, it's good to know how things are done at the lower levels
– erjoalgo
Oct 18 '13 at 6:30
1
1
This was the only answer that worked for me on a Samsung NB30 Plus.
– OSE
Oct 21 '13 at 18:33
This was the only answer that worked for me on a Samsung NB30 Plus.
– OSE
Oct 21 '13 at 18:33
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values?
– Rasmus
Oct 2 '14 at 8:27
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values?
– Rasmus
Oct 2 '14 at 8:27
Thanks I'm on a laptop,
setpci didn't work but xgamma did.– Philip Kirkbride
May 2 '18 at 13:26
Thanks I'm on a laptop,
setpci didn't work but xgamma did.– Philip Kirkbride
May 2 '18 at 13:26
add a comment |
Try this in terminal:
xrandr --output LVDS1 --brightness 0.9
You can change the last value as you like, eg. 0.2
1
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity
– erjoalgo
Oct 18 '13 at 6:31
add a comment |
Try this in terminal:
xrandr --output LVDS1 --brightness 0.9
You can change the last value as you like, eg. 0.2
1
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity
– erjoalgo
Oct 18 '13 at 6:31
add a comment |
Try this in terminal:
xrandr --output LVDS1 --brightness 0.9
You can change the last value as you like, eg. 0.2
Try this in terminal:
xrandr --output LVDS1 --brightness 0.9
You can change the last value as you like, eg. 0.2
edited Sep 22 '13 at 22:47
Eric Carvalho
41.4k17114145
41.4k17114145
answered Sep 22 '13 at 22:12
ripuripu
5911
5911
1
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity
– erjoalgo
Oct 18 '13 at 6:31
add a comment |
1
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity
– erjoalgo
Oct 18 '13 at 6:31
1
1
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity
– erjoalgo
Oct 18 '13 at 6:31
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity
– erjoalgo
Oct 18 '13 at 6:31
add a comment |
Make this script:
set-brightness.sh
#!/bin/bash
TARGET="acpi_video0"
cd /sys/class/backlight
MAX="$(cat "${TARGET}/max_brightness")"
# The `/1` at the end forced bc to cast the result
# to an integer, even if $1 is a float (which it
# should be)
LOGIC="$(echo "($1 * ${MAX})/1" | bc)"
for i in */; do
if [[ "${TARGET}/" != "$i" && -e "${i}brightness" ]]; then
cat "${i}max_brightness" > "${i}brightness"
fi
done
echo "$LOGIC" > "${TARGET}/brightness"
Run it as root, with any value between 0 and 1.
sudo ./set-brightness.sh 0.5
- If your system doesn't have an
/sys/class/backlight/acpi_video0, there should be at least one directory in there, which may be device-specific (I also have aradeon_bl0, for example). - If you have others, keep in mind their values stack (hence the loop; pushing all the other values to 1.0, then setting the target one to the desired amount).
- While
acpi_video0should always work, it doesn't always have the full range of physical brightnesses available. Try each one, and use the one with the largest gamut as your "TARGET"
2
Consider using/sys/class/backlight/*/brightnessinstead of trying to hard-codeacpi_video0into the script. It will allow for generalizing the path to file, which can be different - i for example haveintel_backlight, notacpi_video0. That's what I've used in my script here
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:41
add a comment |
Make this script:
set-brightness.sh
#!/bin/bash
TARGET="acpi_video0"
cd /sys/class/backlight
MAX="$(cat "${TARGET}/max_brightness")"
# The `/1` at the end forced bc to cast the result
# to an integer, even if $1 is a float (which it
# should be)
LOGIC="$(echo "($1 * ${MAX})/1" | bc)"
for i in */; do
if [[ "${TARGET}/" != "$i" && -e "${i}brightness" ]]; then
cat "${i}max_brightness" > "${i}brightness"
fi
done
echo "$LOGIC" > "${TARGET}/brightness"
Run it as root, with any value between 0 and 1.
sudo ./set-brightness.sh 0.5
- If your system doesn't have an
/sys/class/backlight/acpi_video0, there should be at least one directory in there, which may be device-specific (I also have aradeon_bl0, for example). - If you have others, keep in mind their values stack (hence the loop; pushing all the other values to 1.0, then setting the target one to the desired amount).
- While
acpi_video0should always work, it doesn't always have the full range of physical brightnesses available. Try each one, and use the one with the largest gamut as your "TARGET"
2
Consider using/sys/class/backlight/*/brightnessinstead of trying to hard-codeacpi_video0into the script. It will allow for generalizing the path to file, which can be different - i for example haveintel_backlight, notacpi_video0. That's what I've used in my script here
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:41
add a comment |
Make this script:
set-brightness.sh
#!/bin/bash
TARGET="acpi_video0"
cd /sys/class/backlight
MAX="$(cat "${TARGET}/max_brightness")"
# The `/1` at the end forced bc to cast the result
# to an integer, even if $1 is a float (which it
# should be)
LOGIC="$(echo "($1 * ${MAX})/1" | bc)"
for i in */; do
if [[ "${TARGET}/" != "$i" && -e "${i}brightness" ]]; then
cat "${i}max_brightness" > "${i}brightness"
fi
done
echo "$LOGIC" > "${TARGET}/brightness"
Run it as root, with any value between 0 and 1.
sudo ./set-brightness.sh 0.5
- If your system doesn't have an
/sys/class/backlight/acpi_video0, there should be at least one directory in there, which may be device-specific (I also have aradeon_bl0, for example). - If you have others, keep in mind their values stack (hence the loop; pushing all the other values to 1.0, then setting the target one to the desired amount).
- While
acpi_video0should always work, it doesn't always have the full range of physical brightnesses available. Try each one, and use the one with the largest gamut as your "TARGET"
Make this script:
set-brightness.sh
#!/bin/bash
TARGET="acpi_video0"
cd /sys/class/backlight
MAX="$(cat "${TARGET}/max_brightness")"
# The `/1` at the end forced bc to cast the result
# to an integer, even if $1 is a float (which it
# should be)
LOGIC="$(echo "($1 * ${MAX})/1" | bc)"
for i in */; do
if [[ "${TARGET}/" != "$i" && -e "${i}brightness" ]]; then
cat "${i}max_brightness" > "${i}brightness"
fi
done
echo "$LOGIC" > "${TARGET}/brightness"
Run it as root, with any value between 0 and 1.
sudo ./set-brightness.sh 0.5
- If your system doesn't have an
/sys/class/backlight/acpi_video0, there should be at least one directory in there, which may be device-specific (I also have aradeon_bl0, for example). - If you have others, keep in mind their values stack (hence the loop; pushing all the other values to 1.0, then setting the target one to the desired amount).
- While
acpi_video0should always work, it doesn't always have the full range of physical brightnesses available. Try each one, and use the one with the largest gamut as your "TARGET"
edited Mar 9 '16 at 19:30
muru
1
1
answered Mar 9 '16 at 19:18
FordiFordi
21125
21125
2
Consider using/sys/class/backlight/*/brightnessinstead of trying to hard-codeacpi_video0into the script. It will allow for generalizing the path to file, which can be different - i for example haveintel_backlight, notacpi_video0. That's what I've used in my script here
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:41
add a comment |
2
Consider using/sys/class/backlight/*/brightnessinstead of trying to hard-codeacpi_video0into the script. It will allow for generalizing the path to file, which can be different - i for example haveintel_backlight, notacpi_video0. That's what I've used in my script here
– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:41
2
2
Consider using
/sys/class/backlight/*/brightness instead of trying to hard-code acpi_video0 into the script. It will allow for generalizing the path to file, which can be different - i for example have intel_backlight, not acpi_video0. That's what I've used in my script here– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:41
Consider using
/sys/class/backlight/*/brightness instead of trying to hard-code acpi_video0 into the script. It will allow for generalizing the path to file, which can be different - i for example have intel_backlight, not acpi_video0. That's what I've used in my script here– Sergiy Kolodyazhnyy
Mar 9 '16 at 19:41
add a comment |
KDE 4.12:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightness 55
KDE Plasma Version: 5.14.3:
The above code is still valid. It will only work if you are a KDE user. However in that case it will require no additional piece of software. It will have the exact same behavior as when using the "battery and brightness" widget. AFAIK it changes the physical backlight, in contrast with xrandr which does does not.
Beware that the 55 above is not a fraction of 100, the latter being the max brightness.
Instead it is related to max_brightness:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl brightnessMax
There is also a "silent" version that you might prefer in a script:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightnessSilent 2000
Refs: qdbus, solid, brightness
can you explain what It will do ?
– rɑːdʒɑ
Apr 8 '14 at 18:27
@inkbottle Thanks a lot for the additions!
– int_ua
Dec 21 '18 at 9:41
add a comment |
KDE 4.12:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightness 55
KDE Plasma Version: 5.14.3:
The above code is still valid. It will only work if you are a KDE user. However in that case it will require no additional piece of software. It will have the exact same behavior as when using the "battery and brightness" widget. AFAIK it changes the physical backlight, in contrast with xrandr which does does not.
Beware that the 55 above is not a fraction of 100, the latter being the max brightness.
Instead it is related to max_brightness:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl brightnessMax
There is also a "silent" version that you might prefer in a script:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightnessSilent 2000
Refs: qdbus, solid, brightness
can you explain what It will do ?
– rɑːdʒɑ
Apr 8 '14 at 18:27
@inkbottle Thanks a lot for the additions!
– int_ua
Dec 21 '18 at 9:41
add a comment |
KDE 4.12:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightness 55
KDE Plasma Version: 5.14.3:
The above code is still valid. It will only work if you are a KDE user. However in that case it will require no additional piece of software. It will have the exact same behavior as when using the "battery and brightness" widget. AFAIK it changes the physical backlight, in contrast with xrandr which does does not.
Beware that the 55 above is not a fraction of 100, the latter being the max brightness.
Instead it is related to max_brightness:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl brightnessMax
There is also a "silent" version that you might prefer in a script:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightnessSilent 2000
Refs: qdbus, solid, brightness
KDE 4.12:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightness 55
KDE Plasma Version: 5.14.3:
The above code is still valid. It will only work if you are a KDE user. However in that case it will require no additional piece of software. It will have the exact same behavior as when using the "battery and brightness" widget. AFAIK it changes the physical backlight, in contrast with xrandr which does does not.
Beware that the 55 above is not a fraction of 100, the latter being the max brightness.
Instead it is related to max_brightness:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl brightnessMax
There is also a "silent" version that you might prefer in a script:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightnessSilent 2000
Refs: qdbus, solid, brightness
edited Dec 21 '18 at 9:41
answered Mar 26 '14 at 4:54
int_uaint_ua
4,216751111
4,216751111
can you explain what It will do ?
– rɑːdʒɑ
Apr 8 '14 at 18:27
@inkbottle Thanks a lot for the additions!
– int_ua
Dec 21 '18 at 9:41
add a comment |
can you explain what It will do ?
– rɑːdʒɑ
Apr 8 '14 at 18:27
@inkbottle Thanks a lot for the additions!
– int_ua
Dec 21 '18 at 9:41
can you explain what It will do ?
– rɑːdʒɑ
Apr 8 '14 at 18:27
can you explain what It will do ?
– rɑːdʒɑ
Apr 8 '14 at 18:27
@inkbottle Thanks a lot for the additions!
– int_ua
Dec 21 '18 at 9:41
@inkbottle Thanks a lot for the additions!
– int_ua
Dec 21 '18 at 9:41
add a comment |
Here's a short line that can help you relax your eyes. Just create a crontaab with the line or make a script
xrandr --output VGA1 --brightness 0.5; sleep 20; xrandr --output VGA1 --brightness 1
add a comment |
Here's a short line that can help you relax your eyes. Just create a crontaab with the line or make a script
xrandr --output VGA1 --brightness 0.5; sleep 20; xrandr --output VGA1 --brightness 1
add a comment |
Here's a short line that can help you relax your eyes. Just create a crontaab with the line or make a script
xrandr --output VGA1 --brightness 0.5; sleep 20; xrandr --output VGA1 --brightness 1
Here's a short line that can help you relax your eyes. Just create a crontaab with the line or make a script
xrandr --output VGA1 --brightness 0.5; sleep 20; xrandr --output VGA1 --brightness 1
answered Mar 7 '14 at 20:32
CristianparkCristianpark
372
372
add a comment |
add a comment |
As @palacsint said, echo 244 > /sys/class/backlight/intel_backlight/brightness path works for me.
But max and min values are resent in /sys/class/backlight/intel_backlight/max_brightness and /sys/class/backlight/intel_backlight/bl_power files respectively.
Also, the actual brightness that your computer is running now is present in /sys/class/backlight/intel_backlight/actual_brightness
add a comment |
As @palacsint said, echo 244 > /sys/class/backlight/intel_backlight/brightness path works for me.
But max and min values are resent in /sys/class/backlight/intel_backlight/max_brightness and /sys/class/backlight/intel_backlight/bl_power files respectively.
Also, the actual brightness that your computer is running now is present in /sys/class/backlight/intel_backlight/actual_brightness
add a comment |
As @palacsint said, echo 244 > /sys/class/backlight/intel_backlight/brightness path works for me.
But max and min values are resent in /sys/class/backlight/intel_backlight/max_brightness and /sys/class/backlight/intel_backlight/bl_power files respectively.
Also, the actual brightness that your computer is running now is present in /sys/class/backlight/intel_backlight/actual_brightness
As @palacsint said, echo 244 > /sys/class/backlight/intel_backlight/brightness path works for me.
But max and min values are resent in /sys/class/backlight/intel_backlight/max_brightness and /sys/class/backlight/intel_backlight/bl_power files respectively.
Also, the actual brightness that your computer is running now is present in /sys/class/backlight/intel_backlight/actual_brightness
answered Dec 7 '14 at 5:59
user281989user281989
1221213
1221213
add a comment |
add a comment |
Using the above answers, I created this script (saved in my home directory as brightness.sh) to modify display brightness (as the laptop's keyboard suffered a spilled tea issue and became unusable). Feel free to use it (if you have the designated files...otherwise tinkering to point to your variation of them will be necessary).
#!/bin/bash
function main_menu
{
sudo clear
cursetting=$(cat /sys/class/backlight/intel_backlight/brightness)
maxsetting=$(cat /sys/class/backlight/intel_backlight/max_brightness)
powersave=$((maxsetting/5))
conservative=$((powersave*2))
medium=$((powersave*3))
performance=$((powersave*4))
echo ""
echo "----------------------- Brightness -----------------------"
echo " 1. Set Display to Minimum (Powersave) brightness setting."
echo " 2. Set Display to Low (Conservative) brightness setting."
echo " 3. Set Display to Medium brightness setting."
echo " 4. Set Display to High (Performance) brightness setting."
echo " 5. Set Display to Maximum brightness setting."
echo " 6. Exit."
echo "----------------------------------------------------------"
if [ $cursetting -eq $powersave ]; then
cursetting='Minimum'
else
if [ $cursetting -eq $conservative ]; then
cursetting='Conservative'
else
if [ $cursetting -eq $medium ]; then
cursetting='Medium'
else
if [ $cursetting -eq $performance ]; then
cursetting='Performance'
else
if [ $cursetting -eq $maxsetting ]; then
cursetting='Maximum'
fi
fi
fi
fi
fi
echo " Current Display Setting - "$cursetting;
choice=7
echo ""
echo -e "Please enter your choice: c"
}
function press_enter
{
echo ""
echo -n "Press Enter to continue."
read
main_menu
}
main_menu
while [ $choice -eq 7 ]; do
read choice
if [ $choice -eq 1 ]; then
echo $powersave | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 2 ]; then
echo $conservative | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 3 ]; then
echo $medium | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 4 ]; then
echo $performance | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 5 ]; then
echo $maxsetting | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 6 ]; then
exit;
else
echo -e "Please enter the NUMBER of your choice: c"
choice = 7
fi
fi
fi
fi
fi
fi
done
You could do better than just nesting a lot of if conditions, likeelifor even bettercase. Also I suggest reading a style guide like google.github.io/styleguide/shell.xml and trying a linter like shellcheck as it helps you create better code. I wish someone told me this when I started scripting years ago. :)
– LiveWireBT
Jan 2 at 5:38
add a comment |
Using the above answers, I created this script (saved in my home directory as brightness.sh) to modify display brightness (as the laptop's keyboard suffered a spilled tea issue and became unusable). Feel free to use it (if you have the designated files...otherwise tinkering to point to your variation of them will be necessary).
#!/bin/bash
function main_menu
{
sudo clear
cursetting=$(cat /sys/class/backlight/intel_backlight/brightness)
maxsetting=$(cat /sys/class/backlight/intel_backlight/max_brightness)
powersave=$((maxsetting/5))
conservative=$((powersave*2))
medium=$((powersave*3))
performance=$((powersave*4))
echo ""
echo "----------------------- Brightness -----------------------"
echo " 1. Set Display to Minimum (Powersave) brightness setting."
echo " 2. Set Display to Low (Conservative) brightness setting."
echo " 3. Set Display to Medium brightness setting."
echo " 4. Set Display to High (Performance) brightness setting."
echo " 5. Set Display to Maximum brightness setting."
echo " 6. Exit."
echo "----------------------------------------------------------"
if [ $cursetting -eq $powersave ]; then
cursetting='Minimum'
else
if [ $cursetting -eq $conservative ]; then
cursetting='Conservative'
else
if [ $cursetting -eq $medium ]; then
cursetting='Medium'
else
if [ $cursetting -eq $performance ]; then
cursetting='Performance'
else
if [ $cursetting -eq $maxsetting ]; then
cursetting='Maximum'
fi
fi
fi
fi
fi
echo " Current Display Setting - "$cursetting;
choice=7
echo ""
echo -e "Please enter your choice: c"
}
function press_enter
{
echo ""
echo -n "Press Enter to continue."
read
main_menu
}
main_menu
while [ $choice -eq 7 ]; do
read choice
if [ $choice -eq 1 ]; then
echo $powersave | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 2 ]; then
echo $conservative | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 3 ]; then
echo $medium | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 4 ]; then
echo $performance | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 5 ]; then
echo $maxsetting | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 6 ]; then
exit;
else
echo -e "Please enter the NUMBER of your choice: c"
choice = 7
fi
fi
fi
fi
fi
fi
done
You could do better than just nesting a lot of if conditions, likeelifor even bettercase. Also I suggest reading a style guide like google.github.io/styleguide/shell.xml and trying a linter like shellcheck as it helps you create better code. I wish someone told me this when I started scripting years ago. :)
– LiveWireBT
Jan 2 at 5:38
add a comment |
Using the above answers, I created this script (saved in my home directory as brightness.sh) to modify display brightness (as the laptop's keyboard suffered a spilled tea issue and became unusable). Feel free to use it (if you have the designated files...otherwise tinkering to point to your variation of them will be necessary).
#!/bin/bash
function main_menu
{
sudo clear
cursetting=$(cat /sys/class/backlight/intel_backlight/brightness)
maxsetting=$(cat /sys/class/backlight/intel_backlight/max_brightness)
powersave=$((maxsetting/5))
conservative=$((powersave*2))
medium=$((powersave*3))
performance=$((powersave*4))
echo ""
echo "----------------------- Brightness -----------------------"
echo " 1. Set Display to Minimum (Powersave) brightness setting."
echo " 2. Set Display to Low (Conservative) brightness setting."
echo " 3. Set Display to Medium brightness setting."
echo " 4. Set Display to High (Performance) brightness setting."
echo " 5. Set Display to Maximum brightness setting."
echo " 6. Exit."
echo "----------------------------------------------------------"
if [ $cursetting -eq $powersave ]; then
cursetting='Minimum'
else
if [ $cursetting -eq $conservative ]; then
cursetting='Conservative'
else
if [ $cursetting -eq $medium ]; then
cursetting='Medium'
else
if [ $cursetting -eq $performance ]; then
cursetting='Performance'
else
if [ $cursetting -eq $maxsetting ]; then
cursetting='Maximum'
fi
fi
fi
fi
fi
echo " Current Display Setting - "$cursetting;
choice=7
echo ""
echo -e "Please enter your choice: c"
}
function press_enter
{
echo ""
echo -n "Press Enter to continue."
read
main_menu
}
main_menu
while [ $choice -eq 7 ]; do
read choice
if [ $choice -eq 1 ]; then
echo $powersave | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 2 ]; then
echo $conservative | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 3 ]; then
echo $medium | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 4 ]; then
echo $performance | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 5 ]; then
echo $maxsetting | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 6 ]; then
exit;
else
echo -e "Please enter the NUMBER of your choice: c"
choice = 7
fi
fi
fi
fi
fi
fi
done
Using the above answers, I created this script (saved in my home directory as brightness.sh) to modify display brightness (as the laptop's keyboard suffered a spilled tea issue and became unusable). Feel free to use it (if you have the designated files...otherwise tinkering to point to your variation of them will be necessary).
#!/bin/bash
function main_menu
{
sudo clear
cursetting=$(cat /sys/class/backlight/intel_backlight/brightness)
maxsetting=$(cat /sys/class/backlight/intel_backlight/max_brightness)
powersave=$((maxsetting/5))
conservative=$((powersave*2))
medium=$((powersave*3))
performance=$((powersave*4))
echo ""
echo "----------------------- Brightness -----------------------"
echo " 1. Set Display to Minimum (Powersave) brightness setting."
echo " 2. Set Display to Low (Conservative) brightness setting."
echo " 3. Set Display to Medium brightness setting."
echo " 4. Set Display to High (Performance) brightness setting."
echo " 5. Set Display to Maximum brightness setting."
echo " 6. Exit."
echo "----------------------------------------------------------"
if [ $cursetting -eq $powersave ]; then
cursetting='Minimum'
else
if [ $cursetting -eq $conservative ]; then
cursetting='Conservative'
else
if [ $cursetting -eq $medium ]; then
cursetting='Medium'
else
if [ $cursetting -eq $performance ]; then
cursetting='Performance'
else
if [ $cursetting -eq $maxsetting ]; then
cursetting='Maximum'
fi
fi
fi
fi
fi
echo " Current Display Setting - "$cursetting;
choice=7
echo ""
echo -e "Please enter your choice: c"
}
function press_enter
{
echo ""
echo -n "Press Enter to continue."
read
main_menu
}
main_menu
while [ $choice -eq 7 ]; do
read choice
if [ $choice -eq 1 ]; then
echo $powersave | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 2 ]; then
echo $conservative | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 3 ]; then
echo $medium | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 4 ]; then
echo $performance | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 5 ]; then
echo $maxsetting | sudo tee /sys/class/backlight/intel_backlight/brightness
main_menu
else
if [ $choice -eq 6 ]; then
exit;
else
echo -e "Please enter the NUMBER of your choice: c"
choice = 7
fi
fi
fi
fi
fi
fi
done
answered Feb 26 '17 at 0:13
Aaron NicholsAaron Nichols
686
686
You could do better than just nesting a lot of if conditions, likeelifor even bettercase. Also I suggest reading a style guide like google.github.io/styleguide/shell.xml and trying a linter like shellcheck as it helps you create better code. I wish someone told me this when I started scripting years ago. :)
– LiveWireBT
Jan 2 at 5:38
add a comment |
You could do better than just nesting a lot of if conditions, likeelifor even bettercase. Also I suggest reading a style guide like google.github.io/styleguide/shell.xml and trying a linter like shellcheck as it helps you create better code. I wish someone told me this when I started scripting years ago. :)
– LiveWireBT
Jan 2 at 5:38
You could do better than just nesting a lot of if conditions, like
elif or even better case. Also I suggest reading a style guide like google.github.io/styleguide/shell.xml and trying a linter like shellcheck as it helps you create better code. I wish someone told me this when I started scripting years ago. :)– LiveWireBT
Jan 2 at 5:38
You could do better than just nesting a lot of if conditions, like
elif or even better case. Also I suggest reading a style guide like google.github.io/styleguide/shell.xml and trying a linter like shellcheck as it helps you create better code. I wish someone told me this when I started scripting years ago. :)– LiveWireBT
Jan 2 at 5:38
add a comment |
ddccontrol is another option for controlling backlighting for external monitors. Here I can set the backlight of my external monitor to 50% of its power with:
ddccontrol -p -r 0x10 -w 50
I looked in possible solutions for this problem to improve the way Redshift handles brightness changes. Through there I found that there is a patchset for the Linux kernel to improve compatibility across devices, so that laptops and external screens could work similarly, through sysfs.
In the meantime, ddccontrol is the only thing that works for me here. As usual, the Arch wiki has good overall documentation on the topic as well.
add a comment |
ddccontrol is another option for controlling backlighting for external monitors. Here I can set the backlight of my external monitor to 50% of its power with:
ddccontrol -p -r 0x10 -w 50
I looked in possible solutions for this problem to improve the way Redshift handles brightness changes. Through there I found that there is a patchset for the Linux kernel to improve compatibility across devices, so that laptops and external screens could work similarly, through sysfs.
In the meantime, ddccontrol is the only thing that works for me here. As usual, the Arch wiki has good overall documentation on the topic as well.
add a comment |
ddccontrol is another option for controlling backlighting for external monitors. Here I can set the backlight of my external monitor to 50% of its power with:
ddccontrol -p -r 0x10 -w 50
I looked in possible solutions for this problem to improve the way Redshift handles brightness changes. Through there I found that there is a patchset for the Linux kernel to improve compatibility across devices, so that laptops and external screens could work similarly, through sysfs.
In the meantime, ddccontrol is the only thing that works for me here. As usual, the Arch wiki has good overall documentation on the topic as well.
ddccontrol is another option for controlling backlighting for external monitors. Here I can set the backlight of my external monitor to 50% of its power with:
ddccontrol -p -r 0x10 -w 50
I looked in possible solutions for this problem to improve the way Redshift handles brightness changes. Through there I found that there is a patchset for the Linux kernel to improve compatibility across devices, so that laptops and external screens could work similarly, through sysfs.
In the meantime, ddccontrol is the only thing that works for me here. As usual, the Arch wiki has good overall documentation on the topic as well.
answered Jan 25 '18 at 22:14
anarcatanarcat
1315
1315
add a comment |
add a comment |
Interactive ncurses-like UI using xbacklight
A poor man's ncurses. Hit h and it goes down 10%, hit l and it goes up 10%. Then show the current luminosity.
xback() (
done=false;
echo "less: h, more: l, quit: q"
while ! $done; do
read -rsn1 key
if [ "$key" = h ]; then
xbacklight -dec 10
elif [ "$key" = l ]; then
xbacklight -inc 10
elif [ "$key" = q ]; then
done=true
fi
printf "r$(xbacklight -get) "
done
)
add a comment |
Interactive ncurses-like UI using xbacklight
A poor man's ncurses. Hit h and it goes down 10%, hit l and it goes up 10%. Then show the current luminosity.
xback() (
done=false;
echo "less: h, more: l, quit: q"
while ! $done; do
read -rsn1 key
if [ "$key" = h ]; then
xbacklight -dec 10
elif [ "$key" = l ]; then
xbacklight -inc 10
elif [ "$key" = q ]; then
done=true
fi
printf "r$(xbacklight -get) "
done
)
add a comment |
Interactive ncurses-like UI using xbacklight
A poor man's ncurses. Hit h and it goes down 10%, hit l and it goes up 10%. Then show the current luminosity.
xback() (
done=false;
echo "less: h, more: l, quit: q"
while ! $done; do
read -rsn1 key
if [ "$key" = h ]; then
xbacklight -dec 10
elif [ "$key" = l ]; then
xbacklight -inc 10
elif [ "$key" = q ]; then
done=true
fi
printf "r$(xbacklight -get) "
done
)
Interactive ncurses-like UI using xbacklight
A poor man's ncurses. Hit h and it goes down 10%, hit l and it goes up 10%. Then show the current luminosity.
xback() (
done=false;
echo "less: h, more: l, quit: q"
while ! $done; do
read -rsn1 key
if [ "$key" = h ]; then
xbacklight -dec 10
elif [ "$key" = l ]; then
xbacklight -inc 10
elif [ "$key" = q ]; then
done=true
fi
printf "r$(xbacklight -get) "
done
)
answered Nov 15 '17 at 21:40
Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功
9,25444346
9,25444346
add a comment |
add a comment |
Using DBus with Gnome
Steps in brightness for keyboard contol can be implemented with this method as well.
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown
Notes
No root privileges needed! As the/sys/class/backlightway.
xbacklightnot always work.
xrandrjust do a gamma correction
- For KDE check this answer
add a comment |
Using DBus with Gnome
Steps in brightness for keyboard contol can be implemented with this method as well.
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown
Notes
No root privileges needed! As the/sys/class/backlightway.
xbacklightnot always work.
xrandrjust do a gamma correction
- For KDE check this answer
add a comment |
Using DBus with Gnome
Steps in brightness for keyboard contol can be implemented with this method as well.
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown
Notes
No root privileges needed! As the/sys/class/backlightway.
xbacklightnot always work.
xrandrjust do a gamma correction
- For KDE check this answer
Using DBus with Gnome
Steps in brightness for keyboard contol can be implemented with this method as well.
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown
Notes
No root privileges needed! As the/sys/class/backlightway.
xbacklightnot always work.
xrandrjust do a gamma correction
- For KDE check this answer
answered Jan 4 at 23:02
Pablo BianchiPablo Bianchi
2,4151529
2,4151529
add a comment |
add a comment |
protected by rɑːdʒɑ Apr 23 '14 at 13:28
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
1
possible duplicate of Unable to change brightness in a Lenovo laptop
– Lekensteyn
Jun 10 '12 at 17:30
2
Thanks, Lekensteyn, but it's not a duplicate since lsmod | grep ^i915 gives me no output (see accepted solution). Still looking for a solution.
– user69748
Dec 14 '12 at 11:56