refactor: refactored battery bash scripts into a C++ daemon

This commit is contained in:
devaine 2025-07-29 15:05:52 -05:00
commit 16690836d6
Signed by untrusted user who does not match committer: devaine
GPG key ID: 954B1DCAC6FF84EE
10 changed files with 215 additions and 2 deletions

15
notifs/info Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
# Enter scripts directory
cd ~/.scripts/notifs || exit
# Constants
CURRENT_VOL=$(./volume keybind | grep -o '^[^ ]*')
CURRENT_MIC_VOL=$(./volume keybind | awk '{ print $2 }')
BRIGHTNESS=$(./brightness keybind)
# Variables for display, basically multiplies floats to integers
DISPLAY_VOL=$(awk '{ print $1 * $2 }' <<<"${CURRENT_VOL} 100")
DISPLAY_MIC_VOL=$(awk '{ print $1 * $2 }' <<<"${CURRENT_MIC_VOL} 100")
dunstify "All other info:" "Brightness: $BRIGHTNESS%\nCurrent Volume: $DISPLAY_VOL%\nCurrent Mic. Volume: $DISPLAY_MIC_VOL%"