Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dwmblocks doesn't display FontAwesome icons #65

Closed
isak102 opened this issue Apr 30, 2022 · 0 comments
Closed

Dwmblocks doesn't display FontAwesome icons #65

isak102 opened this issue Apr 30, 2022 · 0 comments

Comments

@isak102
Copy link

isak102 commented Apr 30, 2022

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:
image

@isak102 isak102 closed this as completed May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant