(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}') internet=$(nmcli g | sed -n 2p | awk '{print $1}')
if [[ $internet == "connected" ]] if [[ $internet == "connected" ]]
then 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 echo "" $con
elif [[ $internet == "disconnected" ]]
then
echo ""
else else
echo " Not Connected" echo " Not Connected"
fi fi

View File

@@ -1,2 +1,2 @@
#!/usr/bin/env bash #!/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}'); available=$(echo $line | awk '{print $2}');
value=$(echo "100 * $used / $available" | bc -l | xargs printf "%.2f" $1) 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%"
if [[ $emacs -eq "" ]];
then
emacs="N/A"
fi
echo "⾝ $(printf "%dMB" $used) $value% -> $emacs"

View File

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