Add backlight control
This commit is contained in:
parent
e6b9803dd8
commit
f007ef2bc8
2 changed files with 19 additions and 3 deletions
|
@ -94,10 +94,11 @@
|
||||||
(label :text ""))
|
(label :text ""))
|
||||||
|
|
||||||
|
|
||||||
;(deflisten brightness :initial "--" "~/.config/eww/scripts/get-brightness")
|
; TODO: Make listener
|
||||||
|
(defpoll brightness :initial "50" :interval 60 "~/.config/eww/scripts/backlight get")
|
||||||
(defwidget brightness []
|
(defwidget brightness []
|
||||||
(eventbox :onscroll "~/.config/eww/scripts/adjust-brightness {}" :cursor "row-resize"
|
(eventbox :onscroll "~/.config/eww/scripts/backlight {}" :cursor "row-resize"
|
||||||
(label_value :text "" :value "50%")))
|
(label_value :text "" :value "${brightness}%")))
|
||||||
|
|
||||||
|
|
||||||
(defwidget battery []
|
(defwidget battery []
|
||||||
|
|
15
eww/scripts/backlight
Executable file
15
eww/scripts/backlight
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/env sh
|
||||||
|
|
||||||
|
DELTA="5%"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
up) brightnessctl -m -c backlight set +"$DELTA"
|
||||||
|
;;
|
||||||
|
down) brightnessctl -m -c backlight set "$DELTA"-
|
||||||
|
;;
|
||||||
|
get) brightnessctl -m -c backlight get
|
||||||
|
;;
|
||||||
|
*) echo "Unrecognized command"; exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue