Slightly improve the portability of winlist.sh

This commit is contained in:
Mid Favila 2021-07-05 23:18:19 -03:00
parent d28689133d
commit 259f566577
2 changed files with 3 additions and 3 deletions

View File

@ -11,8 +11,8 @@ pwr() #Display current battery capacity and whether we're discharging or not.
{
x=$(cat /sys/class/power_supply/BAT1/status)
if [ "${x}" = "Discharging" ]
then printf "--%s%%" "$(cat /sys/class/power_supply/BAT1/capacity)"
else printf "++%s%%" "$(cat /sys/class/power_supply/BAT1/capacity)"
then printf "%s%%--" "$(cat /sys/class/power_supply/BAT1/capacity)"
else printf "%s%%++" "$(cat /sys/class/power_supply/BAT1/capacity)"
fi
}

View File

@ -14,7 +14,7 @@ getname()
{
if [ ${x} -gt 0 ]
then
sed ${x}!d /tmp/winlist.jnk|sed "s/commandante/ /g"|cut -d ' ' -f 3
sed ${x}!d /tmp/winlist.jnk|sed "s/commandante/ /g"|sed 's/ */ /g'|cut -d '\t' -f 3
else
exit
fi