From 3fb60852de6d6d9011afdf65b247690ae54dfa5b Mon Sep 17 00:00:00 2001 From: Alaa Eddine <138128843+ArgusGuardian@users.noreply.github.com> Date: Fri, 3 May 2024 12:23:53 +0100 Subject: [PATCH] Create sb-bghitness, show brightness in the bar. script to add brightness to the dwmblocks. --- .local/bin/statusbar/sb-bghitness | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .local/bin/statusbar/sb-bghitness diff --git a/.local/bin/statusbar/sb-bghitness b/.local/bin/statusbar/sb-bghitness new file mode 100644 index 00000000..afccf3e2 --- /dev/null +++ b/.local/bin/statusbar/sb-bghitness @@ -0,0 +1,13 @@ +#!/bin/sh + +# show the current brightness level. + +case $BLOCK_BUTTON in + 1) setsid -w -f "$TERMINAL" -e brightnessctl; pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" ;; + 3) notify-send "💡 Brightness module" "\- Shows brightness level ☀️." ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; +esact + +brightness=$(brightnessctl -m | grep -m 1 "backlight" | cut -d "," -f 4) + +echo "💡 $brightness"