2021-08-01 07:24:26 -07:00
|
|
|
#!/usr/bin/fish
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# backlight get
|
|
|
|
# backlight set [value]
|
|
|
|
# backlight max
|
|
|
|
#
|
|
|
|
# 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-11-05 11:31:12 -07:00
|
|
|
xbacklight -inc $argv[2]
|
2021-08-01 07:24:26 -07:00
|
|
|
case "down"
|
2022-11-05 11:31: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
|