More tweaking with statusbar.

This commit is contained in:
Bartek Stalewski 2022-04-15 20:17:46 +02:00
parent 4ff14f25fd
commit c72f3c4a1c
6 changed files with 16 additions and 15 deletions

View File

@ -1,3 +1,3 @@
#!/bin/bash
[ $(pgrep -x emerge) ] && printf "^c#ffffff^\ue20f ^c#ffffff^^b#9a37ff^emerge^d^" || printf ""
[ $(pgrep -x emerge) ] && printf "\ue20f ^c#ffffff^^b#9a37ff^emerge^d^" || printf ""

View File

@ -9,8 +9,9 @@ for i in $(cat ~/.local/share/passwords); do
count=$(curl -s --user "${user}:${pass}" https://mail.google.com/mail/feed/atom/ | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
[ $count -ne 0 ] && export unread=$((unread + count))
if [ $user = 'ftpd@insomniac.pl' ]; then
count=$(curl -s --user "${user}:${pass}" https://mail.google.com/mail/feed/atom/sites | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
[ $count -ne 0 ] && export unread=$((unread + count))
scount=$(curl -s --user "${user}:${pass}" https://mail.google.com/mail/feed/atom/sites | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
[ $scount -ne 0 ] && export unread=$((unread + scount))
fi
done
[ "$unread" -eq 0 ] && printf "" || printf "^c#ffffff^^b#005577^\uf7aa new mail: ${unread}^d^"
[ "$unread" -ne 0 ] && printf "\uf7aa ^c#ffffff^^b#005577^new mail: ${unread}^d^"

View File

@ -1,7 +1,7 @@
#!/bin/bash
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)
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
&& printf "$(iw dev wlan0 info | grep 'ssid ' | cut -d' ' -f2-)" \

View File

@ -13,5 +13,5 @@ if [ "${1}" = "micmute" ]; then
kill -44 $(pidof dwmblocks)
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 ] && printf "^c#ffffff^\uf131 ^c#ffffff^^b#770000^mute^d^"
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && printf "\uf131 ^c#ffffff^^b#770000^mute^d^"
fi

View File

@ -1,4 +1,4 @@
#!/bin/bash
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 "^c#ffffff^\ufa80 ^c#ffffff^^b#770000^mute^d^" || printf "^c#ffffff^\uf028 ^d^${vol}%%"
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && printf "^c#ffffff^^b#770000^mute^d^" || printf "${vol}%%"

View File

@ -1,13 +1,13 @@
//Modify this file to change what commands output to your statusbar, and recompile using the make command.
static const Block blocks[] = {
/*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
{"", "sb-emerge", 1, 0 },
{"", "sb-mail", 60, 16 },
{"", "sb-vol-in", 0, 10 },
{"", "sb-vol-out", 0, 12 },
{"^c#ffffff^\uf241 ^d^", "sb-battery", 3, 0 },
{"^c#ffffff^\uf1eb ^d^", "sb-network", 1, 0 },
{"^c#ffffff^\uf073 ^d^", "date '+[%e] %I:%M:%S %p |'", 1, 0 },
/*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
{"", "sb-emerge", 1, 0 },
{"", "sb-mail", 60, 16 },
{"", "sb-vol-in", 0, 10 },
{"\uf028 ", "sb-vol-out", 0, 12 },
{"\uf241 ", "sb-battery", 3, 0 },
{"\uf1eb ", "sb-network", 1, 0 },
{"\uf073 ", "date '+[%e] %I:%M:%S %p |'", 1, 0 },
};
//sets delimeter between status commands. NULL character ('\0') means no delimeter.