emacs/var/elfeed/db/data/ba/ba75ea4d57a3bd0e525db90dcbc54bad190e3c65
2022-01-03 12:49:32 -06:00

1 line
1.1 KiB
Plaintext

<!-- SC_OFF --><div class="md"><p>OK I did it. But theres 2 <code>^J</code> in the way :( Anyhow, I now have CPU/MEM usage displaying in the mode line :) How can I remove these annoying <code>^J</code>?</p> <pre><code>(defun cpu-memory-usage () &quot;Display CPU/MEM Usage&quot; (shell-command-to-string &quot;ps -A -o pcpu | tail -n+2 | paste -sd+ | bc &amp;&amp; free -t --mega | grep Mem | awk &#39;{print $1,$7}&#39;&quot;)) (setq-default mode-line-format (list &quot; %+ &quot; &quot;%b &quot; &quot;=&gt; &quot; &quot;%f &quot; &quot;%o &quot; &quot;- &quot; &quot;[Mode:%m] &quot; &#39;(:eval (format-time-string &quot;- %a %D %R - &quot;)) &quot;CPU: &quot; &#39;(:eval (cpu-memory-usage)))) </code></pre> </div><!-- SC_ON --> &#32; submitted by &#32; <a href="https://www.reddit.com/user/Danrobi1"> /u/Danrobi1 </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/rft50r/new_update_about_my_post_display_cpumem_usage_in/">[link]</a></span> &#32; <span><a href="https://www.reddit.com/r/emacs/comments/rft50r/new_update_about_my_post_display_cpumem_usage_in/">[comments]</a></span>