You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple bash script which checks how many updates I have available and prints them with some icons, this is the code for it:
#!/bin/bash
while ! nc -zw1 google.com 443 >/dev/null 2>&1; do
# holds the script until we have network
sleep 2
done
# total_updates=$(yay -Qu | wc -l)
pacman_updates=$(checkupdates | wc -l)
aur_updates=$(yay -Qua | wc -l)
[[ "$aur_updates" -lt 0 ]] && aur_updates=0 # if its less than 0 we just set it to 0
# echo "Pacman: $pacman_updates"
# echo "AUR: $aur_updates"
red_bound=20
create_string () {
count="$1"
prefix="$2" # prefix is the letter before the symbol
if [[ $count == 0 ]]; then
echo "<span color='#0BDA51'>$prefix</span>"
elif [[ $count -ge $red_bound ]]; then
echo "<span color='red'>$prefix$count</span>"
else
echo "<span color='yellow'>$prefix$count</span>"
fi
}
pacman_string=$(create_string $pacman_updates)
aur_string=$(create_string $aur_updates "Y")
package_list_path="$(chezmoi source-path)"
yay -Qe | cut -f 1 -d " " > $package_list_path/installed-packages-$HOSTNAME.txt
echo "$pacman_string $aur_string"
And when I use it with xsetroot everything works as expected, the Font Awesome characters get printed as expected. However when I call this script from dwmblocks nothing gets printed at all and the title of my current window gets printed instead:
The text was updated successfully, but these errors were encountered:
I have a simple bash script which checks how many updates I have available and prints them with some icons, this is the code for it:
And when I use it with xsetroot everything works as expected, the Font Awesome characters get printed as expected. However when I call this script from dwmblocks nothing gets printed at all and the title of my current window gets printed instead:
The text was updated successfully, but these errors were encountered: