about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-07-23 11:38:49 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-07-23 11:38:49 +0200
commit7f3c48bf5e76a6105e9abc08eeadd2ca769aa5f9 (patch)
tree46123af116b6d4cdda3fa7ced9170c6a5f28d630
parentPreparationTODO: Add devel support in dwm-status updatecheck (diff)
downloaddwm-7f3c48bf5e76a6105e9abc08eeadd2ca769aa5f9.tar.gz
dwm-7f3c48bf5e76a6105e9abc08eeadd2ca769aa5f9.tar.bz2
dwm-7f3c48bf5e76a6105e9abc08eeadd2ca769aa5f9.zip
Added support for devel update checking (1/2)
-rwxr-xr-xscripts/dwm-status55
1 files 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="ﴣ"