mirror of
https://github.com/G2-Games/welcome.sh.git
synced 2025-04-19 13:32:53 -05:00
More fixes
This commit is contained in:
parent
899f1c9987
commit
32de572372
1 changed files with 18 additions and 12 deletions
30
welcome.sh
30
welcome.sh
|
@ -13,10 +13,10 @@ UNDR='\e[4m'
|
||||||
BLNK='\e[5m'
|
BLNK='\e[5m'
|
||||||
USRC='\e[1;32m'
|
USRC='\e[1;32m'
|
||||||
|
|
||||||
NIGH='\e[35;1m'
|
NIGH='\e[0;35m'
|
||||||
MORN='\e[33m'
|
MORN='\e[0;33m'
|
||||||
AFTN='\e[33;1m'
|
AFTN='\e[0;93m'
|
||||||
EVEN='\e[31;1m'
|
EVEN='\e[0;91m'
|
||||||
|
|
||||||
#========Welcome=======#
|
#========Welcome=======#
|
||||||
welcome () {
|
welcome () {
|
||||||
|
@ -28,6 +28,7 @@ welcome () {
|
||||||
greeting () {
|
greeting () {
|
||||||
# Set the hour
|
# Set the hour
|
||||||
hr=$(date +%H)
|
hr=$(date +%H)
|
||||||
|
hr=22
|
||||||
|
|
||||||
if [ $hr -le 11 ] && [ $hr -gt 6 ];
|
if [ $hr -le 11 ] && [ $hr -gt 6 ];
|
||||||
then
|
then
|
||||||
|
@ -49,7 +50,7 @@ greeting () {
|
||||||
#=====Battery Info=====#
|
#=====Battery Info=====#
|
||||||
battery () {
|
battery () {
|
||||||
# Set battery level
|
# Set battery level
|
||||||
# Set default to prevent errors
|
# Set a default to prevent errors
|
||||||
batlvl=0
|
batlvl=0
|
||||||
|
|
||||||
if [ -a /sys/class/power_supply/BAT0/capacity ];
|
if [ -a /sys/class/power_supply/BAT0/capacity ];
|
||||||
|
@ -69,7 +70,10 @@ battery () {
|
||||||
if [ $batlvl -le 15 ];
|
if [ $batlvl -le 15 ];
|
||||||
then
|
then
|
||||||
echo -en "${CRIT}$batlvl%${NCOL}. "
|
echo -en "${CRIT}$batlvl%${NCOL}. "
|
||||||
echo -en "- ${NORM}You should probably recharge${NCOL}. "
|
if [ $rechargenotif == "on" ];
|
||||||
|
then
|
||||||
|
echo -en "- ${NORM}You should probably recharge${NCOL}. "
|
||||||
|
fi
|
||||||
elif [ $batlvl -le 30 ];
|
elif [ $batlvl -le 30 ];
|
||||||
then
|
then
|
||||||
echo -en "${LOW}$batlvl%${NCOL}. "
|
echo -en "${LOW}$batlvl%${NCOL}. "
|
||||||
|
@ -91,9 +95,9 @@ clock () {
|
||||||
|
|
||||||
#========Updates=======#
|
#========Updates=======#
|
||||||
updates () {
|
updates () {
|
||||||
deb=0
|
# Set defaults to prevent errors
|
||||||
aur=0
|
debian=0
|
||||||
pacman=0
|
arch=0
|
||||||
fedora=0
|
fedora=0
|
||||||
flatpak=0
|
flatpak=0
|
||||||
|
|
||||||
|
@ -117,6 +121,7 @@ updates () {
|
||||||
arch=$(pacman -Qu 2> /dev/null | wc -l)
|
arch=$(pacman -Qu 2> /dev/null | wc -l)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for Fedora things
|
||||||
if command -v dnf &> /dev/null;
|
if command -v dnf &> /dev/null;
|
||||||
then
|
then
|
||||||
fedora=$(dnf list updates 2> /dev/null | wc -l)
|
fedora=$(dnf list updates 2> /dev/null | wc -l)
|
||||||
|
@ -135,7 +140,7 @@ updates () {
|
||||||
|
|
||||||
|
|
||||||
# Add all update counts together
|
# Add all update counts together
|
||||||
updates=$(($debian + $arch + $flatpak + fedora))
|
updates=$(($debian + $arch + fedora + $flatpak))
|
||||||
|
|
||||||
# Check the update amounts and print them out
|
# Check the update amounts and print them out
|
||||||
if [ $updates -eq 1 ];
|
if [ $updates -eq 1 ];
|
||||||
|
@ -151,10 +156,11 @@ updates () {
|
||||||
|
|
||||||
#=========SETUP========#
|
#=========SETUP========#
|
||||||
# Select which parts you want active by commenting them out
|
# 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
|
# For example, on a desktop, disabling the battery message is a good idea
|
||||||
|
# You can also re order them to change how they display!
|
||||||
|
|
||||||
flatpakupd="on" # Check for flatpak updates, this slows startup down *a lot*
|
flatpakupd="off" # Check for flatpak updates, this slows startup down A LOT
|
||||||
|
rechargenotif="off" # Notify that you should recharge if below 15%
|
||||||
|
|
||||||
welcome
|
welcome
|
||||||
greeting
|
greeting
|
||||||
|
|
Loading…
Reference in a new issue