From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/3208 Path: news.gmane.org!not-for-mail From: Henrik Enberg Newsgroups: gmane.emacs.gnus.user Subject: Re: Gnus elisp source for Now-Playing Date: Tue, 25 Nov 2003 04:13:28 +0100 Organization: Le Petomane Appreciation Society Message-ID: <87isl9m97r.fsf@enberg.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138669388 18020 80.91.229.2 (31 Jan 2006 01:03:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 01:03:08 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:31:52 2006 Original-Path: quimby.gnus.org!newsfeed1.e.nsc.no!nsc.no!nextra.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!h253n2fls32o1112.telia.COM!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-NNTP-Posting-Host: h253n2fls32o1112.telia.com (213.65.65.253) Original-X-Trace: news.uni-berlin.de 1069730173 60748814 213.65.65.253 (16 [125297]) X-Now-Playing: Sage Francis - Climb Trees User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:/4ItucP2ncQdAW1I9eFGg6BjnhA= Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:3349 Original-Lines: 49 X-Gnus-Article-Number: 3349 Tue Jan 17 17:31:52 2006 Xref: news.gmane.org gmane.emacs.gnus.user:3208 Archived-At: sean@tcob1.net (Sean Rima) writes: > Some where on the web I found and lost a segment of text that allowed > for adding a X-XMMS-NOW-PLAYING header but I cannot find it. If > anyone has something similar please share it,Please :) put this in ~/.gnus: (defun xmms-now-playing () (let ((track (shell-command-to-string "xmms-now-playing"))) (unless (string-equal "" track) (save-excursion (goto-char (point-min)) (re-search-forward "^--text follows this line--") (forward-line 0) (insert "X-Now-Playing: " track "\n"))))) (add-hook 'message-setup-hook 'xmms-now-playing) you also need the below C program. put it in a directory on $PATH when you've compiled it. Also, this requires the XMMS development headers to be installed. Use "apt-get install xmms-dev" if you're on on Debian. ---- xmms-now-playing.c ---- /* compile with: gcc -O2 -Wall `xmms-config --cflags --libs` -o xmms-now-playing xmms-now-playing.c */ #include #include int main (void) { int n = -1; if ((n = xmms_remote_get_playlist_pos (0)) > -1) { char *title; if ((title = xmms_remote_get_playlist_title (0, n))) { g_print ("%s", title); g_free (title); } } return 0; }