Keep it short.
This commit is contained in:
parent
c5a5df67a0
commit
51233cea8d
4 changed files with 16 additions and 17 deletions
|
@ -13,4 +13,4 @@ for i in $(cat ~/.local/share/passwords); do
|
||||||
[ $count -ne 0 ] && export unread=$((unread + count))
|
[ $count -ne 0 ] && export unread=$((unread + count))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[ "$unread" -eq 0 ] && printf "" || printf "^c#ffffff^^b#005577^\uf7aa new mail: ${unread}^d^"
|
[ "$unread" -eq 0 ] && printf "" || printf "^c#ffffff^^b#005577^\uf7aa ${unread} new^d^"
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
|
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
|
||||||
down) printf "^c#ffffff^^b#770000^no wifi^d^" ;;
|
down) printf " ^c#ffffff^^b#770000^ no wifi^d^" ;;
|
||||||
up)
|
up)
|
||||||
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
|
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
|
||||||
&& printf "$(iw dev wlan0 info | grep 'ssid ' | cut -d' ' -f2-)" \
|
&& printf "" || printf " ^c#ffffff^^b#770000^no ip^d^" ;;
|
||||||
|| printf "^c#ffffff^^b#770000^no ip^d^" ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -12,17 +12,17 @@ if [ "${1}" = "micmute" ]; then
|
||||||
esac
|
esac
|
||||||
kill -46 $(pidof dwmblocks)
|
kill -46 $(pidof dwmblocks)
|
||||||
else
|
else
|
||||||
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
|
|
||||||
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
|
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
|
||||||
volmute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}')
|
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
|
||||||
micmute=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
|
micmute=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
|
||||||
if [ "$volmute" = yes ] && [ "$micmute" = yes ]; then
|
volmute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}')
|
||||||
|
if [ "$micmute" = yes ] && [ "$volmute" = yes ]; then
|
||||||
printf "^c#ffffff^^b#770000^\uf131 mute | \ufa80 mute^d^"
|
printf "^c#ffffff^^b#770000^\uf131 mute | \ufa80 mute^d^"
|
||||||
elif [ "$vol" -eq 0 ] && [ "$mic" -eq 0 ]; then
|
elif [ "$mic" -eq 0 ] && [ "$vol" -eq 0 ]; then
|
||||||
printf "^c#ffffff^^b#770000^\uf131 mute | \ufa80 mute^d^"
|
printf "^c#ffffff^^b#770000^\uf131 mute | \ufa80 mute^d^"
|
||||||
else
|
else
|
||||||
|
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micinfo="^c#ffffff^^b#770000^\uf131 mute | ^d^" || micinfo=""
|
||||||
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && volinfo="^c#ffffff^^b#770000^\ufa80 mute^d^" || volinfo="\uf028 ${vol}%%"
|
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && volinfo="^c#ffffff^^b#770000^\ufa80 mute^d^" || volinfo="\uf028 ${vol}%%"
|
||||||
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micinfo="^c#ffffff^^b#770000^\uf131 mute^d^" || micinfo="\uf130 ${mic}%%"
|
printf "${micinfo}${volinfo}"
|
||||||
printf "${micinfo} | ${volinfo}"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -6,7 +6,7 @@ static const Block blocks[] = {
|
||||||
{"", "sb-volume", 0, 12 },
|
{"", "sb-volume", 0, 12 },
|
||||||
{"\uf1eb ", "sb-network", 1, 0 },
|
{"\uf1eb ", "sb-network", 1, 0 },
|
||||||
{"\uf241 ", "sb-battery", 3, 0 },
|
{"\uf241 ", "sb-battery", 3, 0 },
|
||||||
{"\uf073 ", "date '+%F %I:%M:%S %p |'", 1, 0 },
|
{"\uf073 ", "date '+[%e] %I:%M:%S %p |'", 1, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
//sets delimeter between status commands. NULL character ('\0') means no delimeter.
|
//sets delimeter between status commands. NULL character ('\0') means no delimeter.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue