dotfiles

my shiny new dotfiles
git clone git://git.jakekoroman.com/dotfiles
Log | Files | Refs | README

brightness (389B)


      1 #!/bin/sh
      2 
      3 fifo=/tmp/xobpipe-brightness
      4 rate="5%"
      5 
      6 if [ ! -e $fifo ]; then
      7     killall xob
      8     mkfifo $fifo
      9     tail -f $fifo | xob &
     10 fi
     11 
     12 if test "$1" = "up"; then
     13     brightnessctl s "$rate+" | egrep -o "[0-9]*%" | sed "s/%//g" > $fifo
     14 elif test "$1" = "down"; then
     15     brightnessctl s "$rate-" | egrep -o "[0-9]*%" | sed "s/%//g" > $fifo
     16 else
     17     echo "Usage: ./brightness [up|down]"
     18 fi