diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-21 19:20:06 +0100 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-21 19:20:06 +0100 |
commit | e0efb08f314132af22eb03740d5375e367eb5f67 (patch) | |
tree | 72d218eb8ad7487752943113d37a12495474dac1 /modules/archupdates | |
parent | a3733553dac7f11a309d7bce150d05621178dc94 (diff) |
Added archupdates module
Diffstat (limited to 'modules/archupdates')
-rw-r--r-- | modules/archupdates | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/archupdates b/modules/archupdates new file mode 100644 index 0000000..da9288a --- /dev/null +++ b/modules/archupdates @@ -0,0 +1,23 @@ +#!/bin/bash + +# Prints out the number of pacman updates (Arch Linux) +# Requires an internet connection + +PREFIX=' Updates:' + +updates() +{ + if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then + updates_arch=0 + fi + + if ! updates_aur=$(yay -Qum --devel 2> /dev/null | wc -l); then + updates_aur=0 + fi + + updates=$(("$updates_arch" + "$updates_aur")) + + echo "$PREFIX $updates" +} + +updates |