awesomewm/bin/scripts/backlight

39 lines
644 B
Plaintext
Raw Normal View History

2021-08-01 07:24:26 -07:00
#!/usr/bin/fish
#
# Usage:
# backlight get
# backlight set [value]
# backlight max
2022-04-24 09:10:12 -07:00
# backlight [up|down] [delta]
2021-08-01 07:24:26 -07:00
#
# Returns:
# Set - nothing
# Get, max - Number between 0 and 100 (eg: 0, 25.445283, 100)
#
function backlight
switch $argv[1]
case "get"
xbacklight -get
case "max"
echo 100
case "set"
xbacklight -set $argv[2]
case "up"
2022-04-24 09:10:12 -07:00
xbacklight -inc $argv[2]
2021-08-01 07:24:26 -07:00
case "down"
2022-04-24 09:10:12 -07:00
xbacklight -dec $argv[2]
2021-08-01 07:24:26 -07:00
case "*"
echo "Unknown function \"$argv[1]\""
echo ""
echo "Usage:"
echo " backlight get"
echo " backlight set [value]"
echo " backlight max"
return 0
end
return 1
end
backlight $argv