aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/archupdates23
-rw-r--r--modules/date10
-rw-r--r--modules/time9
3 files changed, 37 insertions, 5 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
diff --git a/modules/date b/modules/date
index 87326f7..c6ddc38 100644
--- a/modules/date
+++ b/modules/date
@@ -1,8 +1,12 @@
-#!/bin/sh
+#!/bin/bash
# Prints out the date
-PREFIX_ICON=''
+PREFIX=''
-echo "$PREFIX_ICON $(date '+%d-%m-%y (%a)')"
+date()
+{
+ echo "$PREFIX $(date '+%d-%m-%y (%a)')"
+}
+date
diff --git a/modules/time b/modules/time
index 6b5b4f2..2551229 100644
--- a/modules/time
+++ b/modules/time
@@ -2,6 +2,11 @@
# Prints out the time
-PREFIX_ICON=' '
+PREFIX=' '
-echo "$PREFIX_ICON$(date '+%H:%M')"
+time()
+{
+ echo "$PREFIX$(date '+%H:%M')"
+}
+
+time