Improved backlight management

master
Mark 2022-04-25 11:29:08 -07:00
parent 31860921fa
commit 40c26c2d7e
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 2 additions and 2 deletions

View File

@ -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