wmiirc-rumai

git clone git://oldgit.suckless.org/wmiirc-rumai/
Log | Files | Refs | README | LICENSE

commit 41294bf81f2ac34c9a7224024aaf2c92140fb7e4
parent a32beac1103097a944e8ee0775c15e46063c62fb
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Fri, 19 Jun 2009 12:41:17 -0700

add keys for loading & adding to MPD playlists

Diffstat:
config.yaml | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/config.yaml b/config.yaml @@ -599,6 +599,24 @@ control: status 'music' + Mod1-Control-Home: | # load a playlist + if list = key_menu(@music.playlists, 'load playlist:') + @music.clear + @music.load list + @music.play + end + + Mod1-Control-End: | # add current song to a playlist + if list = key_menu(@music.playlists, 'add current song to playlist:') + file = File.join(File.expand_path('~/.mpd/playlists'), list + '.m3u') + + songs = File.readlines(file) rescue [] + songs << @music.current_song.file + songs.uniq! + + File.open(file, 'w') {|f| f.puts songs } + end + #--------------------------------------------------------------------------- # volume #---------------------------------------------------------------------------