Improved backlight management
parent
31860921fa
commit
40c26c2d7e
|
@ -45,11 +45,11 @@ function P:backlight_up()
|
|||
return
|
||||
end
|
||||
|
||||
awful.spawn("xbacklight -inc 5", false)
|
||||
self.brightness = self.brightness + 5
|
||||
if self.brightness > self.max_value then
|
||||
self.brightness = self.max_value
|
||||
end
|
||||
self:backlight_set(self.brightness)
|
||||
self:_update_widget()
|
||||
end
|
||||
|
||||
|
@ -58,11 +58,11 @@ function P:backlight_down()
|
|||
return
|
||||
end
|
||||
|
||||
awful.spawn("xbacklight -dec 5", false)
|
||||
self.brightness = self.brightness - 5
|
||||
if self.brightness < self.min_value then
|
||||
self.brightness = self.min_value
|
||||
end
|
||||
self:backlight_set(self.brightness)
|
||||
self:_update_widget()
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue