diff --git a/_desktop/_scripts/sb-network b/_desktop/_scripts/sb-network deleted file mode 100755 index 1cdd0b3..0000000 --- a/_desktop/_scripts/sb-network +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in - down) printf "no wifi" ;; - up) [ -n "$(ip address show dev wlan0 | grep 'inet ')" ] || printf "no ip" ;; -esac diff --git a/_desktop/_scripts/sb-volume b/_desktop/_scripts/sb-volume new file mode 100755 index 0000000..0896bb9 --- /dev/null +++ b/_desktop/_scripts/sb-volume @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ $1 ]; then + case $1 in + inc) pactl set-sink-volume @DEFAULT_SINK@ +5%;; + dec) pactl set-sink-volume @DEFAULT_SINK@ -5%;; + esac + volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}') + notify-send -t 2000 -u low "volume: $volume" +else + mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%') + [ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micmute="\uf131" || micmute="" + vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%') + [ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && printf "${micmute} \ufc5d" || printf "$micmute" +fi