"Improved" some scripts.

This commit is contained in:
Mid Favila 2021-07-06 00:17:38 -03:00
parent 12162e6be4
commit a209ff1dc6
1 changed files with 5 additions and 5 deletions

View File

@ -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