"Improved" some scripts.
This commit is contained in:
parent
12162e6be4
commit
a209ff1dc6
10
misc/bar.sh
10
misc/bar.sh
@ -4,9 +4,9 @@ FXDE_DIR=/home/midfavila/.config/fxde
|
|||||||
|
|
||||||
tme() #Display current time in 24h notation
|
tme() #Display current time in 24h notation
|
||||||
{
|
{
|
||||||
date|cut -f4 -d ' '|\
|
date|sed -ne 's/ */ /gp'|cut -d ' ' -f4|sed -ne 's/\([0-9][0-9]\)"\([0-9][0-9]\).*/\1\2/p'
|
||||||
sed -ne 's/\([0-9][0-9]*\):\([0-9][0-9]*\)/\1\2/p'|cut -d ':' -f 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pwr() #Display current battery capacity and whether we're discharging or not.
|
pwr() #Display current battery capacity and whether we're discharging or not.
|
||||||
{
|
{
|
||||||
x=$(cat /sys/class/power_supply/BAT1/status)
|
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
|
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}" ]
|
if [ "${x}" ]
|
||||||
then printf "%s" "${x}"
|
then printf "%s" "${x}"
|
||||||
else printf "N/A"
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user