Main index > About existing desklets > xmms_bar

By syfou (Core Developer & Desklet Author), on Sat Feb 26 13:28:10 2005: xmms_bar.

xmms_bar desklet issues are discussed here.

By nucular (User), on Wed Mar 2 13:02:57 2005.

Am I to understand correctly that xmms_bar should be able to choose not to hide itself automatically?

Because hideon/hideoff button doesn't do anything and desklet always hides itself.

By syfou (Core Developer & Desklet Author), on Wed Mar 2 13:30:24 2005.

Maybe I was unclear somewhere (I'd like to know what made you think this), but right now there is no configurable way with xmms_bar 0.0.2 to tell it not to hide but by modifying the code manually. With GNU sed :

Code:


sed -i '/enter/,+13d' xmms_bar.py



Someone could easily make this a configurable feature, since this desklet is not configurable at all right now (see this).. It was only written as a short interactive, easy to read demo... I hope someone would take a shot at something more serious, like the gorgeous CornerXMMS from gDesklets... I will probably do it myself someday though as soon as I am through with my portability issues on solaris >=9.

By syfou (Core Developer & Desklet Author), on Wed Mar 2 13:35:55 2005.

Whoops. Sorry for failing to read you correctly. The Hide In/Hide Out button affects the visibility of the XMMS session 0 instance, not the desklet's. Previous post applies to that case.

By nucular (User), on Wed Mar 2 13:42:14 2005.

Yeah, I just realized the function of hideon/hideoff

I have xmms running on different virtual desktop which I rarely look at so I didn't notice what the button actually did. I just thought that it was ment for the desklet. :oops:

By Elmo (User), on Fri Mar 25 16:43:36 2005.

I'm not quite sure if I should write this here or in the main usage problems.
Is there any way for desklet to appear above everything? It's a bit annoying when I have to get to desktop to change actually playing song? (I'm asking about posibility, not what adesklets are meant for ;])

By syfou (Core Developer & Desklet Author), on Fri Mar 25 16:52:15 2005.

This is related to the sixth post here. I think the explanation is thorough enough, so I will not add to it.

By lyeinyoureye (User), on Sun May 22 02:43:57 2005.

Forgive me for being dense, but what do I need to change in the python script to have the bar show?

By syfou (Core Developer & Desklet Author), on Sun May 22 03:01:10 2005.

I am not sure I understand your question... By default, the bar does show: You can change this behavior and have the bar always showing following previous indications from this thread. Regards,

By lyeinyoureye (User), on Sun May 22 03:30:46 2005.

For me the bar doesn't show when I execute the script, and (so far) the only way I can make it visible is to set adesklets.window_set_transparency to (False). It works wonderfully, but it's still only visible as a black bar.
http://img.photobucket.com/albums/1003/thaticktockman/sc.png

By msavigear (User), on Sun May 22 11:13:24 2005.

Bump!

I'm having the same trouble as lyeinyoureye.

By syfou (Core Developer & Desklet Author), on Sun May 22 14:22:16 2005.

That's weird. From lyeinyoureye' screenshot, I see he has no problem running a couple of other desklets (modubar, weatherforecast, asimpleclock), and yet he experiences a display error with xmms_bar, which have no obvious reason for misbehaving -- I just re-read my code and retried it, without being able to reproduce this bug... The fact that the window has a non-null width is a good indication that the images were correctly loaded, and that the base algorithm is working. But it is clearly apparent too that the icons never get displayed on the foreground: I just do not see how it is possible right now.

A dumb question first: are you both using xmms_bar 0.0.2? I ask because version 0.0.1 had a similar transcient display problem, which I solved. If you are, I will need your assistance to perform some remote debugging. Here is a patch. Could at least one of you apply it, then post here the console output he gets from running the patched xmms_bar?

By msavigear (User), on Sun May 22 18:33:47 2005.

Hi syfou, I can run other desklets successfully. I'm travelling for a day or two, I'll check out the patch and get you the output when I get back.

By lyeinyoureye (User), on Sun May 22 19:16:28 2005, last edited on Sun May 22 20:29:19 2005.

The patch works wonderfully, thanks a lot! Do you still want the console output?

edit- It's not working now (totally transparent). But the output is the same either way... :?
This is odd, why would it work once and then revert?

Code:

Draw icon:  prev.png (2, 2, (16, 16))
Show icon from  17
Draw icon:  playon.png (4, 23, (16, 16))
Show icon from  17
Draw icon:  pauseoff.png (5, 44, (16, 16))
Show icon from  17
Draw icon:  stopoff.png (7, 65, (16, 16))
Show icon from  17
Draw icon:  next.png (9, 86, (16, 16))
Show icon from  17
Draw icon:  eject.png (10, 107, (16, 16))
Show icon from  17
Draw icon:  randomoff.png (11, 128, (20, 10))
Show icon from  17
Draw icon:  repeaton.png (14, 153, (20, 15))
Show icon from  17
Draw icon:  hideoff.png (15, 178, (12, 12))
Show icon from  17
{'stopoff.png': (7, 65, (16, 16)), 'next.png': (9, 86, (16, 16)), 'repeaton.png': (14, 153, (20, 15)), 'stopon.png': (8, 65, (16, 16)), 'hideoff.png': (15, 178, (12, 12)), 'eject.png': (10, 107, (16, 16)), 'hideon.png': (16, 178, (12, 12)), 'prev.png': (2, 2, (16, 16)), 'repeatoff.png': (13, 153, (20, 15)), 'playon.png': (4, 23, (16, 16)), 'pauseon.png': (6, 44, (16, 16)), 'randomoff.png': (11, 128, (20, 10)), 'playoff.png': (3, 23, (16, 16)), 'randomon.png': (12, 128, (20, 10)), 'pauseoff.png': (5, 44, (16, 16))}
18 images
id 0 width 195 height 16 alpha 1 filename (null)
id 1 width 195 height 16 alpha 1 filename (null)
id 2 width 16 height 16 alpha 1 filename ./icons/prev.png
id 3 width 16 height 16 alpha 1 filename ./icons/playoff.png
id 4 width 16 height 16 alpha 1 filename ./icons/playon.png
id 5 width 16 height 16 alpha 1 filename ./icons/pauseoff.png
id 6 width 16 height 16 alpha 1 filename ./icons/pauseon.png
id 7 width 16 height 16 alpha 1 filename ./icons/stopoff.png
id 8 width 16 height 16 alpha 1 filename ./icons/stopon.png
id 9 width 16 height 16 alpha 1 filename ./icons/next.png
id 10 width 16 height 16 alpha 1 filename ./icons/eject.png
id 11 width 20 height 10 alpha 1 filename ./icons/randomoff.png
id 12 width 20 height 10 alpha 1 filename ./icons/randomon.png
id 13 width 20 height 15 alpha 1 filename ./icons/repeatoff.png
id 14 width 20 height 15 alpha 1 filename ./icons/repeaton.png
id 15 width 12 height 12 alpha 1 filename ./icons/hideoff.png
id 16 width 12 height 12 alpha 1 filename ./icons/hideon.png
id 17 width 1 height 1 alpha 1 filename (null)

By syfou (Core Developer & Desklet Author), on Sun May 22 19:55:45 2005.

The patch doesn't add or remove anything in term of functionalies, it just adds up console debugging output.

