summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/statusbar')
-rwxr-xr-x.local/bin/statusbar/sb-doppler2
-rwxr-xr-x.local/bin/statusbar/sb-kbselect1
-rwxr-xr-x.local/bin/statusbar/sb-music2
-rwxr-xr-x.local/bin/statusbar/sb-volume11
4 files changed, 9 insertions, 7 deletions
diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler
index 7573c98..f58b744 100755
--- a/.local/bin/statusbar/sb-doppler
+++ b/.local/bin/statusbar/sb-doppler
@@ -184,7 +184,7 @@ US: KVNX: Norman, OK
US: KVBX: Vandenberg Afb: Orcutt, CA
EU: Europe
EU: GB: Great Brittain
-EU: SCAN: Scandinavia
+EU: SCAN: Scandinavia. Norway, Sweden And Denmark
EU: ALPS: The Alps
EU: NL: The Netherlands
EU: DE: Germany
diff --git a/.local/bin/statusbar/sb-kbselect b/.local/bin/statusbar/sb-kbselect
index f0c923f..ab2140c 100755
--- a/.local/bin/statusbar/sb-kbselect
+++ b/.local/bin/statusbar/sb-kbselect
@@ -5,6 +5,7 @@ kb="$(setxkbmap -query | grep -oP 'layout:\s*\K\w+')" || exit 1
case $BLOCK_BUTTON in
1) kb_choice="$(awk '/! layout/{flag=1; next} /! variant/{flag=0} flag {print $2, "- " $1}' /usr/share/X11/xkb/rules/base.lst | dmenu -l 15)"
+ [ -z "$kb_choice" ] && exit 0
kb="$(echo "$kb_choice" | awk '{print $3}')"
setxkbmap "$kb"
pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";;
diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music
index 7ea7032..d164b4b 100755
--- a/.local/bin/statusbar/sb-music
+++ b/.local/bin/statusbar/sb-music
@@ -1,6 +1,6 @@
#!/bin/sh
-filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;}
+filter() { sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;}
pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume
index d17ce66..acdf7a9 100755
--- a/.local/bin/statusbar/sb-volume
+++ b/.local/bin/statusbar/sb-volume
@@ -4,9 +4,9 @@
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e pulsemixer ;;
- 2) pamixer -t ;;
- 4) pamixer --allow-boost -i 1 ;;
- 5) pamixer --allow-boost -d 1 ;;
+ 2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
+ 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
+ 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute.
- Scroll to change." ;;
@@ -19,14 +19,15 @@ vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
[ "$vol" != "${vol%\[MUTED\]}" ] && echo 🔇 && exit
vol="${vol#Volume: }"
+
split() {
# For ommiting the . without calling and external program.
IFS=$2
set -- $1
printf '%s' "$@"
}
-vol="$(split "$vol" ".")"
-vol="${vol##0}"
+
+vol="$(printf "%.0f" "$(split "$vol" ".")")"
case 1 in
$((vol >= 70)) ) icon="🔊" ;;