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 #!/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=$(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)) [ $count -ne 0 ] && export unread=$((unread + count))
if [ $user = 'ftpd@insomniac.pl' ]; then 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) scount=$(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 -ne 0 ] && export unread=$((unread + scount))
fi fi
done 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

@ -13,5 +13,5 @@ if [ "${1}" = "micmute" ]; then
kill -44 $(pidof dwmblocks) kill -44 $(pidof dwmblocks)
else else
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 '%')
[ $(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 fi

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%') 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

@ -4,10 +4,10 @@ static const Block blocks[] = {
{"", "sb-emerge", 1, 0 }, {"", "sb-emerge", 1, 0 },
{"", "sb-mail", 60, 16 }, {"", "sb-mail", 60, 16 },
{"", "sb-vol-in", 0, 10 }, {"", "sb-vol-in", 0, 10 },
{"", "sb-vol-out", 0, 12 }, {"\uf028 ", "sb-vol-out", 0, 12 },
{"^c#ffffff^\uf241 ^d^", "sb-battery", 3, 0 }, {"\uf241 ", "sb-battery", 3, 0 },
{"^c#ffffff^\uf1eb ^d^", "sb-network", 1, 0 }, {"\uf1eb ", "sb-network", 1, 0 },
{"^c#ffffff^\uf073 ^d^", "date '+[%e] %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.