waybar layout
This commit is contained in:
24
scripts/checksystemupdates.sh
Executable file
24
scripts/checksystemupdates.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
# Requires pacman-contrib trizen
|
||||
|
||||
# Define threshholds for color indicators
|
||||
threshhold_green=0
|
||||
threshhold_yellow=25
|
||||
threshhold_red=100
|
||||
|
||||
# Calculate available updates pacman and aur (with trizen)
|
||||
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
|
||||
updates_arch=0
|
||||
fi
|
||||
|
||||
if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
|
||||
updates_aur=0
|
||||
fi
|
||||
|
||||
updates=$(("$updates_arch" + "$updates_aur"))
|
||||
|
||||
if [[ $updates = 0 ]]; then
|
||||
printf '{"text": "%s", "alt": "updated", "tooltip": "%s Updates", "class": "green", "percentage": "100"}' "$updates" "$updates"
|
||||
else
|
||||
printf '{"text": "$s", "alt": "has-updates", "tooltip": "%s Updates", "class": "green", "percentage": "0"}' "$updates" "$updates"
|
||||
fi
|
8
scripts/systemupdates.sh
Executable file
8
scripts/systemupdates.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Starting install updates"
|
||||
echo ""
|
||||
|
||||
yay
|
||||
|
||||
notify-send "Update complete"
|
@ -30,5 +30,5 @@ fi
|
||||
if [ "$updates" -gt $threshhold_green ]; then
|
||||
printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class"
|
||||
else
|
||||
printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green"}'
|
||||
printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green", ""}'
|
||||
fi
|
||||
|
Reference in New Issue
Block a user