You are not logged in.
Hi all,
in order to set up my mode-line for stumpwm, I've been using the commad
run-shell-command such as in:
(setf *screen-mode-line-format*
(list
'(:eval (run-shell-command "date" t))
'(:eval (run-shell-command "date" t))))
However, each instance of run-shell-command creates an unnecessary
newline (so that my mode line contains two lines without necessity).
Do you know how I can get rid of this newline?
Thanks!
Last edited by falsum (2011-05-23 07:12:27)
Offline
I didn't test it but the function you want is 'string-trim' or 'string-right-trim'.
You use it like this:
(string-trim '(#\Newline) my-string)
So in your case:
(setf *screen-mode-line-format*
(list
'(:eval (string-trim '(#\Newline)
(run-shell-command "date" t)))
'(:eval (run-shell-command "date" t))))
Offline
I didn't test it but the function you want is 'string-trim' or 'string-right-trim'.
You use it like this:(string-trim '(#\Newline) my-string)
So in your case:
(setf *screen-mode-line-format* (list '(:eval (string-trim '(#\Newline) (run-shell-command "date" t))) '(:eval (run-shell-command "date" t))))
That works perfectly well. Thanks a lot jiyuu!!
Offline