aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-08-21 01:12:46 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-08-21 01:12:46 +0100
commit48084564ae140b346463c7ec91f36f8e8c769877 (patch)
treefb1906319309c87db6f74f231098a164fd4f53ba /Scripts/.local/scripts
parenteee616a4e7831f5992ae82a79be22dcfcc910abb (diff)
downloaddotfiles-48084564ae140b346463c7ec91f36f8e8c769877.tar.gz
dotfiles-48084564ae140b346463c7ec91f36f8e8c769877.tar.bz2
dotfiles-48084564ae140b346463c7ec91f36f8e8c769877.zip
(Scripts)~fixed font and output when emacs service wasn't started
~when Emacs hasn't started, state "N/A" rather than nothing ~Using better symbols for output (font wise as well on DWM)
Diffstat (limited to 'Scripts/.local/scripts')
-rwxr-xr-xScripts/.local/scripts/status/memory8
1 files changed, 7 insertions, 1 deletions
diff --git a/Scripts/.local/scripts/status/memory b/Scripts/.local/scripts/status/memory
index 8ae6baf..57491e5 100755
--- a/Scripts/.local/scripts/status/memory
+++ b/Scripts/.local/scripts/status/memory
@@ -4,5 +4,11 @@ line=$(free -m | sed -n 2p);
used=$(echo $line | awk '{print $3}');
available=$(echo $line | awk '{print $2}');
value=$(echo "100 * $used / $available" | bc -l | xargs printf "%.2f" $1)
+
emacs=$(systemctl --user status emacs | grep "Memory: " | sed "s/[ ]*//;s/Memory: //")
-echo " $(printf "%dMB" $used) $value% ->  $emacs"
+if [[ $emacs = "" ]];
+then
+ emacs="N/A"
+fi
+
+echo " $(printf "%dMB" $used) $value% ->  $emacs"