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)
|
discard execCmd(cmd)
|
||||||
|
|
||||||
proc getBrightness*(backlight: string) =
|
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 limit = getLimit(backlight)
|
||||||
let current = parseInt(strip(readFile("/sys/class/backlight/" & backlight & "/actual_brightness")))
|
let current = parseInt(strip(readFile("/sys/class/backlight/" & backlight & "/actual_brightness")))
|
||||||
let pcnt = (current/limit)*100
|
let pcnt = (current/limit)*100
|
||||||
let text = getDesign(pcnt)
|
let text = getDesign(pcnt)
|
||||||
var data = newInfo("Brightnurrs")
|
|
||||||
data.full_text = text
|
data.full_text = text
|
||||||
let args = @["up", "down"]
|
let args = @["up", "down"]
|
||||||
let option = outputData(data,args)
|
let option = outputData(data,args)
|
||||||
|
@ -84,7 +88,6 @@ proc getBrightness*(backlight: string) =
|
||||||
|
|
||||||
proc go*() =
|
proc go*() =
|
||||||
let backlight = getBacklight()
|
let backlight = getBacklight()
|
||||||
if backlight != "":
|
|
||||||
let barg = parseBrightnessArgs()
|
let barg = parseBrightnessArgs()
|
||||||
case barg:
|
case barg:
|
||||||
of BrightUp:
|
of BrightUp:
|
||||||
|
@ -93,5 +96,3 @@ proc go*() =
|
||||||
brightnessDown()
|
brightnessDown()
|
||||||
else:
|
else:
|
||||||
backlight.getBrightness()
|
backlight.getBrightness()
|
||||||
else:
|
|
||||||
echo "No Backlight Found"
|
|
||||||
|
|
Loading…
Reference in a new issue