From what I read, the sequence is perfectly right: every icons get loaded and drawed on foreground... I do not know what to say, and I am short of idea right now. :-( What would be useful to me from there is a direct access to the problematic system, but I do not know if one of you has the time to provide this to me: just let me know (syfou@users.fourceforge.net) so we can arrange something.

By msavigear (User), on Tue May 24 10:50:52 2005.

Hi syfou, I have the same output as lyeinyoureye, barring the expected different path information. My imlib2 is compiled with png support, so it can't be that. I'll keep looking...

By syfou (Core Developer & Desklet Author), on Wed May 25 02:10:47 2005.

Hi msavigear,

I just received this from lyeinyoureye:

lyeinyoureye wrote:


I believe the bug is caused by python or pyxmms. I recently recompiled my system with sane CFLAGS/stable program versions and the xmms bar has been running fine since.


As I said, problems related to the garbage collection and such are unlikely to be caused by adesklets, simply because this is a high-level pure python package. I am sorry for suggesting something similar, but my best guest for a fix would probably be to recompile from source python, possibly pyxmms... :-(

By msavigear (User), on Wed May 25 06:02:12 2005.

Hmmm, my python version is conservatively compiled and marked stable. I might try to diagnose the actual bits I'm using. I have established that xmms_bar is receiving the mouse-over notifications it expects.

To be honest, what I really want is not the controls (I have those as hot keys) but a visible ticker of the current song plus buttons to show/hide the xmms windows. I should really code my own up.

lyeinyoureye: can you tell me what python/pyxmms/imlib2 versions you are using?

By syfou (Core Developer & Desklet Author), on Wed May 25 13:01:25 2005.

msavigear wrote:


I have established that xmms_bar is receiving the mouse-over notifications it expects

Yes -- this is the strangest thing: the fact that you have the same output than lyeinyoureye is a clear indication that the code performs as expected (?!): all images get properly loaded, then displayed on foreground.

By lyeinyoureye (User), on Thu May 26 01:19:53 2005.

Python-2.3.5, pyxmms-2.02, and imlib2-1.2.0-r2.

Edit- Now it won't show when I launch it, however if I logout and restart X it shows when adesklets luanches it iva ~/.xsession? :?

By syfou (Core Developer & Desklet Author), on Thu May 26 01:27:47 2005.

You can as well just retype:

Code:


adesklets



At any time on a pseudo-terminal while under X, all it will also relaunch every registered desklet. This is the very same operation performed by starting it though $HOME/.xsession.

By eNTi (User), on Tue Sep 20 03:32:15 2005.

hi, maybe a few things, i'd like to see:

- xmms is not being started by the desklet, would be nice, if that could be implemented.
- the show/hide button shows/hides only the xmms main window, but not any other windows (playlist, equilzer). would be a good thing, if that buttone would do that too.

By syfou (Core Developer & Desklet Author), on Tue Sep 20 14:39:18 2005.

eNTi wrote:


xmms is not being started by the desklet, would be nice, if that could be implemented.

Well, I am not fond of this behavior (it is not difficult to start it by yourself if you want too), but here is a patch.

eNTi wrote:


the show/hide button shows/hides only the xmms main window, but not any other windows (playlist, equilzer). would be a good thing, if that button would do that too.

That should not be difficult either, but I do not have xmms installed right now, so it's not possible to test any code; I suggest you hack it yourself: it's a two-liner, really. Here is the PyXMMS documentation; the functions you are looking for are pl_win_toggle() and eq_win_toggle(). You want to modify the _XmmsInstance.hide() method around line 154 from xmms_bar.py (version 0.0.2). Yours,

By eNTi (User), on Wed Sep 21 04:46:20 2005.

ok, i've hacked the source, not understanding too much of python yet, maybe you can give me short ride here with the following problem:
if i merley want to hide / unhide "activated" windows (let's say i've opend the play list window and the main window usually and leave the equilizer "off == not activated"). the current code will hide both "activated" windows and unhide the "not activated" (the equilizer). as i understand this happens, because there's no difference between "hidden" and "not activated".

as of know i've just changed the line:

Code:


def hide(self):
        self.xc.main_win_toggle(not self.xc.is_main_win())


to

Code:


def hide(self):
                        hide_all = [        self.xc.main_win_toggle(not self.xc.is_main_win()),
                                                        self.xc.pl_win_toggle(not self.xc.is_pl_win())
                                                        self.xc.eq_win_toggle(not self.xc.is_pl_win())
                                                        ] 


which of course doesn't differntiate between "hidden" and "not activated". if i just wanted to switch the playlist and main for all times, always ignoring the equilizer, i would just delete the last statement with eq_win_toggle, but that's clearly not what i want to achieve. i want to make it more flexible and give the windows two different states, like "activated/not activated" and "unhidden/hidden". is this possible and doable with a minor, a normal or a major headache?

By syfou (Core Developer & Desklet Author), on Wed Sep 21 14:13:24 2005.

I read you many times, and I think your initial mental model of the situation was more complex that required. As you said yourself, there is no need to make a distinction between "not activated" and "hidden" states -- there are three windows: main, play list and equalizer, and only two possible states: "on", and "off". When "on", a given window is on the screen, and the associated is_*_win() returns True, conversely when "off".

What policy you want to achieve is up to you, really. The _XmmsInstance.hide() method is activated when you press the button, no matter of his state. That's why it was reasonable for a single window control to use a simple toggle. From what you describe, it seems that what you want would be to force the three windows to be put in the inverse current state of the main window:

Code:


def hide(self):
    state = not self.xc.is_main_win()
    for win in ('main', 'pl', 'eq'):
        self.xc.__dict__[win + '_win_toggle'](state)       


I hope this helps. Yours,

By eNTi (User), on Wed Sep 21 14:25:51 2005.

uh... what is.

Code:


        self.xc.__dict__[win + '_win_toggle'](state)       


__dict__ seems to be unkown.

By syfou (Core Developer & Desklet Author), on Wed Sep 21 17:42:06 2005.

After waisting one hour reinstalling the xmms player, I confirm that the previously suggested modification (two posts above) works flawlessly on my side, under both python 2.3.5 and 2.4.1. I don't believe there were any error.

By eNTi (User), on Thu Sep 22 02:10:18 2005.

sorry to hear, that it actually took you a whole hour to install xmms ;). my i'm an idiot and wrote ___dict___ instead of __dict__ in the python script. now only one thing remains. the equilizer window will pop up, even though i don't want it to. so i might have to add some state variable if it ever was unhidden by the user before and then i'm ready to go :).

By Noobuntu (User), on Tue Dec 6 07:30:35 2005.

I get the following error when I try to install xmms_bar:

Code:


Traceback (most recent call last):
  File "./xmms_bar.py", line 49, in ?
    class Events(adesklets.Events_handler):
  File "./xmms_bar.py", line 71, in Events
    class _XmmsInstance:
  File "./xmms_bar.py", line 79, in _XmmsInstance
    import xmms.control as xc
ImportError: No module named xmms.control



I am not root and I have xmms installed on a different directory than the standard. Might that be the problem? Sorry, I am no expert in python and I could not figure out in the script what was wrong...

By MadOtis (User), on Wed Dec 7 10:48:45 2005: No icon display in xmms_bar, but bar is running and working!.

I'm not sure what is happening, but, I installed the bar (registered), re-started adesklets, saw a blank area at 0,0... I can right-click on it and 'Move', 'Restart' or 'Quit'... I can click on different areas of the blank area and xmms reacts accordingly (stops, starts, next track, etc)... but no matter what I do, I cannot get the icons to display. I have verified that they are indeed in the desklet's home/icons folder, all of them are there, they can be viewed through gimp or image viewer.

I don't know how to view any output from adesklets, so, I don't know what errors are displayed (if any).

If it helps, I am running on Nautilus (Gnome) and I have 8 other desklets running just fine.

Thanks in advance!

By syfou (Core Developer & Desklet Author), on Wed Dec 7 15:35:55 2005.

MadOtis, what versions of Python and adesklets are you running? It displays fine here with Python 2.4.2 and adesklets 0.4.12.... You can get the potential output doing a test on the script. Under Gnome:

Code:


adesklets --killall
./xmms_bar.py --nautilus
Do you want to (r)egister this desklet or to (t)est it? t
Now testing...
[...]


Yours,


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.