diff --git a/bin/scripts/backlight b/bin/scripts/backlight deleted file mode 100755 index 0ed897f..0000000 --- a/bin/scripts/backlight +++ /dev/null @@ -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 diff --git a/classes/backlight/backlight.lua b/classes/backlight/backlight.lua index 5467515..c14cb2b 100644 --- a/classes/backlight/backlight.lua +++ b/classes/backlight/backlight.lua @@ -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