(Scripts|SystemD)~lower size of scripts

This commit is contained in:
2024-05-31 20:52:53 +05:30
parent 9ef78de263
commit d2e7060f89
4 changed files with 8 additions and 11 deletions

View File

@@ -3,8 +3,11 @@
internet=$(nmcli g | sed -n 2p | awk '{print $1}')
if [[ $internet == "connected" ]]
then
con=$(nmcli | grep "connected to" | sed 's/.*: connected to \(.*\)/\1/g')
con=$(nmcli | grep "connected to" | sed "s/.*: connected to \(.*\)/\1/g")
echo "" $con
elif [[ $internet == "disconnected" ]]
then
echo ""
else
echo " Not Connected"
fi

View File

@@ -1,2 +1,2 @@
#!/usr/bin/env bash
echo " $(date +'%A %d %b %R')"
echo " $(date +'%a %d %b %R')"

View File

@@ -5,10 +5,4 @@ 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: //")
if [[ $emacs -eq "" ]];
then
emacs="N/A"
fi
echo "⾝ $(printf "%dMB" $used) $value% -> $emacs"
echo "⾝ $(printf "%dMB" $used) $value%"

View File

@@ -3,8 +3,8 @@ Description=Emacs
[Service]
Type=forking
ExecStart=/usr/local/bin/emacs --bg-daemon
ExecStop=/usr/local/bin/emacsclient --eval "(kill-emacs)"
ExecStart=/usr/bin/emacs --bg-daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Restart=on-failure
TimeoutStartSec=0