[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [STUMP] A simple hack.
From: |
Manuel Giraud |
Subject: |
Re: [STUMP] A simple hack. |
Date: |
Thu, 15 Jul 2004 14:13:23 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Elliott <address@hidden> writes:
> Hi,
>
> I've been playing with a simple keybinding for starting .m3u
> playlists with mpg123 via the keys "C-t-m". Here it is:
>
> --- user.lisp.~1.3.~ 2004-04-23 22:49:28.000000000 -0700
> +++ user.lisp 2004-07-14 01:07:10.566004672 -0700
> @@ -34,6 +34,7 @@
> "Put the default bindings in the key-bindings hash table."
> (set-key-binding #\n '() 'focus-next-window)
> (set-key-binding #\n '(:control) 'focus-next-window)
> + (set-key-binding #\m '() 'music-key)
> (set-key-binding #\p '() 'focus-prev-window)
> (set-key-binding #\p '(:control) 'focus-prev-window)
> (set-key-binding #\w '() 'echo-windows)
> @@ -168,6 +169,11 @@
> (unless (null cmd)
> (port:run-prog *shell-program* :args (list "-c" cmd) :wait nil))))
>
> +(defun music-key (screen)
> + (let ((pl (concatenate 'string "/home/ejohnson/playlists/" (read-one-line
> screen "Playlist: ") ".m3u")))
^^^^^^^^^^^^^^^^^^^^^^^^^
Cool. But not really portable ;-)
> + (unless (null pl)
> + (port:run-prog "mpg123" :args (list "-@" pl "--random") :wait nil))))
> +
> (defun horiz-split-frame (screen)
> (split-frame screen (lambda (f) (split-frame-h screen f))))
I use to keep this sort of things (keybinding, personnal function, ...)
in the init file of the lisp process that launch stumpwm.
> I like to include a binding for cleanly ending mpg123 and was
> wondering if there is a way of killing processes with port?
>
I think you can go like this:
(setf process (port:run-prog "xterm" :wait nil))
(port:kill-process process)
(in fact, it don't work for me i should do (cl-user::process-kill
process 15) under CMUCL ... don't know why)
--
Manuel Giraud
ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,