You are not logged in.

#1 2014-04-11 16:52:14

milo64
Banned
From: Chiang Mai, Thailand
Registered: 2013-01-18
Posts: 86
Website

How do I control brightness properly

For a very long time, I've made and used a script that does this:

BRIGHTNESS=$(< /sys/class/backlight/acpi_video0/brightness)
echo "mypassword" | su -c "echo $(( $BRIGHTNESS - 1)) > /sys/class/backlight/acpi_video0/brightness"

in order to reduce brightness and prevent eye strain.
I did the opposite to the 'brightness increase' shell script.
And, I did "bind [ run-shell -b 'b-down'" "bind ] run-shell -b 'b-up'"


It does work, but I have to admit that it isn't secure, since it reveals my password.

I wonder if someone knows a secure workaround for this?
It would be nice if I can access the workaround instantly through tmux without requiring password.

Thanks in advance.


milo64.
Registered Linux User: #555436
My Blog @ http://milo64.blogspot.com/

Offline

#2 2014-04-11 19:05:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: How do I control brightness properly

Use xbacklight?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-04-11 19:09:20

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: How do I control brightness properly

check out xbacklight and the other stuff on that wiki.

I bound two of my keys to the following commands:

xbacklight -dec 10

and

xbacklight -inc 10

and it works fine.

Edit: I just noticed that this wiki has some info. on redshift as well. If you're particularly interested in doing this to reduce eye strain I highly recommend checking it out. It automatically adjusts the screen temp. when the sun goes down and comes up. I can no longer do without it!

Last edited by nullified (2014-04-11 19:11:53)


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#4 2014-04-12 05:23:15

milo64
Banned
From: Chiang Mai, Thailand
Registered: 2013-01-18
Posts: 86
Website

Re: How do I control brightness properly

... the reason I use tmux because I don't have X installed and I don't use X at all.
thus, I don't have xbacklight.

Last edited by milo64 (2014-04-12 05:23:51)


milo64.
Registered Linux User: #555436
My Blog @ http://milo64.blogspot.com/

Offline

#5 2014-04-21 17:17:17

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: How do I control brightness properly

Does xbacklight work if you export the display variable before?

$ export DISPLAY=:0 ; xbacklight -dec 10

Offline

Board footer

Powered by FluxBB