diff options
author | awy <awy@awy.one> | 2025-10-02 19:58:28 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-10-02 19:58:28 +0300 |
commit | 3ff7bd1e8efaceee057a2b754e62962094422bc8 (patch) | |
tree | b6d20bc5136a1325f4a159c4ac52502997f9e98f /.local/bin/sb-scripts/sb-mouse | |
parent | ea33d31de523ca7752d4cf915c08d4599771362e (diff) | |
download | hyprdots-3ff7bd1e8efaceee057a2b754e62962094422bc8.tar.gz |
update
Diffstat (limited to '.local/bin/sb-scripts/sb-mouse')
-rwxr-xr-x | .local/bin/sb-scripts/sb-mouse | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/.local/bin/sb-scripts/sb-mouse b/.local/bin/sb-scripts/sb-mouse new file mode 100755 index 0000000..db458d0 --- /dev/null +++ b/.local/bin/sb-scripts/sb-mouse @@ -0,0 +1,26 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) setsid -f solaar >/dev/null 2>&1 ;; + 3) notify-send "🖱️ Mouse module" "\- Shows mouse battery percentage +- Shows ⚡ if charging +- Click to open Solaar +- Middle click to update battery status + " ;; + 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;; +esac + +percentage=$(solaar show 2>/dev/null \ + | awk '/Battery:/ { + percent=$2; status=$3; + gsub(",", "", percent); + gsub("\\.", "", status); + if (status == 1) { + print "🖱️⚡" percent; + } else { + print "🖱️" percent; + } + exit + }') + +echo "$percentage" |