Page 1 of 6 123 ... LastLast
Results 1 to 10 of 57

Thread: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

  1. #1
    Join Date
    Dec 2005
    Location
    Cluj-Napoca, Romania
    Beans
    1,080

    HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    Hi everybody! It's trendy nowadays to have the song that you listen show in the status of your messenger account. So, I'm writing this little howto, which probably won't contain very new stuff for many of you, but stuff that some might not know. So... Here we go.

    1. First of all, follow this great HOWTO to get your Gaim 2.0 up and running

    http://ubuntuforums.org/showthread.php?t=100899

    2. Next, you need autoprofile. I compiled a working binary, which I am attaching here. It's compiled against today's Gaim CVS but I don't think they will make changes that would cause it not to work anytime soon. I'm not a very experienced programmer, so I had to disable the HTTP component feature, which we don't need. After downloading it, install it:

    Code:
    mkdir ~/.gaim/plugins/
    cd <directory where you downloaded autoprofile.so.zip>
    unzip autoprofile.so.zip -d ~/.gaim/plugins/
    3. Now, with xmms. We will use the song_change plugin, which performs a shell action on various events in XMMS. So, go to XMMS/Preferences/General plugins. Select SongChange, click enable, and then configure. In the first edit box: "shell-command to run when XMMS starts a new song" insert

    Code:
    echo "%n" > "<path to home folder>/xmms_song.txt"
    Then click ok for the plugin settings and then apply in the XMMS preferences window. This plugin comes with standard XMMS.

    4. Now... Restart Gaim. Go to the plugins screen (right click on the tray icon, select plugins). There, enable autoprofile, and then click "configure plugin". In the autoprofile configuration window, go to "Output text" tab and click Add. In the window that appears, enter the title "XMMS song info" then click OK. Now you will have this option among the Output text entries. Select it and click "Edit Text". The only thing you really need to enter in the big edit box is %x , which will be replaced with the song title but it would be nice to enter something customized, like: "Now listenning to ..:: %x ::.." or whatever you like.

    5. Last step... In the autoprofile settings window, go to "Component settings" tab then under component list choose option "Text file/Songs" and you will have a browse button which you will use to select the file xmms_song.txt from your home directory. Make sure to change the song in XMMS at least once before this, to cause XMMS to create the file; otherwise, of course, it won't be there.

    That's pretty much it. To enable the status, open the buddy list window of Gaim,go to Tools/Autoprofile/Away and in the window that shows up select option "XMMS song info" then click "use'. Et voila! The plugin will refresh the status message at intervals which you can select in the plugin configuration screen, under behavior tab. I use 1 minute, which is the shortest interval. It won't be instantaneous, but it will do (I doubt any of you have songs shorter than 1 minute ).

    Tip: You can also use, let's say, "context specifc" text if you like. What I do is, under the Output text of autoprofile, enter

    Now listenning to ..:: %x ::.. %a

    Then, when I enable the away message, there is a small edit box there where I can enter the message which will replace %a. So for example, by entering "and studying" I will have the status:

    Now listenning to ..:: song title ::.. and studying

    If you enter nothing, then it will be just Now listenning to ..:: song title ::..


    Well... that's it for the first howto I ever write. Hope someone will find it useful. I am of course open to any criticism and suggestions, so, please, "don't hold back" (yes, that is from a song by The Chemical Brothers).
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2005
    Location
    Canada
    Beans
    137
    Distro
    Kubuntu Breezy 5.10

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    Thank you for your guide.
    It works!
    ...optimize, clarify, open, Share....knowledge.

  3. #3
    Join Date
    Dec 2005
    Location
    Cluj-Napoca, Romania
    Beans
    1,080

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS



    You're wellcome!

  4. #4
    Join Date
    Apr 2005
    Beans
    133

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    Works pretty well so far, I got one problem though... Whenever the string from xmms contains a german "umlaut" (e.g. ü), this one gets transfered into the text file in iso encoding, and gaim then puts it in accounts.xml, which uses utf-8. It hangs at displaying the previous song (even after the text file changes content to the next track), and the next time i start gaim, it can't read accounts.xml, and I have to manually remove all the wrong umlauts in there. Is their a way to transform them to utf-8, or maybe, change from ö to oe, ü to ue, etc... (I though about some sed magic, but can't get it to work properly ;P)

    Regards

  5. #5
    Join Date
    Dec 2005
    Location
    Cluj-Napoca, Romania
    Beans
    1,080

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    I know what you're talking about. I'll look into it, too. I know bmp has an option among the preferences to convert all titles to UTF-8, but it seems XMMS doesn't.

    There's gotta be a solution, it just doesn't pop into mind right now.

  6. #6
    Join Date
    Dec 2005
    Location
    Cluj-Napoca, Romania
    Beans
    1,080

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    Well... here's what I got so far.

    I think the answer is the iconv utiity. This would mean writing in song_change something like:

    Code:
    echo "%n" > "<path to home folder>/xmms_song.txt"; iconv -f ISO-8859-1 -t UTF-8 "<path to home folder>/xmms_song.txt" -o "<path to home folder>/xmms_song.txt"
    But... I couldn't get it to work. I used the above command, but, for an unknown reason it will leave the file empty. Iconv will do that even in console: running

    Code:
    iconv -f ISO-8859-1 -t UTF-8 "<path to home folder>/xmms_song.txt"
    will display the result in console, but running

    Code:
    iconv -f ISO-8859-1 -t UTF-8 "<path to home folder>/xmms_song.txt" -o "<path to home folder>/xmms_song.txt"
    will leave the file empty. I don't understand this, but I'll do some more research.

    Another thing is that not even iconv gets things completely right. It may not replace ü with an u, as you would probably like.

    Edit: well, I didn't think it would be that, but it was: the filename must be different. so you would have to do something like:

    Code:
    echo "%n" > "<path to home folder>/xmms_song_temp.txt"; iconv -f ISO-8859-1 -t UTF-8 "<path to home folder>/xmms_song_temp.txt" -o "<path to home folder>/xmms_song.txt
    the ü and u issue I think will remain, though. But at least it won't freeze your gaim. Please get back and tell us if this worked.
    Last edited by louis_nichols; February 7th, 2006 at 05:41 AM.

  7. #7
    Join Date
    Sep 2005
    Beans
    146
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    If you wanted to keep it clean, you should be able to tack an RM command on the end of all that to delete the temp file:

    Code:
    echo "%n" > "<path to home folder>/xmms_song_temp.txt"; iconv -f ISO-8859-1 -t UTF-8 "<path to home folder>/xmms_song_temp.txt" -o "<path to home folder>/xmms_song.txt; rm "<path to home folder>/xmms_song_temp.txt"

  8. #8
    Join Date
    Apr 2005
    Beans
    133

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    I managed to do it by using
    Code:
    echo "%n" |  iconv -f ISO-8859-15 -t UTF-8 > "/home/xyz/.current-song"
    as song change code thanks for the right direction

    Quote Originally Posted by louis_nichols
    the ü and u issue I think will remain, though. But at least it won't freeze your gaim. Please get back and tell as if this worked.
    well, it does correctly transform iso ü's to utf ü's now, and gaim will display them correctly too. i should have been more clearer on the hang stuff though, it doesn't hang gaim as whole, but the status is stuck at one song before the umlauted one, and wont start after closing. (no matter what song i was playing last, if at one point when auto profile read the file it contained an iso umlaut, the accounts.xml file gets corrupted till manually fixing it!)

    regards

  9. #9
    Join Date
    Dec 2005
    Location
    Cluj-Napoca, Romania
    Beans
    1,080

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    Really cool, then! Glad it's ok now. I'm not good with encodings (in fact I am quite a big newb with Linux as a whole, and encoding problems don't really come to the surface in *******), so I'm just glad that my playlist doesn't have any special characters. But, in order to complete the howto: how exactly does one know that there it's ISO-8859-x and not ISO-8859-y? I tried pretty much all that might apply to romanian special characters, but didn't get good results, such as an a instead of an ă or â.

    LordBug: thanks for the input. I guess I didn't do it that way because the file would be re-created and reused anyway. But pipelining is the way to go, as Fab has shown. I had tried that, but iconv seemed to always require a file as input. So I learn something new every day.

  10. #10
    Join Date
    Feb 2006
    Beans
    3

    Re: HOWTO: Current playing song from XMMS in status message, using Gaim 2.0 from CVS

    The plugin is not listed in my gaim plugin menu, but i extracted it to where you stated, as well as /usr/local/lib/gaim, but still nothing, any idea why?

Page 1 of 6 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •