From a209ff1dc6d996c20c13b998f847167cf8523947 Mon Sep 17 00:00:00 2001 From: Mid Favila Date: Tue, 6 Jul 2021 00:17:38 -0300 Subject: [PATCH] "Improved" some scripts. --- misc/bar.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/bar.sh b/misc/bar.sh index 900dc87..851df6a 100755 --- a/misc/bar.sh +++ b/misc/bar.sh @@ -4,9 +4,9 @@ FXDE_DIR=/home/midfavila/.config/fxde tme() #Display current time in 24h notation { - date|cut -f4 -d ' '|\ - sed -ne 's/\([0-9][0-9]*\):\([0-9][0-9]*\)/\1\2/p'|cut -d ':' -f 1 + date|sed -ne 's/ */ /gp'|cut -d ' ' -f4|sed -ne 's/\([0-9][0-9]\)"\([0-9][0-9]\).*/\1\2/p' } + pwr() #Display current battery capacity and whether we're discharging or not. { x=$(cat /sys/class/power_supply/BAT1/status) @@ -16,9 +16,9 @@ pwr() #Display current battery capacity and whether we're discharging or not. fi } -wlip() #Acquire the IP of our current WLAN connection +ip() #Acquire the IP of our current connection. This is awful. I'm so sorry. { - x=$(ifconfig eno1|sed -ne 's/.*addr:\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*/\1/p') + x=$(ifconfig wlp2s0|sed -ne 's/.*addr:\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*/\1/p') if [ "${x}" ] then printf "%s" "${x}" else printf "N/A" @@ -42,4 +42,4 @@ tmp() #Acquire ambient temperature from wttr.in every ival seconds } -while true;do printf "%%{l}[ %s | %s | %s | %s ]\n" "$(tme)" "$(pwr)" "$(wlip)" "$(tmp)";sleep 1;done +while true;do printf "%%{l}[ %s | %s | %s | %s ]\n" "$(tme)" "$(pwr)" "$(ip)" "$(tmp)";sleep 1;done