mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-22 15:01:59 +01:00
test tooltip for pkg module
This commit is contained in:
parent
5ff405e1c1
commit
86b1fa191d
@ -37,7 +37,8 @@
|
||||
"custom/pkg": {
|
||||
"format": "{}",
|
||||
"interval": 3600,
|
||||
"exec": "~/.config/waybar/modules/pkg.sh"
|
||||
"exec": "~/.config/waybar/modules/pkg.sh",
|
||||
"return-type": "json"
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": "<span foreground='#929292'></span> {essid} <span foreground='#929292'>{signalStrength}%</span>",
|
||||
|
@ -19,13 +19,16 @@ pacman_check() {
|
||||
}
|
||||
|
||||
xbps_check(){
|
||||
pkg=$(xbps-install -nu | wc -l)
|
||||
pkg=$(xbps-install -nu)
|
||||
pkg_count=$(wc -l <<< "$pkg")
|
||||
|
||||
if [[ $pkg -eq "0" ]] || [[ ! $pkg =~ [0-9]+ ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
echo "<span foreground='#929292'></span> $pkg"
|
||||
text="<span foreground='#929292'></span> $pkg_count"
|
||||
tooltip=$(awk '{print $1}' <<< "$pkg")
|
||||
printf {"text": "$text", "tooltip": "$tooltip"}
|
||||
}
|
||||
|
||||
if grep -i "arch" /etc/os-release &>/dev/null
|
||||
|
@ -32,6 +32,6 @@ else
|
||||
printf "$json_fmt" "$pcent" "warning"
|
||||
elif [[ $pcent -ge $critical ]]
|
||||
then
|
||||
printf "$json_fmt" "$pcent" "critical"
|
||||
printf "$json_fmt" "$pcent" "critical"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user