diff --git a/arch-config/.config/polybar/i3config.ini b/arch-config/.config/polybar/i3config.ini index 253452ab..9e657978 100755 --- a/arch-config/.config/polybar/i3config.ini +++ b/arch-config/.config/polybar/i3config.ini @@ -16,6 +16,7 @@ include-file = /home/$USER/.config/polybar/colors.ini include-file = /home/$USER/.config/polybar/modules/modules.ini include-file = /home/$USER/.config/polybar/modules/i3.ini +include-file = /home/$USER/.config/polybar/modules/updates.ini include-file = /home/$USER/.config/polybar/modules/xwindow.ini include-file = /home/$USER/.config/polybar/modules/date.ini #include-file = /home/$USER/.config/polybar/modules/volume.ini @@ -87,7 +88,7 @@ font-5 = Iosevka:style=Regular:size=16;3 modules-left = full sysmenu full i3 full left-top right-bot full xwindow full left-top modules-center = right-bot full date full left-bot -modules-right = right-top full player-mpris-tail full left-bot right-top full battery full left-bot right-top +modules-right = right-top full player-mpris-tail full left-bot right-top full battery full left-bot right-top full updates-pacman-aurhelper full left-bot right-top tray-detached = false diff --git a/arch-config/.config/polybar/modules/updates.ini b/arch-config/.config/polybar/modules/updates.ini new file mode 100644 index 00000000..22d94a3c --- /dev/null +++ b/arch-config/.config/polybar/modules/updates.ini @@ -0,0 +1,10 @@ +###################################################################### +###################################################################### +############ Updates ############ +###################################################################### +###################################################################### + +[module/updates-pacman-aurhelper] +type = custom/script +exec = ~/scripts/updates-pacman-aurhelper.sh +interval = 600 diff --git a/arch-config/scripts/updates-pacman-aurhelper.sh b/arch-config/scripts/updates-pacman-aurhelper.sh new file mode 100644 index 00000000..fbbac800 --- /dev/null +++ b/arch-config/scripts/updates-pacman-aurhelper.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then + updates_arch=0 +fi + +# if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then +if ! updates_aur=$(paru -Qum 2> /dev/null | wc -l); then +# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then +# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then +# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then +# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then + updates_aur=0 +fi + +updates=$(("$updates_arch" + "$updates_aur")) + +if [ "$updates" -gt 0 ]; then + echo "# $updates" +else + echo "" +fi