---
layout: project
title: "bongo-player-started hook pour ratpoison (MàJ)"
date: 2011-09-06 22:17:54 +0200
id: "0906"
---
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))))
MàJ du 07 septembre 2011 :
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 "'"))