From 899f1c9987cc1e59f1e42e6602f5a9f5c1e51261 Mon Sep 17 00:00:00 2001 From: G2-Games Date: Fri, 2 Sep 2022 17:05:29 -0500 Subject: [PATCH] Updated issues with the battery display on devices without a battery --- welcome.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) mode change 100644 => 100755 welcome.sh diff --git a/welcome.sh b/welcome.sh old mode 100644 new mode 100755 index fdda933..b23ee26 --- a/welcome.sh +++ b/welcome.sh @@ -49,6 +49,9 @@ greeting () { #=====Battery Info=====# battery () { # Set battery level + # Set default to prevent errors + batlvl=0 + if [ -a /sys/class/power_supply/BAT0/capacity ]; then batlvl=$(cat /sys/class/power_supply/BAT0/capacity) @@ -125,7 +128,7 @@ updates () { fi # Check for Flatpak - if command -v flatpak &> /dev/null && [ $flatupd == "on" ]; + if command -v flatpak &> /dev/null && [ $flatpakupd == "on" ]; then flatpak=$(flatpak remote-ls --updates 2> /dev/null | wc -l) fi @@ -147,8 +150,11 @@ updates () { } #=========SETUP========# -# Select which parts you want active by commenting them out, and re ordering them. -flatupd="on" # Check for flatpak updates, this slows the script down a lot +# Select which parts you want active by commenting them out +# You can also re order them to change how they display! +# For example, on a desktop, disabling the battery message is a good idea + +flatpakupd="on" # Check for flatpak updates, this slows startup down *a lot* welcome greeting