stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] A simple hack.


From: Elliott
Subject: [STUMP] A simple hack.
Date: Wed, 14 Jul 2004 01:24:28 -0700
User-agent: Mutt/1.5.6i

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")))
+    (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 like to include a binding for cleanly ending mpg123 and was
wondering if there is a way of killing processes with port?

-Elliott





reply via email to

[Prev in Thread] Current Thread [Next in Thread]