Skip to content

Commit

Permalink
Fix helm-top-command (#1532)
Browse files Browse the repository at this point in the history
To make users be able customize this variable
  • Loading branch information
xuchunyang committed Jun 8, 2016
1 parent 5bd6042 commit 6d96f42
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions helm-sys.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@
:group 'helm-sys)


(defun helm-top-command-set-fn (var _value)
(set var
(cl-case system-type
(darwin "env COLUMNS=%s ps -axo pid,user,pri,nice,ucomm,tty,start,vsz,%%cpu,%%mem,etime,command")
(t "env COLUMNS=%s top -b -n 1"))))

(defcustom helm-top-command "env COLUMNS=%s top -b -n 1"
(defcustom helm-top-command
(cl-case system-type
(darwin "env COLUMNS=%s ps -axo pid,user,pri,nice,ucomm,tty,start,vsz,%%cpu,%%mem,etime,command")
(t "env COLUMNS=%s top -b -n 1"))
"Top command used to display output of top.
To use top command, a version supporting batch mode (-b option) is needed.
On Mac OSX top command doesn't support this, so ps command
Expand All @@ -50,8 +47,7 @@ working properly, that is 12 elements with the 2 first being
PID and USER and the last 4 being %CPU, %MEM, TIME and COMMAND.
A format string where %s will be replaced with `frame-width'."
:group 'helm-sys
:type 'string
:set 'helm-top-command-set-fn)
:type 'string)

(defcustom helm-top-poll-delay 1.5
"Helm top poll after this dealy when `helm-top-poll-mode' is enabled.
Expand Down

0 comments on commit 6d96f42

Please sign in to comment.