Commands tagged brightness (7)

  • [UPDATE: Now works for multiple connected outputs] I woke up around midnight with an urge to do some late night hacking, but I didn't want a bright monitor screwing up my body's circadian rhythm. I've heard that at night blue (short wavelength) lights are particularly bad for your diurnal clock. That may be a bunch of hooey, but it is true that redder (longer wavelength) colors are easier on my eyes at night. This command makes the screen dimmer and adjusts the gamma curves to improve contrast, particularly darkening blues and greens (Rɣ=2, Gɣ=3, Bɣ=4). To reset your screen to normal, you can run this command: xrandr | sed -n 's/ connected.*//p' | xargs -n1 -tri xrandr --output {} --brightness 1 --gamma 1:1:1 or, more briefly, xgamma -g 1 Note: The sed part is fragile and wrong. I'm doing it this way because of a misfeature in xrandr(1), which requires an output be specified but has no programmatic way of querying available outputs. Someone needs to patch up xrandr to be shell script friendly or at least add virtual outputs named "PRIMARY" and "ALL". . Todo: Screen should dim (gradually) at sunset and brighten at sunrise. I think this could be done with a self-resubmitting at job, but I'm running into the commandlinefu 127 character limit just getting the sunrise time: wget --post-data=$(date "+xxy=%Y&xxm=%m&xxd=%d")"&st=WA&place=Seattle" -q -O- | sed -rn 's/\W*Sunrise\W*(.*)/\1/p' I hope some clever hacker comes up with a command line interface to Google's "OneBox", since the correct time shows up as the first hit when googling for "sunrise:cityname". . [Thank you to @flatcap for the sed improvement, which is much better than the head|tail|cut silliness I had before. And thank you to @braunmagrin for pointing out that the "connected" output may not be on the second line.] Show Sample Output

    xrandr | sed -n 's/ connected.*//p' | xargs -n1 -tri xrandr --output {} --brightness 0.7 --gamma 2:3:4
    hackerb9 · 2010-10-24 10:45:57 7

  • 3
    xbacklight -10%
    totti · 2013-01-17 17:53:05 0
  • Redshift will adjust the color temperature and protects eye at night -b : will adjust the brightness

    redshiftgui -o -b 0.5
    totti · 2012-02-26 16:10:02 0
  • I'm not sure what apt this is, but it seems to work on most X screens, an is useful for saving power, and not straining your eyes Show Sample Output

    xbacklight -set 50
    gabe240 · 2014-02-07 12:03:57 0

  • 1
    dbus-send --session --print-reply --dest="org.gnome.SettingsDaemon" /org/gnome/SettingsDaemon/Power org.gnome.SettingsDaemon.Power.Screen.SetPercentage uint32:30
    totti · 2013-02-04 11:21:07 0
  • xrandr --output <outputname> --brightness <value> If the driver of your graphics card supports it, then you can use xrandr. The following command lists the current configuration: xrandr --current --verbose If you want to change the configuration of an output, then you need the name of the output. This name is part of the output of xrandr --current, for example LVDS1. The brightness can be changed like this: xrandr --output <outputname> --brightness 0.8 Gamma: xrandr --output <outputname> --gamma 0.5:1.0:1.0

    xrandr --output LVDS1 --brightness 0.4
    totti · 2013-02-04 11:00:16 0
  • alias screen-brightness='xbacklight -set' alias screen-off='xset dpms force standby' alias screen-min='xbacklight -set 1' alias screen-max='xbacklight -set 100' alias screen-inc='xbacklight -inc 10' alias screen-dec='xbacklight -dec 10'

    xbacklight -set 100
    asdzxc · 2015-02-08 12:12:16 0

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Find the process you are looking for minus the grepped one
faster ;) but your idea is really cool

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Show Directories in the PATH Which does NOT Exist
I often need to know of my directory in the PATH, which one DOES NOT exist. This command answers that question * This command uses only bash's built-in commands * The parentheses spawn a new sub shell to prevent the modification of the IFS (input field separator) variable in the current shell

Sort a character string
Sorts a character string, using common shell commands.

vi a remote file with port
If you are running sshd on different port use above this command to edit/view remote file with vi/vim. In above example I am using port 12345.

change exif data in all jpeg's
this takes every jpg in the current directory and changes the exif data for manufactur and model. in my case i change it to LOMO LC-A because my scanner puts his data in there :]

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

back ssh from firewalled hosts
host B (you) redirects a modem port (62220) to his local ssh. host A is a remote machine (the ones that issues the ssh cmd). once connected port 5497 is in listening mode on host B. host B just do a ssh -p 5497 -l user and reaches the remote host'ssh. This can be used also for vnc and so on.

recursive search and replace old with new string, inside files
Search and replace recursively. :-) Shorter and simpler than the others. And allows more terms: replace old new [old new ...] -- `find -type f`

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: