1 line
1.1 KiB
Plaintext
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 () "Display CPU/MEM Usage" (shell-command-to-string "ps -A -o pcpu | tail -n+2 | paste -sd+ | bc && free -t --mega | grep Mem | awk '{print $1,$7}'")) (setq-default mode-line-format (list " %+ " "%b " "=> " "%f " "%o " "- " "[Mode:%m] " '(:eval (format-time-string "- %a %D %R - ")) "CPU: " '(:eval (cpu-memory-usage)))) </code></pre> </div><!-- SC_ON -->   submitted by   <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>   <span><a href="https://www.reddit.com/r/emacs/comments/rft50r/new_update_about_my_post_display_cpumem_usage_in/">[comments]</a></span> |