aboutsummaryrefslogtreecommitdiffstats
path: root/modules/disksize
diff options
context:
space:
mode:
Diffstat (limited to 'modules/disksize')
-rwxr-xr-xmodules/disksize16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/disksize b/modules/disksize
new file mode 100755
index 0000000..972c209
--- /dev/null
+++ b/modules/disksize
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Prints out the total disk memory and the availeable memory
+
+PREFIX='🗄️ '
+
+get_disk()
+{
+ TOTAL_SIZE=$( df -h --total | tail -1 | awk {'printf $2'})
+ USED_SIZE=$(df -h --total | tail -1 | awk {'printf $3'})
+ PERCENTAGE=$(df -h --total | tail -1 | awk {'printf $5'})
+
+ echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
+}
+
+get_disk