
Modified DynBar
Source (link to git-repo or to original if based on someone elses unmodified work):
Thanks to:
Original DynBar: http://www.kdelook.org/content/show.php?content=5862
OSXDocker: http://www.kdelook.org/content/show.php?content=6072
Requires Superkaramba 0.25.
Basically, this is a quicklaunch/task-bar similar to the one built into Mac OS X. It features smooth zooming and automatically expands as new tasks open. Also contains a clock, desktop-switching, and some xmms controls.
Fully customizable. You can easily add/remove icons by going into the Files subdirectory and changing the files there; just edit one to see the simple format to use.
You will need to edit the .py file to change some of the paths referenced near the top.
I'm made this mainly for myself, but if you have anything you'd like to see added, please mention it below and if it interests me I'll give it a shot.
Requires PyXMMS, get it at: http://www.via.ecp.fr/~flo/index.en.html#PyXMMS_and_PyXMMS-remote
Version 0.91: (mostly bug fixes and speedups)
-Fixed CPU utilization problems, unfortunately this means the current desktop is not highlighted - all desktops look the same. If you want the old functionality (at the cost of using up some CPU power when idling) edit the theme file - just comment out one line and uncomment another (documented in the file). I also got rid of the background behind the clock since that was also a CPU hog, though again uncommenting one line in the .theme file will put this back in.
-Fixed bug where it crashes when XMMS is not running but the bar is enabled - now in order to enable the XMMS bar you must have XMMS running at startup
-Added support for multiple AltName= lines in .desktop files - note The GIMP sample in the Files/ directory. This means that programs with weird task naming schemes (like The Gimp) can be made to be grouped.
-Fixed a bug with .desktop files that have multiple name= lines, now it will ignore all lines after the first (mentioned in one of the comments below).
-Got rid of the automatic reloading when your Files/ directory changes - this didn't really work properly anyway.
-Fixed a few other little things.
Version 0.9:
-Changed default background to be solid, so now it runs MUCH faster and looks pretty good (screenshot 2). To change the background back to one of the transparent ones (which do look a bit better) edit AriDynBar.theme and change the path of the first three images (there are two transparent backgrounds also included in case you don't mind the slower speed and want the transparency back).
-Fixed a few random bugs.
If you tried the theme before and thought it was too slow now would be a great time to try it again; it is a LOT faster now thanks to the solid background.
Version 0.8:
-Fixed crash bug for users that do not have an icon called "x.png" to use as default - it will now try "xapp.png" and then if neither are found it will hopefully not die.
-Changed XMMS section to use PyXMMS, and moved a few icons around. The XMMS section is quite a bit cleaner now as a result (note updated screenshot 3). Note this adds a new requirement - you must have PyXMMS.
Version 0.7:
Some relatively big changes, including organizing the code a bit better (though it's still ugly as hell). Please post comments with opinions.
-Added in a little overlaid text menu. See screenshot #1. The way this works is that if you left-click on most of the icon you will launch a new instance of it, while if you click on one of the text labels (highlighted in green when you mouseover them) you will switch to that particular instance. Of course, you can still also use scrolling to switch without needing to be as precise with the mouse. Oh, and if you think the text is ugly, you can turn this off from the config menu.
Unfortunately, this meant needing to get rid of the change of the mouse cursor as a program loads, but hopefully I'll be able to get that back in eventually (maybe if some extra features are added to Superkaramba, or maybe if I figure out some other way to do it).
-Also added some configuration menu stuff; right-click and go to the configuration menu to enable/disable a few features that can speed up the bar a bit.
Version 0.6:
-Shows song title in XMMS section (see screenshot 3). It's a bit ugly but at least it's functional.
-Option to disable background image, which speeds it up A LOT (but isn't as nice looking - see screenshot 2). Change enableBg to 0 to disable it.
Pre-0.6 log deleted...
Ratings & Comments
35 Comments
I have the latest version of SuperKaramba. When I loaded the theme, all that came up was a black semicircle which looked like (| , the time, another black semicircle which looked like |) and the desktops. Where are the programs? I haven't changed anything in the .theme or .py scripts. What do I do? Thanks.
micha@linux:~> superkaramba /home/Micha/Superkaramba/AriDynBar/AriDynBar.theme Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] 'import site' failed; use -v for traceback superkaramba: TaskManager::TaskManager() Traceback (most recent call last): File "/home/Micha/Superkaramba/AriDynBar/AriDynBar.py", line 18, in ? import glob ImportError: No module named glob Help :(.
micha@linux:~> superkaramba /home/Micha/Superkaramba/AriDynBar/AriDynBar.theme Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] 'import site' failed; use -v for traceback superkaramba: TaskManager::TaskManager() Traceback (most recent call last): File "/home/Micha/Superkaramba/AriDynBar/AriDynBar.py", line 18, in ? import glob ImportError: No module named glob Help :(.
I see how it would easily do that, but what about separating the list of AltNames with comma's and do something similar to "explode" in Perl? I've never programmed in Python before (well, before that little 4 lines I wrote) so I don't know how to do it right... The real problem for me is that the GetTaskInfo routine in Karamba is only pulling the FIRST task class. If you check the classes for instance used in The Gimp, all windows have a secondary class of "Gimp" but you can't match on those because Karamba won't pull that data.
Oh, the AltName as multiple lines would be good too I guess... ;-)
I had problems getting it to recognize certain apps, especially like The Gimp which opens multiple windows with different main class names. Here's a change I made to have it recognize mo betta. You can also use multiple class names in the "AltName" field in the icon setup and it will recognize them... I hope this is readable... # look for this routine and change for i in range(iconCount): if taskName == commands[i] or taskName == altnames[i]: #print "found: " + taskName running[i] = 1 tasks[i].append(task) karamba.showImage(widget, arrows[i]) found = 1 break # Now begins my additional routine: if altnames[i] != '' and altnames[i].find(taskName) != -1: #print "found: " + taskName + " contains ." + altnames[i] + "." running[i] = 1 tasks[i].append(task) karamba.showImage(widget, arrows[i]) found = 1 break if not found: # the not-found portion continues here... You can see I added one subroutine in the middle there after the normal icon checks to look for the class name as a substring in the icon setup. You know without tabs this is almost impossible to read...
Cool, good idea. It'll be in the next version, along with an icon for The GIMP to demonstrate its use.
Actually, after playing around with having this in for a little bit, I'm no longer so sure that I want to use this implementation..the problem is that now it will group together unrelated tasks which happen to have some common letters: it's putting my gvim and gv in the same group. I think instead I will give the option to specify multiple AltName= lines in the .desktop file and to store those as a list.
I love your setup, but it doesn't work too well by default with dual monitors.. Could you use the xinerama support that karamba has to determine if the user is running two monitors, and if they are, center the bar across xinerama screen 0 instead of centering it across the both (the bar gets split in half by each monitor)
I don't really know anything about how this would work in Superkaramba, and have no way to really test anything out. Do you know of any other scripts that already do this that I could model it after? Thanks.
You should look into the pyxmms python extension for your xmms section -- it's a lot easier to use than using os.system("xmmsctrl ...") Just do a google search for pyxmms.
Good idea, I was definitely thinking that it would be a good idea to completely revise that area, so I'll definitely have to look into this PyXMMS. Thanks! -Ari
Done. Enjoy :) -Ari
Very nice! I'm sorry I don't have my PC at the moment to continue developing DynBar, but I hope to get it back soon. :)
I "upgraded" from DynBar to this and just copied over the "Files" directory to keep the same shortcuts on the menu. That seemed to mess everything all up.. stuff wouldn't execute properly, text labels were wrong, etc. Would it be possible to make it ignore all the extra lines in the shortcut files? I make them by using KDE's Link to Application function and it adds all the extra stuff in. It seemed to work properly in DynBar, and makes it much easier to add new applications.
I actually didn't really change much from the .desktop file loading from the original DynBar...all I did was add in the ability to add the line AltName= which I find pretty handy, and I changed the way it loads in icons a bit. It should still ignore all the extra lines without a problem. Could you be more specific about what is happening? What files are causing problems and what are the exact problems? Feel free to e-mail me if it's easier (so that you can attach the files that are messing it up), or just paste in the contents of the files from the Files/ directory in here. -Ari
Note for anyone else having any problems with this: Perry and I worked out what the problem was, and now I have a fix for it which will be in the next version, so sit tight...
It's fixed in version 0.91.
i mean: that you can add not only the start menu to the bar! i meant that you can add buttons that open sunmenues! like the submenues you have in startmenu! when you say "add application button" to kicker then you can say "add this menu" !! and that menu i want to have in dynbar! greetz cosmo
I'm not sure how feasible it would be to make some sort of graphical sub-menu system, and while it sounds interesting, I don't think I really have the time or inclination to do this. However, check out the new version. I realize this overlaid text menu isn't the feature you wanted but somehow your post helped spark the idea. Perhaps I could add in a way to let you add in entries into that list of text options so that it would function in a way similar to what you were thinking (ie, instead of just having a list of text of instances to switch to, there could be text for programs to launch)...would that be useful at all? (no promises, though) -Ari
Couple of questions, sort of related to this post. 1. Is it possible to change the colour of the text that pops up? I can't find anything obvious in the python script, although I know very little about python, so might need a little guidance on where to find this. 2. This theme keeps my cpu at about 15%. Is this normal? Is there anyway to reduce the cpu usage? Otherwise a fantastic theme. Very happy with it. Matt
>> 1. Is it possible to change the colour of the text that pops up? I can't find anything obvious in the python script, although I know very little about python, so might need a little guidance on where to find this. I'll try to remember to make this variable to make it easier to change in future versions, but for now if you just search for "255" you should find a few lines where it sets the text color...there are 3 numbers, the first is amount of red, the 2nd is amount of green, 3rd is amount of blue. The line with 255, 255, 255 is all white, if it was 0, 0, 0 it would be black, 255, 0, 0 is red, 0, 255, 0 is green, etc. >> 2. This theme keeps my cpu at about 15%. Is this normal? Is there anyway to reduce the cpu usage? The easiest way would be to turn off smooth zooming or (probably more desirable) to disable the background image, both of which you can now do via the right-click menu..Of course, it will look a bit uglier that way. Hopefully I'll get future versions a bit more efficient, but in all likelihood it will always be a bit of a cpu hog with all the effects on.
Hey just wanted to let you know the CPU over-utilization problems are more or less fixed in the latest version (0.91) so check it out. -Ari
it would be nice if there is any possibility to add submenues to the bar like real kicker can do! so i can add a button which opens for example the editors menu! this feature is useful for me because i use a lot of apps and i have them categorized in submeues and put the menues to kicker! is this feature planned, or does it allready exist, or or is there any possibility to do it? greetz cosmo
I'm not sure if I completely understand what you're thinking, but you actually just gave me a kind of interesting idea that I might be able to get working. I'm picturing some kind of text menu that shows up overlayed over the image when you move your mouse over it. I'll see if I can make some progress on that this weekend.