aboutsummaryrefslogtreecommitdiff
path: root/bin/brightness-popup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/brightness-popup.sh')
-rwxr-xr-xbin/brightness-popup.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/brightness-popup.sh b/bin/brightness-popup.sh
new file mode 100755
index 0000000..3c3ad98
--- /dev/null
+++ b/bin/brightness-popup.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [ "$1" == "inc" ]; then
+ brightnessctl s +5%
+fi
+
+if [ "$1" == "dec" ]; then
+ brightnessctl s 5%-
+fi
+
+BRIGHTNESS=$(brightnessctl g)
+BRIGHTNESSMAX=$(brightnessctl m)
+let fullb=BRIGHTNESS*100
+let brightnessperc=fullb/BRIGHTNESSMAX
+BRIGHTNESS=${brightnessperc%.*}
+#NOTI_ID=$(notify-send.py "Brightness" "$BRIGHTNESS/100" \
+# --hint string:image-path:video-display boolean:transient:true \
+# int:has-percentage:$BRIGHTNESS \
+# --replaces-process "brightness-popup")
+notify-send.py "Brightness" "$BRIGHTNESS%" --hint boolean:transient:true int:value:$BRIGHTNESS --replaces-process "brightness-popup"