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