Removed scripts/backlight

master
Mark 2022-04-24 10:13:46 -07:00
parent 58d15e1aa6
commit 36041d8011
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
2 changed files with 4 additions and 42 deletions

View File

@ -1,38 +0,0 @@
#!/usr/bin/fish
#
# Usage:
# backlight get
# backlight set [value]
# backlight max
# backlight [up|down] [delta]
#
# 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 $argv[2]
case "down"
xbacklight -dec $argv[2]
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

View File

@ -12,7 +12,7 @@ local P = {
--- ---
function P:_get_status() function P:_get_status()
awful.spawn.easy_async( awful.spawn.easy_async(
script_dir .. "backlight get", "xbacklight -get",
function(stdout, stderr, exitreason, exitcode) function(stdout, stderr, exitreason, exitcode)
self._ready = true self._ready = true
self.brightness = tonumber(stdout) self.brightness = tonumber(stdout)
@ -45,7 +45,7 @@ function P:backlight_up()
return return
end end
awful.spawn(script_dir .. "backlight up 5", false) awful.spawn("xbacklight -inc 5", false)
self.brightness = self.brightness + 5 self.brightness = self.brightness + 5
if self.brightness > self.max_value then if self.brightness > self.max_value then
self.brightness = self.max_value self.brightness = self.max_value
@ -58,7 +58,7 @@ function P:backlight_down()
return return
end end
awful.spawn(script_dir .. "backlight down 5", false) awful.spawn("xbacklight -dec 5", false)
self.brightness = self.brightness - 5 self.brightness = self.brightness - 5
if self.brightness < self.min_value then if self.brightness < self.min_value then
self.brightness = self.min_value self.brightness = self.min_value
@ -79,7 +79,7 @@ function P:backlight_set(value)
value = self.max_value value = self.max_value
end end
awful.spawn(script_dir .. "backlight set " .. value, false) awful.spawn("xbacklight -set " .. value, false)
self.brightness = value self.brightness = value
self:_update_widget() self:_update_widget()
end end