mirror of
https://github.com/nboughton/dotfiles
synced 2024-11-22 23:51:57 +01:00
improved pacman module - requires yay
This commit is contained in:
parent
fd52d984a6
commit
cc1ebe0736
@ -120,12 +120,13 @@
|
||||
},
|
||||
"custom/pacman": {
|
||||
"format": " {}",
|
||||
"return-type": "json",
|
||||
"interval": 1800, // every 30 minutes
|
||||
"exec": "checkupdates | wc -l", // # of updates
|
||||
"exec": "~/.config/waybar/modules/update-check.sh", // # of updates
|
||||
"exec-if": "exit 0", // always run; consider advanced run conditions
|
||||
"on-click": "~/.config/waybar/modules/update-system.sh; pkill -RTMIN+8 waybar", // update system
|
||||
"signal": 8,
|
||||
"tooltip": false
|
||||
"tooltip": true
|
||||
},
|
||||
"custom/swap": {
|
||||
"format": " {}",
|
||||
|
13
waybar/modules/update-check.sh
Executable file
13
waybar/modules/update-check.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
updates=$(yay --devel -Qqu)
|
||||
text=$(echo $updates | wc -l)
|
||||
alt=$text
|
||||
tooltip=$updates
|
||||
percentage=$text
|
||||
class="no-updates"
|
||||
|
||||
if [[ $text -gt 0 ]]; then
|
||||
class="updates"
|
||||
fi
|
||||
|
||||
echo "{\"text\": \"$text\", \"alt\": \"$alt\", \"tooltip\": \"$tooltip\", \"class\": \"$class\", \"percentage\": $percentage }"
|
@ -65,9 +65,12 @@ window#waybar {
|
||||
border-bottom-right-radius: 7px;
|
||||
}
|
||||
|
||||
#custom-pacman {
|
||||
/*background: rgba(94,129,172, 0.75);*/
|
||||
background: rgba(163,190,140, 0.75);
|
||||
#custom-pacman.no-updates {
|
||||
background: rgba(163, 190, 140, 0.75);
|
||||
}
|
||||
#custom-pacman.updates {
|
||||
background: rgba(180, 142, 173, 0.75);
|
||||
/*background: rgba(208, 135, 112, 0.75);*/
|
||||
}
|
||||
|
||||
#custom-weather {
|
||||
|
Loading…
Reference in New Issue
Block a user