added brightnurrs - needs testing on laptop
This commit is contained in:
parent
528cbb6200
commit
8010714091
1 changed files with 13 additions and 12 deletions
|
@ -57,11 +57,15 @@ proc brightnessDown() =
|
|||
discard execCmd(cmd)
|
||||
|
||||
proc getBrightness*(backlight: string) =
|
||||
var data = newInfo("Brightnurrs")
|
||||
if backlight == "":
|
||||
data.full_text = "No Backlight Found"
|
||||
discard outputData(data)
|
||||
quit(1)
|
||||
let limit = getLimit(backlight)
|
||||
let current = parseInt(strip(readFile("/sys/class/backlight/" & backlight & "/actual_brightness")))
|
||||
let pcnt = (current/limit)*100
|
||||
let text = getDesign(pcnt)
|
||||
var data = newInfo("Brightnurrs")
|
||||
data.full_text = text
|
||||
let args = @["up", "down"]
|
||||
let option = outputData(data,args)
|
||||
|
@ -84,14 +88,11 @@ proc getBrightness*(backlight: string) =
|
|||
|
||||
proc go*() =
|
||||
let backlight = getBacklight()
|
||||
if backlight != "":
|
||||
let barg = parseBrightnessArgs()
|
||||
case barg:
|
||||
of BrightUp:
|
||||
brightnessUp()
|
||||
of BrightDown:
|
||||
brightnessDown()
|
||||
else:
|
||||
backlight.getBrightness()
|
||||
else:
|
||||
echo "No Backlight Found"
|
||||
let barg = parseBrightnessArgs()
|
||||
case barg:
|
||||
of BrightUp:
|
||||
brightnessUp()
|
||||
of BrightDown:
|
||||
brightnessDown()
|
||||
else:
|
||||
backlight.getBrightness()
|
||||
|
|
Loading…
Reference in a new issue