bongo-player-started hook pour ratpoison
Ce code permet d'afficher la chanson en cours jouée dans bongo-player dans la barre de message de ratpoison. Il est le résultat d'une question sur la mailing-list.
; hook which auto-display current bongo song in ratpoison's bar (add-hook 'bongo-player-started-hook (lambda () (let (message command)) (with-bongo-playlist-buffer (setq message (bongo-format-infoset (bongo-player-infoset player))) (setq command (concat "ratpoison -c 'echo " message "'")) (start-process-shell-command "foobar" nil command))))
edit: display just Artist - Title and not the whole infoset. Change setq message and command with this:
(setq bg-art-msg (bongo-infoset-artist-name (bongo-line-infoset))) (setq bg-titl-msg (bongo-infoset-track-title (bongo-line-infoset))) (setq command (concat "ratpoison -c 'echo " bg-art-msg " - " bg-titl-msg "'"))