aboutsummaryrefslogtreecommitdiff
path: root/bin/brightness-popup.sh
diff options
context:
space:
mode:
authorjakobst1n <jakob.stendahl@outlook.com>2021-09-04 12:22:08 +0200
committerjakobst1n <jakob.stendahl@outlook.com>2021-09-04 12:22:08 +0200
commit80dc0a70c336adaa0ec8fd3e556c09a28fdcfa15 (patch)
treed0b70cf060f52f3b54acd7027701282d00f7960f /bin/brightness-popup.sh
parente6df7072ab32493a561fc678eacc119b57981827 (diff)
downloaddotfiles-80dc0a70c336adaa0ec8fd3e556c09a28fdcfa15.tar.gz
dotfiles-80dc0a70c336adaa0ec8fd3e556c09a28fdcfa15.zip
Add things
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"