Updated issues with the battery display on devices without a battery

This commit is contained in:
G2-Games 2022-09-02 17:05:29 -05:00
parent b50faa68d9
commit 899f1c9987

12
welcome.sh Normal file → Executable file
View file

@ -49,6 +49,9 @@ greeting () {
#=====Battery Info=====# #=====Battery Info=====#
battery () { battery () {
# Set battery level # Set battery level
# Set default to prevent errors
batlvl=0
if [ -a /sys/class/power_supply/BAT0/capacity ]; if [ -a /sys/class/power_supply/BAT0/capacity ];
then then
batlvl=$(cat /sys/class/power_supply/BAT0/capacity) batlvl=$(cat /sys/class/power_supply/BAT0/capacity)
@ -125,7 +128,7 @@ updates () {
fi fi
# Check for Flatpak # Check for Flatpak
if command -v flatpak &> /dev/null && [ $flatupd == "on" ]; if command -v flatpak &> /dev/null && [ $flatpakupd == "on" ];
then then
flatpak=$(flatpak remote-ls --updates 2> /dev/null | wc -l) flatpak=$(flatpak remote-ls --updates 2> /dev/null | wc -l)
fi fi
@ -147,8 +150,11 @@ updates () {
} }
#=========SETUP========# #=========SETUP========#
# Select which parts you want active by commenting them out, and re ordering them. # Select which parts you want active by commenting them out
flatupd="on" # Check for flatpak updates, this slows the script down a lot # 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 welcome
greeting greeting