I know it is a somewhat old thread but I found a quite ugly but at least theoretically working work-around for the window reusing problem.
As long as there is only one ruby process for the user running audacious you could use the command "pkill -f ruby" in the song change plugin (you could concatenate it with the script for the lyric-retrieving or you could put it in the line "Command to run toward the end of a song").
Couldn't test it because the script won't work for me (what did you put in the song change plugin? I tried "/home/dertod/skripte/audacious.sh "%n"" but it doesn't do the trick. If I run the script in the terminal with "interpret - songname" it works).
edit:
I tried some tweaks and I think I've found a less ugly way of terminating the lyricwindow (it's still not reusing but at least not killing all ruby processes):
I made some changes to the original Lyric-Retrieving-Script:
Code:
#!/bin/bash
artist=$1
title=$1
timemili=$2
time=$(($timemili/1000))
command='ruby /path/to/wikilyrics/wiki_lyrics/cli/wikilyrics.rb'
artist=${artist%%\ -*}
title=${title##*-\ }
title=$(echo ${title%\n})
$command -k gtk -a "$artist" -t "$title" --sites DarkLyrics,Lyriki,AZLyrics,LyricWiki &
sleep $time
And call it by using this command in Audacious' song-change-plugin:
Code:
xterm -bg black -fg red -T 'lyrics' -e /path/to/script/SCRIPTNAME "%n" "%l"
(should work with every terminal-emulator, but xterm is really fast)
The disadvantage is, that the window lives as long as the song WOULD last (no recognition of changing the song before) and that xterm as well as the gtk window for the lyric both get focus when incarnated (probably solvable through compiz?).
another edit:
Somewhat fixed the focus-problem. There is a nifty tool called devilspie (universe repository). Here is my example .ds file (put it in ~/.devilspie):
Code:
(begin
(if (is (application_name) "wikilyrics.rb") (minimize) )
(if (is (window_name) "lyrics") (minimize) )
(if (is (window_name) "lyrics") (skip_tasklist) )
)
Works fine for me (still getting into focus for a short time, but well, a lot better than before).
and yet another edit:
Found a way to (at least i hope so) safely kill an existing lyric-window on song change (and only this *hope*). I just added the line:
Code:
pkill -9 -f wikilyrics.rb
right after the shebang (the rest of the script is still the same).
Bookmarks