Removed scripts/backlight
parent
58d15e1aa6
commit
36041d8011
|
@ -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
|
|
@ -12,7 +12,7 @@ local P = {
|
|||
---
|
||||
function P:_get_status()
|
||||
awful.spawn.easy_async(
|
||||
script_dir .. "backlight get",
|
||||
"xbacklight -get",
|
||||
function(stdout, stderr, exitreason, exitcode)
|
||||
self._ready = true
|
||||
self.brightness = tonumber(stdout)
|
||||
|
@ -45,7 +45,7 @@ function P:backlight_up()
|
|||
return
|
||||
end
|
||||
|
||||
awful.spawn(script_dir .. "backlight up 5", false)
|
||||
awful.spawn("xbacklight -inc 5", false)
|
||||
self.brightness = self.brightness + 5
|
||||
if self.brightness > self.max_value then
|
||||
self.brightness = self.max_value
|
||||
|
@ -58,7 +58,7 @@ function P:backlight_down()
|
|||
return
|
||||
end
|
||||
|
||||
awful.spawn(script_dir .. "backlight down 5", false)
|
||||
awful.spawn("xbacklight -dec 5", false)
|
||||
self.brightness = self.brightness - 5
|
||||
if self.brightness < self.min_value then
|
||||
self.brightness = self.min_value
|
||||
|
@ -79,7 +79,7 @@ function P:backlight_set(value)
|
|||
value = self.max_value
|
||||
end
|
||||
|
||||
awful.spawn(script_dir .. "backlight set " .. value, false)
|
||||
awful.spawn("xbacklight -set " .. value, false)
|
||||
self.brightness = value
|
||||
self:_update_widget()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue