Created
January 29, 2015 12:59
-
-
Save Genki-S/60d4d6585b8253dde6fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let ((physmem (car (split-string (shell-command-to-string "top -l 1 | head -n 10 | grep PhysMem") "\n"))) | |
(mem-used nil) | |
(mem-unused nil)) | |
(save-match-data (and (string-match "PhysMem: \\([0-9]+[MG]\\) used (\\([0-9]+[MG]\\) wired), \\([0-9]+[MG]\\) unused." physmem) | |
(setq mem-used (match-string 1 physmem) | |
mem-unused (match-string 3 physmem)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment