zk-phi / symon

Tiny graphical system monitor
289 stars 26 forks source link

Configuration #3

Closed theldoria closed 9 years ago

theldoria commented 9 years ago

The visualization line should be configurable.

On my desktop, for example, it kames no sense to show BAT state.

Also I would like to plug in my own value providing functions.

zk-phi commented 9 years ago

I'm thinking of something like this :


(define-symon-monitor symon-linux-battery-monitor
  :index       "BAT"
  :history     50            ; last 50 values are drawn as a sparkline
  :upper-bound 100           ; upper-bound of sparkline is 100(%)
  :unit        "%"
  :setup       (require 'battery) ; `symon-linux-battery-monitor' requires `battery.el'
  :cleanup     nil
  :value       (and battery-status-function
                    (read (cdr (assoc ?p (funcall battery-status-function)))))
  :annotation  (and battery-status-function
                    (cdr (assoc ?L (funcall battery-status-function)))))

(setq symon-monitors '(symon-linux-memory-monitor
                       symon-linux-battery-monitor
                       symon-linux-cpu-monitor))
;; => "MEM:xx% BAT:yy% CPU:zz%"
gregsexton commented 9 years ago

That looks perfect. I was just coming here to request something similar. It would be great to factor out the different performance checks and allow the user to define their own.

gregsexton commented 9 years ago

Just looking at this a bit more. You may wish to include an optional lower bound and the ability to turnoff the sparkline for some metrics. Perhaps by setting history to 1?

zk-phi commented 9 years ago

I think all properties should be optional and users can turn-off sparklines by omitting :history property.