1
0
mirror of https://github.com/eoli3n/dotfiles synced 2024-11-26 06:08:35 +01:00

test tooltip for pkg module

This commit is contained in:
eoli3n 2020-12-23 15:52:45 +01:00
parent 86b1fa191d
commit 16dfa0c160

@ -19,16 +19,16 @@ pacman_check() {
} }
xbps_check(){ xbps_check(){
pkg=$(xbps-install -nu) pkg=$(xbps-install -nu 2>/dev/null)
pkg_count=$(wc -l <<< "$pkg") pkg_count=$(wc -l <<< "$pkg")
if [[ $pkg -eq "0" ]] || [[ ! $pkg =~ [0-9]+ ]] if [[ $pkg_count -eq "0" ]] || [[ ! $pkg =~ [0-9]+ ]]
then then
exit 0 exit 0
fi fi
text="<span foreground='#929292'></span> $pkg_count" text="<span foreground='#929292'></span> $pkg_count"
tooltip=$(awk '{print $1}' <<< "$pkg") tooltip=$(awk '{print $1}' <<< "$pkg")
printf {"text": "$text", "tooltip": "$tooltip"} printf '{"text": "%s", "tooltip": "%s"}' "$text" "$tooltip"
} }
if grep -i "arch" /etc/os-release &>/dev/null if grep -i "arch" /etc/os-release &>/dev/null