;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require battery ring] 2) (defconst symon-version "1.2.0") (byte-code "\300\301\302\303\304\305%\210\306\307\310\311\304\301%\210\306\312\313\314\304\301%\210\306\315\316\317\304\301%\210\306\320\321\322#\210\306\323\324\325\304\301%\210\306\326\327\330\304\301%\210\306\331\332\333\304\301%\210\306\334\313\335\304\301%\210\306\336\337\340\304\301%\210\306\341\342\343\304\301%\210\306\344\345\346\304\301%\210\306\347\332\350\304\301%\210\306\351\352\353\304\301%\210\306\354\352\355\304\301%\210\306\356\357\360\304\301%\207" [custom-declare-group symon nil "tiny graphical system monitor" :group emacs custom-declare-variable symon-refresh-rate 4 "refresh rate of symon display. *set this option BEFORE\n enabling `symon-mode'.*" symon-delay 2 "delay in seconds until symon is displayed. *set this option\nBEFORE enabling `symon-mode'.*" symon-history-size 50 "number of old values to keep. sparklines grow faster when set\nsmaller. *set this option BEFORE enabling `symon-mode'.*" symon-monitors (cond ((memq system-type '(gnu/linux cygwin)) '(symon-linux-memory-monitor symon-linux-cpu-monitor symon-linux-network-rx-monitor symon-linux-network-tx-monitor)) ((memq system-type '(darwin)) '(symon-darwin-memory-monitor symon-darwin-cpu-monitor symon-darwin-network-rx-monitor symon-darwin-network-tx-monitor)) ((memq system-type '(windows-nt)) '(symon-windows-memory-monitor symon-windows-cpu-monitor symon-windows-network-rx-monitor symon-windows-network-tx-monitor))) "List of monitors used to read system statuses. This variable\n also can be a list of lists from version 1.2, that case\n monitors are displayed in multiple pages. *set this option\n BEFORE enabling `symon-mode'.*" symon-sparkline-height 11 "height of sparklines." symon-sparkline-width 80 "width of sparklines." symon-sparkline-ascent 100 "`:ascent' property for sparklines." symon-sparkline-thickness "line width of sparklines." symon-sparkline-type 'gridded "type of sparklines." symon-sparkline-use-xpm (eq system-type 'darwin) "when non-nil, convert sparklines to xpm from xbm before\nrendering." symon-network-rx-upper-bound 300 "upper-bound of sparkline for network RX status." symon-network-tx-upper-bound "upper-bound of sparkline for network TX status." symon-network-rx-lower-bound 0 "lower-bound of sparkline for network RX status." symon-network-tx-lower-bound "lower-bound of sparkline for network TX status." symon-windows-page-file-upper-bound 2000 "upper-bound of sparkline for page file usage."] 6) #@13 flatten LST (defalias 'symon--flatten #[(lst) ":\203 \301\302\303\304\"\"\207C\207" [lst apply nconc mapcar symon--flatten] 5 (#$ . 2623)]) (defvar symon--sparkline-base-cache [nil symon-sparkline-width symon-sparkline-height nil]) (defalias 'symon--get-sparkline-base #[nil "\304H =\203\305H\nU\203\306H U\204/\304 I\210\305\nI\210\306 I\210\307 \301N I\210\310\307H!\207" [symon--sparkline-base-cache symon-sparkline-type symon-sparkline-width symon-sparkline-height 0 1 2 3 copy-sequence] 4]) #@33 make sparkline image from LIST. (defalias 'symon--make-sparkline #[(list &optional minimum maximum) "G\211\306U?\205\320\307  \203\310 !\202\311\f\203#\310\f!\202$\312 SZ\211 \fZT\245\310 !\245\313\314\"\315\211\315 \306!\"!\"W\203\275\316!\245!H\211\247\203\264\316\fZ_!\306X\203\264W\203\264 \306#\"#\"W\203\263\n#\\ZS_!\\\317I\210#T\211#\202\221*!T\211!\202X*\320\321\322\323\n\324$\325\326\257 . )\207" [list num-samples image-data maximum minimum symon-sparkline-thickness 0 symon--get-sparkline-base float 100.0 0.0 apply vector nil floor t image :type xbm :data :ascent :height :width topmargin symon-sparkline-height height height-per-point symon-sparkline-width width-per-sample samples sample y ix x --dotimes-limit-- dy symon-sparkline-ascent] 12 (#$ . 3142)]) #@36 convert sparkline to an xpm image. (defalias 'symon--convert-sparkline-to-xpm #[(sparkline) "\306A\307\"\310\311\312\"r\nq\210\313\216\314\315 \f\316\317!$c\210\320\f\320W\203b\321c\210 \320W\203U H\203F\322\202G\323c\210 TT\211\2026*\324c\210T\211\202%+\325c\210\326\327\330\307\331 \332 \333\f\334 \257 ,\207" [sparkline data #1=#:temp-buffer symon-sparkline-width symon-sparkline-height ix plist-get :data generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] format "/* XPM */\nstatic char * sparkline_xpm[] = { \"%d %d 2 1\", \"@ c %s\", \". c none\"" face-foreground default 0 ",\n\"" 64 46 "\"" "};" image :type xpm buffer-string :ascent :height :width x --dotimes-limit-- y symon-sparkline-ascent] 12 (#$ . 4007)]) #@62 like `(make-ring symon-history-size)' but filled with `nil'. (defalias 'symon--make-history-ring #[nil "\301\302\303\"BB\207" [symon-history-size 0 make-vector nil] 5 (#$ . 4815)]) #@1450 define a new symon monitor NAME. following keywords are supoprted in PLIST: :setup (default: nil) an expression evaluated when activating symon-mode, and expected to do some preparation. :cleanup (default: nil) an expression evaluated when deactivating symon-mode, and expected to do some cleanup. :fetch (default: nil) an expression that evaluates to the latest status value. the value must be a number (otherwise `N/A' is displayed as the value). :interval (default: symon-refresh-rate) fetch interval in seconds. :index (default: "") string prepended to the status value ("MEM:" for memory monitor, for example). :unit (default: "") string appended to the status value ("%" for memory monitor, for example). :annotation (default: nil) an expression that evaluates to the annotation string for the metrics ("xxxKB Swapped" for memory monitor, for example). if this expression returns a non-nil value, it is surrounded with parentheses and appended to the status value. :display (default: nil) an expression evaluated before updating symon display. when this expression evaluates to a non-nil value, it will be displayed instead of standard symon display format. :sparkline (default: nil) when non-nil, sparklines are rendered. :lower-bound (default: 100.0) upper bound of sparkline. :upper-bound (default: 0.0) lower bound of sparkline. (defalias 'define-symon-monitor '(macro . #[(name &rest plist) "\306\307\310\"\311 \312\"\311 \313\"\206\314\311 \315\"\316\310\317\320\321BB\311 \322\"EE\316\310\323\324BB\323\325\326\327 FF\311 \330\"\331 D\257;\316\310\332\320\333BBD\311 \334\"F<\f\203a\316\310\335\f\336BBE\202\255\316\310\337\340\341\320\342BBDD\343B\335\311 \344\"\345\346\347\335\350\351\352\311 \353\"\206\203\354F\355\356\311 \357\"DC\360BBEF\n\205\252\361\362\355\302\363\340\311 \364\"\311 \365\"FDC\366BBEFEE=\367\370>D\371\372;<=FF.\207" [cell plist sparkline interval display update-fn make-vector 2 nil plist-get :sparkline :interval symon-refresh-rate :display lambda ring-insert aref (0) :fetch aset (0 (symon--make-history-ring)) 1 run-with-timer 0 :setup funcall cancel-timer (1) :cleanup concat (" ") let* lst ring-elements (0) ((val (car lst))) :index if (not (numberp val)) "N/A " format "%d%s " val :unit "" let annot :annotation ((when annot (concat "(" annot ") "))) when (window-system) symon--make-sparkline :lower-bound :upper-bound ((when symon-sparkline-use-xpm (setq sparkline (symon--convert-sparkline-to-xpm sparkline))) (concat (propertize " " 'display sparkline) " ")) put quote 'symon-monitor vector setup-fn cleanup-fn display-fn name] 17 (#$ . 5006)])) (defvar symon--process-buffer-name " *symon-process*") (defvar symon--process-reference-count 0) #@37 Read a value from a specific buffer (defalias 'symon--read-value-from-process-buffer #[(index) "\302!\205rq\210\212\303 \304P\305\306#)\205\307\310\311!!)\207" [symon--process-buffer-name index get-buffer search-backward-regexp ":\\([0-9]+\\)\\>" nil t read match-string 1] 4 (#$ . 7842)]) (defalias 'symon--maybe-start-process #[(cmd) "T\305 !?\205\306\307 \n#\310\311\f\312\"\210\313\f \"*\207" [symon--process-reference-count symon--process-buffer-name cmd filter proc get-buffer start-process-shell-command "symon-process" #[(proc str) "\302!\205%rq\210\303\304 \"\203\305\306\307\310#\203\311`|\210\312 Tb\210 c)\207" [symon--process-buffer-name str get-buffer string-match "-" search-backward "----" nil t 1 buffer-size] 4] set-process-query-on-exit-flag nil set-process-filter] 4]) (defalias 'symon--maybe-kill-process #[nil "S\211\302U\205\303 !\205\304 !\207" [symon--process-reference-count symon--process-buffer-name 0 get-buffer kill-buffer] 3]) (defalias 'symon-linux--read-lines #[(file reader indices) "\303\304\305\"rq\210\306\216\307 !\210\310b\210\311\312\n\"+\207" [#1=#:temp-buffer file indices generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents 1 mapcar #[(index) "\212\302\303\304Q\305\306#\205 \203 \307\310!!\202\307\310!)\207" [index reader search-forward-regexp "^" "\\(.*\\)$" nil t match-string 1] 4]] 3]) (defvar symon-linux--last-cpu-ticks nil) (byte-code "\300\301\302\303\304\305\306##\210\300\307\302\303\310\311\312##\210\300\313\302\303\314\315\316##\207" [put symon-linux-cpu-monitor symon-monitor vector #[nil "\306\307\310 I\210\306\311\312\307\313#I\210\314\315\314\316\317\320\321#\211G\311U\203%\n\242\202,\322\323\324\nGD\"\325\326 \"\327 8 \205P @Z\f AZ\211Z\330_\245* \fB,\"\207" [symon-refresh-rate symon-linux--last-cpu-ticks #:--cl-rest-- cpu idle total [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\306\307\310\311\312\313#\211G\314U\203\242\202\315\316\317GD\"\320\321 \"\322 8\f\205= \f@Z\n\fAZ\211 Z\323_\245* \nB,\"\207" [#:--cl-rest-- cpu idle total symon-linux--last-cpu-ticks idle-diff ring-insert nil symon-linux--read-lines #1="/proc/stat" #[#2=(str) "\301\302\303\304\305#\"\207" [str mapcar read split-string nil t] 6] #3=("cpu") 1 signal wrong-number-of-arguments #4=(cpu) apply + 3 100 total-diff] 7] nil ring-insert symon-linux--read-lines #1# #[#2# "\301\302\303\304\305#\"\207" [str mapcar read split-string nil t] 6] #3# signal wrong-number-of-arguments #4# apply + 3 100 idle-diff total-diff] 7] #[nil "\300\301!\210\301\207" [cancel-timer nil] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "CPU:" #9="N/A " format #10="%d%s " "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #11=" " display] 7] symon-linux-memory-monitor #[nil "\306\307\310 I\210\306\311\312\307\313#I\210\314\315\316\317\320\321#\211G\322U\203& \211A\242\202-\323\324\325 GD\" \211A\242 \211A\242 \211A\242 \242 \203R\n Z\326_\n\245\202^\n\f \\\\Z\326_\n\245.\"\207" [symon-refresh-rate #:--cl-rest-- memtotal memavailable memfree buffers [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\306\307\310\311\312\313#\211G\314U\203\211A\242\202\315\316\317GD\"\211A\242\211A\242\211A\242\242\n\203B \nZ\320_ \245\202M \f\\ \\Z\320_ \245.\"\207" [#:--cl-rest-- memtotal memavailable memfree buffers cached ring-insert nil symon-linux--read-lines #5="/proc/meminfo" #[#6=(str) "\205\301!\207" [str read] 2] #7=("MemTotal:" "MemAvailable:" "MemFree:" "Buffers:" "Cached:") 5 signal wrong-number-of-arguments #8=(memtotal memavailable memfree buffers cached) 100] 7] ring-insert nil symon-linux--read-lines #5# #[#6# "\205\301!\207" [str read] 2] #7# 5 signal wrong-number-of-arguments #8# 100 cached] 7] #[nil "\300\301!\210\301\207" [cancel-timer nil] 2] #[nil "\306\307!\211@\310 \247\204\311\202U\312\313 \314#\315\316\317\320#\211G\321U\203+\n\211A\242\2022\322\323\324\nGD\"\n\242 \fZ\325\245\211\326U?\205G\312\327 \",\211 \205S\330 \331Q)P\332 \205u\333\307\211#!\"\203l\334!!!\335\336\337!#\336P)Q*\207" [lst val #:--cl-rest-- swaptotal swapfree swapped ring-elements nil "MEM:" #9# format #10# "%" symon-linux--read-lines "/proc/meminfo" read ("SwapTotal:" "SwapFree:") 2 signal wrong-number-of-arguments (swaptotal swapfree) 1000 0 "%dMB Swapped" "(" ") " window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #11# display annot sparkline symon-sparkline-use-xpm] 7] symon-linux-battery-monitor #[nil "\302\303\304 I\210\302\305\306\303\307#I\210\310\311 \205\312\313 \236A!\"\207" [symon-refresh-rate battery-status-function [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\301\302\205 \303\304 \236A!\"\207" [battery-status-function ring-insert nil read 112] 5] ring-insert nil read 112] 6] #[nil "\300\301!\210\301\207" [cancel-timer nil] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "BAT:" #9# format #10# "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #11# display] 7]] 7) (defvar symon-linux--last-network-rx nil) (byte-code "\300\301\302\303\304\305\306##\207" [put symon-linux-network-rx-monitor symon-monitor vector #[nil "\304\305\306 I\210\304\307\310\305\311#I\210\312\313\312\314\315\316\"r\nq\210\317\216\320\321!\210\307b\210\305\322\323\312\316#\203@\324\307!\325\230\204' \326p!\\\202' \205K\327 Z\330# ,\"\207" [symon-refresh-rate symon-linux--last-network-rx #3=#:temp-buffer rx [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\304\305\306\307\310\"rq\210\311\216\312\313!\210\314b\210\315\316\317\305\310#\203/\320\314!\321\230\204 \322p!\\\202\n\205:\323 \nZ \324# ,\"\207" [#1=#:temp-buffer rx symon-linux--last-network-rx symon-refresh-rate ring-insert nil generate-new-buffer #2=" *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents #4="/proc/net/dev" 1 0 search-forward-regexp #5="^[ ]*\\(.*\\):" match-string #6="lo" read / 1000] 6] nil ring-insert generate-new-buffer #2# t #[nil "\301!\205 \302!\207" [#3# buffer-name kill-buffer] 2] insert-file-contents #4# search-forward-regexp #5# match-string #6# read / 1000] 6] #[nil "\300\301!\210\301\207" [cancel-timer nil] 2] #[nil "\306\307!\211@\310 \247\204\311\202\312\313 \314#\307P\315 \2053\316\n # \203+\317\f!\320\321\322\f#\321P)Q*\207" [lst val symon-network-rx-lower-bound symon-network-rx-upper-bound sparkline symon-sparkline-use-xpm ring-elements nil "RX:" "N/A " format "%d%s " "KB/s" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize " " display] 7]] 7) (defvar symon-linux--last-network-tx nil) (byte-code "\300\301\302\303\304\305\306##\207" [put symon-linux-network-tx-monitor symon-monitor vector #[nil "\304\305\306 I\210\304\307\310\305\311#I\210\312\313\312\314\315\316\"r\nq\210\317\216\320\321!\210\307b\210\305\322\323\312\316#\203C\324\307!\325\230\204'\326v\210 \327p!\\\202' \205N\330 Z\331# ,\"\207" [symon-refresh-rate symon-linux--last-network-tx #3=#:temp-buffer tx [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\304\305\306\307\310\"rq\210\311\216\312\313!\210\314b\210\315\316\317\305\310#\2032\320\314!\321\230\204\322v\210 \323p!\\\202\n\205=\324 \nZ \325# ,\"\207" [#1=#:temp-buffer tx symon-linux--last-network-tx symon-refresh-rate ring-insert nil generate-new-buffer #2=" *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents #4="/proc/net/dev" 1 0 search-forward-regexp #5="^[ ]*\\(.*\\):" match-string #6="lo" 8 read / 1000] 6] nil ring-insert generate-new-buffer #2# t #[nil "\301!\205 \302!\207" [#3# buffer-name kill-buffer] 2] insert-file-contents #4# search-forward-regexp #5# match-string #6# 8 read / 1000] 6] #[nil "\300\301!\210\301\207" [cancel-timer nil] 2] #[nil "\306\307!\211@\310 \247\204\311\202\312\313 \314#\307P\315 \2053\316\n # \203+\317\f!\320\321\322\f#\321P)Q*\207" [lst val symon-network-tx-lower-bound symon-network-tx-upper-bound sparkline symon-sparkline-use-xpm ring-elements nil "TX:" "N/A " format "%d%s " "KB/s" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize " " display] 7]] 7) (defalias 'symon-darwin--maybe-start-process #[nil "\301\302\303\"!\207" [symon-refresh-rate symon--maybe-start-process format "\nwhile true; do\n echo \"----\"\n\n interface=`route get 0.0.0.0 | grep interface | awk '{print $2}'`\n s=`netstat -bi -I $interface | tail -1`;\n echo $s | awk '{print \"rx:\"$7}'\n echo $s | awk '{print \"tx:\"$8}'\n\n s=`hostinfo | grep 'Load average' | awk '{print \"cpu:\"$3}' | sed 's/,//'`\n echo $s\n\n m1=`sysctl hw.memsize | sed 's/.*: *//'`\n m_active=`vm_stat | grep 'Pages active' | sed 's/.*: *//'`\n m_wired=`vm_stat | grep 'Pages wired' | sed 's/.*: *//'`\n\n s=`echo \"scale=2; (($m_active+$m_wired)*4096*100 / $m1)\"| bc -l`\n echo \"mem:$s\"\n\n sleep %d\ndone"] 4]) (byte-code "\300\301\302\303\304\305\306##\210\300\307\302\303\310\311\312##\207" [put symon-darwin-cpu-monitor symon-monitor vector #[nil "\301\302\303 I\210\301\304\305\302\306#I\210\307 \210\310\311\312\313!\"\207" [symon-refresh-rate [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\300\301\302\303!\"\207" [ring-insert nil symon--read-value-from-process-buffer #1="cpu"] 4] symon-darwin--maybe-start-process ring-insert nil symon--read-value-from-process-buffer #1#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "CPU:" #3="N/A " format #4="%d%s " "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #5=" " display] 7] symon-darwin-memory-monitor #[nil "\301\302\303 I\210\301\304\305\302\306#I\210\307 \210\310\311\312\313!\"\207" [symon-refresh-rate [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\300\301\302\303!\"\207" [ring-insert nil symon--read-value-from-process-buffer #2="mem"] 4] symon-darwin--maybe-start-process ring-insert nil symon--read-value-from-process-buffer #2#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "MEM:" #3# format #4# "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #5# display] 7]] 7) (defvar symon-darwin--last-network-rx nil) (byte-code "\300\301\302\303\304\305\306##\207" [put symon-darwin-network-rx-monitor symon-monitor vector #[nil "\303\304\305 I\210\303\306\307\304\310#I\210\311 \210\312\313\312\314\315! \205%\316\n Z\317#\n)\"\207" [symon-refresh-rate symon-darwin--last-network-rx rx [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\303\304\305\306! \205\307 Z\n\310#)\"\207" [rx symon-darwin--last-network-rx symon-refresh-rate ring-insert nil symon--read-value-from-process-buffer #1="rx" / 1000] 6] symon-darwin--maybe-start-process nil ring-insert symon--read-value-from-process-buffer #1# / 1000] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\306\307!\211@\310 \247\204\311\202\312\313 \314#\307P\315 \2053\316\n # \203+\317\f!\320\321\322\f#\321P)Q*\207" [lst val symon-network-rx-lower-bound symon-network-rx-upper-bound sparkline symon-sparkline-use-xpm ring-elements nil "RX:" "N/A " format "%d%s " "KB/s" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize " " display] 7]] 7) (defvar symon-darwin--last-network-tx nil) (byte-code "\300\301\302\303\304\305\306##\210\300\307\302\303\310\311\312##\207" [put symon-darwin-network-tx-monitor symon-monitor vector #[nil "\303\304\305 I\210\303\306\307\304\310#I\210\311 \210\312\313\312\314\315! \205%\316\n Z\317#\n)\"\207" [symon-refresh-rate symon-darwin--last-network-tx tx [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\303\304\305\306! \205\307 Z\n\310#)\"\207" [tx symon-darwin--last-network-tx symon-refresh-rate ring-insert nil symon--read-value-from-process-buffer #1="tx" / 1000] 6] symon-darwin--maybe-start-process nil ring-insert symon--read-value-from-process-buffer #1# / 1000] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\306\307!\211@\310 \247\204\311\202\312\313 \314#\307P\315 \2053\316\n # \203+\317\f!\320\321\322\f#\321P)Q*\207" [lst val symon-network-tx-lower-bound symon-network-tx-upper-bound sparkline symon-sparkline-use-xpm ring-elements nil "TX:" #2="N/A " format #3="%d%s " "KB/s" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #4=" " display] 7] symon-darwin-battery-monitor #[nil "\302\303\304 I\210\302\305\306\303\307#I\210\310\311 \205\312\313 \236A!\"\207" [symon-refresh-rate battery-status-function [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\301\302\205 \303\304 \236A!\"\207" [battery-status-function ring-insert nil read 112] 5] ring-insert nil read 112] 6] #[nil "\300\301!\210\301\207" [cancel-timer nil] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "BAT:" #2# format #3# "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #4# display] 7]] 7) (defalias 'symon-windows--maybe-start-wmi-process #[nil "\301\302\303\"!\207" [symon-refresh-rate symon--maybe-start-process format "powershell -command $last = 0; while(1) { echo ----; $t = (gwmi Win32_ComputerSystem).TotalPhysicalMemory / 1000; $f = (gwmi Win32_OperatingSystem).FreePhysicalMemory; echo mem:$(($t - $f) * 100 / $t); echo swap:$((gwmi Win32_PageFileUsage).CurrentUsage); echo bat:$((gwmi Win32_Battery).EstimatedChargeRemaining); $r = 0; $t = 0; $w = gwmi Win32_PerfRawData_Tcpip_NetworkInterface; foreach($x in $w){ $r = $r + $x.BytesReceivedPersec; $t = $t + $x.BytesSentPersec } echo rx:$($r / 1000); echo tx:$($t / 1000); $p = (gwmi Win32_PerfRawData_Counters_ProcessorInformation)[0]; if($last) { $dt = $p.Timestamp_Sys100NS - $last.Timestamp_Sys100NS; $dp = $p.PercentProcessorTime - $last.PercentProcessorTime; echo cpu:$((1 - ($dp / $dt)) * 100); } $last = $p; sleep %d }"] 4]) (byte-code "\300\301\302\303\304\305\306##\210\300\307\302\303\310\311\312##\210\300\313\302\303\314\315\316##\210\300\317\302\303\320\321\322##\207" [put symon-windows-cpu-monitor symon-monitor vector #[nil "\301\302\303 I\210\301\304\305\302\306#I\210\307 \210\310\311\312\313!\"\207" [symon-refresh-rate [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\300\301\302\303!\"\207" [ring-insert nil symon--read-value-from-process-buffer #1="cpu"] 4] symon-windows--maybe-start-wmi-process ring-insert nil symon--read-value-from-process-buffer #1#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "CPU:" #3="N/A " format #4="%d%s " "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #5=" " display] 7] symon-windows-memory-monitor #[nil "\301\302\303 I\210\301\304\305\302\306#I\210\307 \210\310\311\312\313!\"\207" [symon-refresh-rate [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\300\301\302\303!\"\207" [ring-insert nil symon--read-value-from-process-buffer #2="mem"] 4] symon-windows--maybe-start-wmi-process ring-insert nil symon--read-value-from-process-buffer #2#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "MEM:" #3# format #4# "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #5# display] 7] symon-windows-page-file-monitor #[nil "\301\302\303 I\210\301\304\305\302\306#I\210\307 \210\310\311\312\313!\"\207" [symon-refresh-rate [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\300\301\302\303!\"\207" [ring-insert nil symon--read-value-from-process-buffer #6="swap"] 4] symon-windows--maybe-start-wmi-process ring-insert nil symon--read-value-from-process-buffer #6#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\305\306!\211@\307 \247\204\310\202\311\312 \313#\306P\314 \2053\315\306\n#\f\203+\316 !\317\320\321 #\320P)Q*\207" [lst val symon-windows-page-file-upper-bound sparkline symon-sparkline-use-xpm ring-elements nil "PF:" #3# format #4# "MB" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #5# display] 7] symon-windows-battery-monitor #[nil "\301\302\303 I\210\301\304\305\302\306#I\210\307 \210\310\311\312\313!\"\207" [symon-refresh-rate [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\300\301\302\303!\"\207" [ring-insert nil symon--read-value-from-process-buffer #7="bat"] 4] symon-windows--maybe-start-wmi-process ring-insert nil symon--read-value-from-process-buffer #7#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\304\305!\211@\306 \247\204\307\202\310\311 \312#\305P\313 \2053\314\305\211# \203+\315\n!\316\317\320\n#\317P)Q*\207" [lst val sparkline symon-sparkline-use-xpm ring-elements nil "BAT:" #3# format #4# "%" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize #5# display] 7]] 7) (defvar symon-windows--last-network-rx nil) (byte-code "\300\301\302\303\304\305\306##\207" [put symon-windows-network-rx-monitor symon-monitor vector #[nil "\303\304\305 I\210\303\306\307\304\310#I\210\311 \210\312\313\312\314\315! \205#\n Z\245\n)\"\207" [symon-refresh-rate symon-windows--last-network-rx rx [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\303\304\305\306! \205 Z\n\245)\"\207" [rx symon-windows--last-network-rx symon-refresh-rate ring-insert nil symon--read-value-from-process-buffer #1="rx"] 4] symon-windows--maybe-start-wmi-process nil ring-insert symon--read-value-from-process-buffer #1#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\306\307!\211@\310 \247\204\311\202\312\313 \314#\307P\315 \2053\316\n # \203+\317\f!\320\321\322\f#\321P)Q*\207" [lst val symon-network-rx-lower-bound symon-network-rx-upper-bound sparkline symon-sparkline-use-xpm ring-elements nil "RX:" "N/A " format "%d%s " "KB/s" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize " " display] 7]] 7) (defvar symon-windows--last-network-tx nil) (byte-code "\300\301\302\303\304\305\306##\210\300\307\302\303\310\311\312##\207" [put symon-windows-network-tx-monitor symon-monitor vector #[nil "\303\304\305 I\210\303\306\307\304\310#I\210\311 \210\312\313\312\314\315! \205#\n Z\245\n)\"\207" [symon-refresh-rate symon-windows--last-network-tx tx [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\303\304\305\306! \205 Z\n\245)\"\207" [tx symon-windows--last-network-tx symon-refresh-rate ring-insert nil symon--read-value-from-process-buffer #1="tx"] 4] symon-windows--maybe-start-wmi-process nil ring-insert symon--read-value-from-process-buffer #1#] 6] #[nil "\300\301!\210\302 \207" [cancel-timer nil symon--maybe-kill-process] 2] #[nil "\306\307!\211@\310 \247\204\311\202\312\313 \314#\307P\315 \2053\316\n # \203+\317\f!\320\321\322\f#\321P)Q*\207" [lst val symon-network-tx-lower-bound symon-network-tx-upper-bound sparkline symon-sparkline-use-xpm ring-elements nil "TX:" "N/A " format "%d%s " "KB/s" window-system symon--make-sparkline symon--convert-sparkline-to-xpm propertize " " display] 7] symon-current-time-monitor #[nil "\301\302\303 I\210\301\304\305\302\306#I\210\307\310\211\"\207" [symon-refresh-rate [nil nil] 0 symon--make-history-ring 1 run-with-timer #[nil "\300\301\211\"\207" [ring-insert nil] 3] ring-insert nil] 6] #[nil "\300\301!\210\301\207" [cancel-timer nil] 2] #[nil "\300\301!\302P\207" [format-time-string "%H:%M" " "] 2]] 7) (defalias 'symon--sparkline-draw-horizontal-grid #[(vec y) "\305\245\306 \nW\205 \f_ \305_\\\307I\210 T\211\202*\207" [symon-sparkline-width x/2 --dotimes-limit-- vec y 2 0 t] 5]) (defalias 'symon--sparkline-draw-vertical-grid #[(vec x) "\306\245\307 \nW\205 \306_\f_ \\\310I\210 T\211\202*\207" [symon-sparkline-height y/2 --dotimes-limit-- vec symon-sparkline-width x 2 0 t] 4]) (defalias 'symon--make-plain-sparkline #[nil "\302 _\303\"\207" [symon-sparkline-height symon-sparkline-width make-bool-vector nil] 3]) (defalias 'symon--make-bounded-sparkline #[nil "\302 \303\304\"\210\303 S\"\210)\207" [vec symon-sparkline-height symon--make-plain-sparkline symon--sparkline-draw-horizontal-grid 0] 3]) (defalias 'symon--make-boxed-sparkline #[nil "\302 \303\304\"\210\303 S\"\210)\207" [vec symon-sparkline-width symon--make-bounded-sparkline symon--sparkline-draw-vertical-grid 0] 3]) (defalias 'symon--make-gridded-sparkline #[nil "\303 \304 \305\245\"\210\306\n\307\245\"\210\306\n\305\245\"\210\306\n\310_\307\245\"\210)\207" [vec symon-sparkline-height symon-sparkline-width symon--make-boxed-sparkline symon--sparkline-draw-horizontal-grid 2 symon--sparkline-draw-vertical-grid 4 3] 4]) (byte-code "\300\301\302\303#\210\300\304\302\305#\210\300\306\302\307#\210\300\310\302\311#\207" [put plain symon-sparkline-type symon--make-plain-sparkline bounded symon--make-bounded-sparkline boxed symon--make-boxed-sparkline gridded symon--make-gridded-sparkline] 4) (defvar symon--cleanup-fns nil) (defvar symon--display-fns nil) (defvar symon--display-active nil) (defvar symon--active-page nil) (defvar symon--total-page-num nil) (defvar symon--timer-objects nil) (defalias 'symon--initialize #[nil "\204\306\307!\210@9\203C\202\310\311\"\312 !\313\314\n\"\210\310\315\n\"\310\316 \"\317G\320\321\322#\323\324\325#D\326\327\330\"\210\326\331\332\"+\207" [symon-monitors monitors monitors-flattened symon--cleanup-fns symon--display-fns symon--display-active message "Warning: `symon-monitors' is empty." mapcar #[(lst) "\301\302\"\207" [lst mapcar #[(s) "\301N\207" [s symon-monitor] 2]] 3] symon--flatten mapc #[(m) "\301H \207" [m 0] 2] #[(m) "\301H\207" [m 1] 2] #[(l) "\301\302\"\207" [l mapcar #[(m) "\301H\207" [m 2] 2]] 3] nil run-with-timer 0 symon--redisplay run-with-idle-timer t symon-display add-hook pre-command-hook symon--display-end kill-emacs-hook symon--cleanup symon--total-page-num symon-refresh-rate symon-delay symon--timer-objects] 5]) (defalias 'symon--cleanup #[nil "\302\303\304\"\210\302\305\306\"\210\307\310\"\210\307\311 \"\207" [symon--timer-objects symon--cleanup-fns remove-hook kill-emacs-hook symon--cleanup pre-command-hook symon--display-end mapc cancel-timer funcall] 3]) #@22 update symon display (defalias 'symon--display-update #[nil "\206\306 ?\205H\307\211\310\f\307\211\203C@ U\2032\311\312\313\314\315\316 \"\"\"\210\2027\317\316 \"\210 TA\211\204-\320\211\207" [cursor-in-echo-area page display-string message-log-max symon--display-fns lst active-minibuffer-window nil 0 message "%s" apply concat mapcar funcall mapc t --dolist-tail-- symon--active-page symon--display-active] 8 (#$ . 33165)]) #@25 activate symon display. (defalias 'symon-display #[nil "\301\302 \207" [symon--active-page 0 symon--display-update] 1 (#$ . 33624) nil]) #@23 update symon display. (defalias 'symon--redisplay #[nil "\205 T\n\246\303 \207" [symon--display-active symon--active-page symon--total-page-num symon--display-update] 2 (#$ . 33768)]) #@27 deactivate symon display. (defalias 'symon--display-end #[nil "\301\211\207" [symon--display-active nil] 2 (#$ . 33962)]) #@251 Non-nil if Symon mode is enabled. See the `symon-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `symon-mode'. (custom-declare-variable 'symon-mode nil '(#$ . 34092) :set 'custom-set-minor-mode :initialize 'custom-initialize-default :type 'boolean) #@572 tiny graphical system monitor This is a minor mode. If called interactively, toggle the `Symon mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `(default-value 'symon-mode)'. The mode's hook is called both when the mode is enabled and when it is disabled. (defalias 'symon-mode #[(&optional arg) "\305 \306\303 \307=\203\310\303!?\202\" \247\203! \311W\203!\312\202\"\313\"\210\314\302!\2039\315\303\n\"\310\303!\2039\303\nB \203C\316 \210\202F\317 \210\320\321\310\303!\203R\322\202S\323\"\210\324\325!\203~\326\303!\210\305 \203k\305 \232\203~\327\330\331\310\303!\203y\332\202z\333\f#\210))\334 \210\310\303!\207" [#1=#:last-message arg global-minor-modes symon-mode local current-message set-default toggle default-value 1 nil t boundp delq symon--initialize symon--cleanup run-hooks symon-mode-hook symon-mode-on-hook symon-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Symon mode %sabled%s" "en" "dis" force-mode-line-update] 4 (#$ . 34487) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar symon-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\313\300!\205#\310\211%\210\314\315!\207" [symon-mode-map symon-mode-hook variable-documentation put "Hook run after entering or leaving `symon-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode symon-mode boundp provide symon] 6)