Compare commits
2 Commits
c4175535b2
...
4a409ef44f
| Author | SHA1 | Date | |
|---|---|---|---|
|
4a409ef44f
|
|||
|
5e40304e58
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
output=$(wpctl get-volume @DEFAULT_SINK@ | cut -d' ' -f2- | sed -E 's/\.//g' | sed 's/^0*//g')
|
||||
count=$(echo "$output" | cut -d' ' -f1)
|
||||
count=$(echo "$output" | awk -F, '{print $1+0}')
|
||||
muted=$(echo "$output" | cut -d'[' -f2 | cut -d ']' -f1)
|
||||
|
||||
# if not muted, set to empty string
|
||||
@@ -8,11 +8,6 @@ if [ "$muted" == "$count" ]; then
|
||||
muted=""
|
||||
fi
|
||||
|
||||
# fix removal of zero padding if volume is zero
|
||||
if [ "$count" == "" ]; then
|
||||
count="0"
|
||||
fi
|
||||
|
||||
color="green"
|
||||
if ((count > 75)); then color="yellow"; fi
|
||||
if ((count > 90)); then color="peach"; fi
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
:text "${bluetooth-name} ")))
|
||||
|
||||
; `FNR == 1 + head -c 30` so the name doesn't explode the screen
|
||||
(defpoll bluetooth-name :interval "10s" `bluetoothctl devices Connected | awk 'FNR == 1 {print $3}' | head -c 30`)
|
||||
(defpoll bluetooth-name :interval "10s" `bluetoothctl devices Connected | awk 'FNR == 1 {print substr($0,1,30)}'`)
|
||||
|
||||
(defwidget time []
|
||||
(box
|
||||
|
||||
Reference in New Issue
Block a user