diff --git a/.config/x11/xprofile b/.config/x11/xprofile index 349495e..1d51583 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -13,7 +13,7 @@ numlockx nextcloud --background & -nitrogen --restore +"$HOME/.fehbg" # set default desktop window layout "$HOME/.screenlayout/default.sh" diff --git a/.local/bin/status-mem b/.local/bin/status-mem index 29f06f3..53e434b 100755 --- a/.local/bin/status-mem +++ b/.local/bin/status-mem @@ -9,5 +9,5 @@ case $BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -free --mebi | sed -n '2{p;q}' | awk '{printf (" %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' +free --mebi | sed -n '2{p;q}' | awk '{printf (" %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' diff --git a/.local/bin/status-net b/.local/bin/status-net index 6797ca3..41c757c 100755 --- a/.local/bin/status-net +++ b/.local/bin/status-net @@ -6,23 +6,30 @@ case $BUTTON in 1) "$TERMINAL" -e nmtui; pkill -RTMIN+15 dwmblocks ;; - 3) notify-send "Internet module" "Shows network status -- Click to connect -❌: wifi disabled + 3) notify-send "Internet module" "- Click to connect +󰯡 : wifi disabled 󰖪 : no wifi connection  : wifi connection with quality -❎: no ethernet - : ethernet working -🔒: vpn is active +󰅛 : no ethernet +󰱓 : ethernet working + : vpn is active " ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then - ssid="$(iw dev $(cat /proc/net/wireless | grep '^.*:' | sed 's/:.*//') link | grep -i SSID)" - wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "%" }' /proc/net/wireless) ${ssid##*SSID: } " -elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then - grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="󰖪 " || wifiicon="❌ " + +# Wifi +if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then + wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)" +elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then + [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="󰖩 " || wifiicon="󰖪 " fi -printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)" +# Ethernet +[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="󰪎" + +# TUN +[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" " + +printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon" + diff --git a/.local/bin/status-packages b/.local/bin/status-packages index c238ac3..8dc2b42 100755 --- a/.local/bin/status-packages +++ b/.local/bin/status-packages @@ -9,4 +9,4 @@ case $BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g" +pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/󰏔 /;s/^󰏔 0$//g" diff --git a/.local/bin/status-vol b/.local/bin/status-vol index 96e0e62..7a67332 100755 --- a/.local/bin/status-vol +++ b/.local/bin/status-vol @@ -16,8 +16,8 @@ esac vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" -# If muted, print 🔇 and exit. -[ "$vol" != "${vol%\[MUTED\]}" ] && echo " " && exit +# If muted, print  and exit. +[ "$vol" != "${vol%\[MUTED\]}" ] && echo " " && exit vol="${vol#Volume: }" @@ -32,10 +32,10 @@ vol="$(split "$vol" ".")" vol="${vol##0}" case 1 in - $((vol >= 70)) ) icon="" ;; -$((vol >= 30)) ) icon="" ;; -$((vol >= 1)) ) icon="" ;; -* ) echo " " && exit ;; + $((10#$vol >= 70)) ) icon=" " ;; + $((10#$vol >= 30)) ) icon=" " ;; + $((10#$vol >= 1)) ) icon=" " ;; + * ) echo " " && exit ;; esac echo "$icon $vol%"