Compare commits

...

2 Commits

2 changed files with 2 additions and 3 deletions

View File

@ -9,7 +9,7 @@ LOG_FILE_PATH = "/tmp/battery_status.log"
def get_acpi():
""" get acpi data as a sting """
acpi_raw = subprocess.run(["acpi"], capture_output=True, check=False)
acpi_string = acpi_raw.stdout.decode().strip()
acpi_string = acpi_raw.stdout.decode().strip().split('\n')[0]
return acpi_string

View File

@ -11,9 +11,8 @@ fi
# when connected
if [[ $(ip a | grep "state" | grep -Ev 'tun|lo' | grep "UP ") ]]; then
printmain=$(ip -br addr show | grep -v 'lo' \
| awk '{print $3}' | awk -F '/' {'print $1}' | tr '\n' ' ')
printsmall=$(ip -br addr show | grep -v 'lo' \
| awk '{print $3}' | awk -F '/' {'print $1}' | head -n 1)
printsmall=""
printcolor="#00FF00"
fi