zk-phi / symon

Tiny graphical system monitor
289 stars 26 forks source link

Add ability to add string to `symon-monitors` #22

Closed kaushalmodi closed 9 years ago

kaushalmodi commented 9 years ago

I thought of adding the date+time string to the symon display instead of showing it duplicated in modelines of all buffers.

So I made this modification (added :disp-string) : https://github.com/zk-phi/symon/pull/24

Here is how I use it:

    (define-symon-monitor symon-date-time
      :interval 60
      :disp-string (concat
                    (propertize
                     (format-time-string "%l:%M %b %d %a")
                     'face 'font-lock-type-face)
                    "     "))

    (setq symon-monitors
          (cond ((memq system-type '(gnu/linux cygwin))
                 '(symon-date-time
                   symon-linux-memory-monitor
                   symon-linux-cpu-monitor
                   symon-linux-network-rx-monitor
                   symon-linux-network-tx-monitor))
                ((memq system-type '(windows-nt))
                 '(symon-date-time
                   symon-windows-memory-monitor
                   symon-windows-cpu-monitor
                   symon-windows-network-rx-monitor
                   symon-windows-network-tx-monitor))))

clipboard01

Thanks.

kaushalmodi commented 9 years ago

Sorry, realized that :display was all I needed.

All I need to do is

    (define-symon-monitor symon-current-date-time-monitor
      :interval 60
      :display (propertize
                (format-time-string "%l:%M %b %d %a     ")
                'face 'font-lock-type-face))

    (setq symon-monitors
          (cond ((memq system-type '(gnu/linux cygwin))
                 '(symon-current-date-time-monitor
                   symon-linux-memory-monitor
                   symon-linux-cpu-monitor
                   symon-linux-network-rx-monitor
                   symon-linux-network-tx-monitor))
                ((memq system-type '(windows-nt))
                 '(symon-current-date-time-monitor
                   symon-windows-memory-monitor
                   symon-windows-cpu-monitor
                   symon-windows-network-rx-monitor
                   symon-windows-network-tx-monitor))))