Added backlight module

This commit is contained in:
2022-07-16 16:06:02 -07:00
parent 8e8c4840da
commit 3014105bbf
12 changed files with 178 additions and 180 deletions

View File

@ -17,36 +17,6 @@ return {
end
},
backlight = {
watch = function(timeout, callback, widget)
awful.widget.watch(script_dir .. "backlight get", timeout, callback, widget)
end,
get = function(callback)
awful.spawn.easy_async(script_dir .. "backlight get", callback)
end,
set = function(value)
awful.spawn(script_dir .. "backlight set " .. value, false)
end,
up = function()
awful.spawn(script_dir .. "backlight up", false)
end,
down = function()
awful.spawn(script_dir .. "backlight down", false)
end,
redshift = function(temp)
awful.spawn("redshift -O " .. tostring(temp), false)
end,
redshift_reset = function()
awful.spawn("redshift -x", false)
end,
},
battery = {
watch = function(timeout, callback, widget)
awful.widget.watch(script_dir .. "battery", timeout, callback, widget)

View File

@ -1,37 +0,0 @@
#!/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"
xbacklight -inc 10
case "down"
xbacklight -dec 10
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