From 7f3c48bf5e76a6105e9abc08eeadd2ca769aa5f9 Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Tue, 23 Jul 2019 11:38:49 +0200 Subject: Added support for devel update checking (1/2) --- scripts/dwm-status | 55 ++++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/scripts/dwm-status b/scripts/dwm-status index d19d100..95758af 100755 --- a/scripts/dwm-status +++ b/scripts/dwm-status @@ -23,37 +23,34 @@ updates() { if [ "$internet" = true ]; then - if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then - updates_arch=0 - fi - - if (( $counter % 60 == 0 )); then #this is done to add a delay and not saturate aur requests - # if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then - if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then - updates_aur=0 - else - updates_aur=0 - fi - else - : - fi - # TODO: Implenent devel update accounting - updates_devel=0 - updates=$(("$updates_arch" + "$updates_aur" + "$updates_devel")) - - if [ "$updates" -gt 0 ]; then - echo " Updates: $updates" - else - echo " Updates: 0" - fi - - echo $delim - - else - : - fi + if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then + updates_arch=0 + fi + + if (( $counter % 60 == 0 )); then #this is done to add a delay and not saturate aur requests + if ! updates_aur=$(yay -Qum --devel 2> /dev/null | wc -l); then + updates_aur=0 + fi + else + updates_aur=0 + fi + + updates=$(("$updates_arch" + "$updates_aur")) + + if [ "$updates" -gt 0 ]; then + echo " Updates: $updates" + else + echo " Updates: 0" + fi + + echo $delim + + else + : + fi } + tor() { icon_enabled="ﴣ" -- cgit 1.4.1