Add community scripts for i3blocks
This commit is contained in:
26
.local/bin/i3scripts/contrib/brightness
Executable file
26
.local/bin/i3scripts/contrib/brightness
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
################################
|
||||
# Shows current brightness
|
||||
#
|
||||
# dependencies:
|
||||
# - xbacklight
|
||||
#
|
||||
# @return {Number}: Current brightness
|
||||
################################
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
# right click
|
||||
# set to `20
|
||||
3) xbacklight -set 20 ;;
|
||||
|
||||
# scroll up
|
||||
# raise brightness
|
||||
4) xbacklight -inc 10 ;;
|
||||
|
||||
# scroll down
|
||||
# lower brightness
|
||||
5) xbacklight -dec 10 ;;
|
||||
esac
|
||||
|
||||
printf "%.0f" "$(xbacklight -get)"
|
||||
Reference in New Issue
Block a user