Advertisement
Guest User

Untitled

a guest
May 27th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cur=$(bl1)
  4.  
  5. if [ "$1" = up ]
  6. then
  7. new="$(echo $cur + 1 | bc)"
  8. elif [ "$1" = down ]
  9. then
  10. new="$(echo $cur - 1 | bc)"
  11. else
  12. new="$cur"
  13. fi
  14.  
  15. bl1 "$new"
  16.  
  17. echo "$new"
  18.  
  19. icon=$(python -c "print\
  20. {-1:'off',0:'off',1:'off',2:'off',3:'low',4:'low',5:'low',\
  21. 6:'medium',7:'medium',8:'medium',9:'high',10:'high',11:'high',\
  22. 12:'full',13:'full',14:'full',15:'full'}[$new-1]")
  23.  
  24. pc=$(python -c 'x = max(min(15,'"$new"'),1); print float(x-1)/14 *100')
  25. notify-send "Brightness" -i notification-display-brightness-"$icon" -h int:value:"$pc" -h string:synchronous:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement