From e0a52c52b0024c20946a4c439e942df46189dbcf Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Mon, 26 Jul 2021 16:52:58 +0200 Subject: [PATCH] More changes to bar look. --- _suckless/_scripts/sb-mail | 4 ++-- _suckless/_scripts/sb-network | 6 +++--- _suckless/_scripts/sb-volume | 4 ++-- _suckless/dwmblocks/blocks.h | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/_suckless/_scripts/sb-mail b/_suckless/_scripts/sb-mail index a739cb1..bd8662c 100755 --- a/_suckless/_scripts/sb-mail +++ b/_suckless/_scripts/sb-mail @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash [ ! -e ~/.local/share/passwords ] && echo "no accounts configured" && exit 1 @@ -13,4 +13,4 @@ for i in $(cat ~/.local/share/passwords); do [ $count -ne 0 ] && export unread=$((unread + count)) fi done -[ "$unread" -eq 0 ] && echo "no new mail" || echo "^c#161616^^b#fd4285^new mail: ${unread}^d^" +[ "$unread" -eq 0 ] && printf "\ue158 no new mail" || printf "^c#161616^^b#fd4285^\ue158 new mail: ${unread}^d^" diff --git a/_suckless/_scripts/sb-network b/_suckless/_scripts/sb-network index 2aee509..0f29a64 100755 --- a/_suckless/_scripts/sb-network +++ b/_suckless/_scripts/sb-network @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash # Show wifi 📶 and percent strength or 📡 if none. # Show 🌐 if connected to ethernet or ❎ if none. # Show 🔒 if a vpn connection is active case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in - down) echo "^c#161616^^b#fd4285^NO WIFI^d^" ;; - up) echo `iw dev wlp3s0 info | awk '/ssid/ {print $2}'` ;; + down) printf "^c#161616^^b#fd4285^\ue63e no wifi^d^" ;; + up) printf "\ue63e $(iw dev wlp3s0 info | awk '/ssid/ {print $2}')" ;; esac diff --git a/_suckless/_scripts/sb-volume b/_suckless/_scripts/sb-volume index 3eb493f..4ea0ee2 100755 --- a/_suckless/_scripts/sb-volume +++ b/_suckless/_scripts/sb-volume @@ -2,7 +2,7 @@ vol="$(pamixer --get-volume)" [ $(echo $vol | wc -c) -lt 4 ] && svol=" ${vol}%%" || svol="${vol}%%" -[ $(pamixer --get-mute) = true ] && volinfo="\ue04f ^c#161616^^b#fd4285^mute^d^" || volinfo="\ue050 ${svol}" +[ $(pamixer --get-mute) = true ] && volinfo="^c#161616^^b#fd4285^\ue04f mute^d^" || volinfo="\ue050 ${svol}" device=$(pamixer --list-sources | awk '/Raven/ {print $1}') -[ $(pamixer --source $device --get-mute) = true ] && micinfo="\ue02b ^c#161616^^b#fd4285^MM^d^" || micinfo="\ue02a on" +[ $(pamixer --source $device --get-mute) = true ] && micinfo="^c#161616^^b#fd4285^\ue02b MM^d^" || micinfo="\ue02a on" printf "${volinfo} (${micinfo})" diff --git a/_suckless/dwmblocks/blocks.h b/_suckless/dwmblocks/blocks.h index eb72344..c835433 100644 --- a/_suckless/dwmblocks/blocks.h +++ b/_suckless/dwmblocks/blocks.h @@ -1,11 +1,11 @@ //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*/ - {" \ue158 ", "sb-mail", 180, 16 }, - {"", "sb-volume", 0, 12 }, - {"\ue63e ", "sb-network", 1, 0 }, - {"", "sb-battery", 3, 0 }, - {"\ue8b5 ", "date '+%F %T '", 1, 0 }, + /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ + {"", "sb-mail", 180, 16 }, + {"", "sb-volume", 0, 12 }, + {"", "sb-network", 1, 0 }, + {"", "sb-battery", 3, 0 }, + {"\ue8b5 ", "date '+%F %I:%M:%S %p'", 1, 0 }, }; //sets delimeter between status commands. NULL character ('\0') means no delimeter.