IRIX and Software

iconbar - Page 1

INTRODUCTION

I've been working on a small desktop application called iconbar which I hope could become a replacement for the 4dwm's (mwm's) iconbox application. This effort was mostly inspired by finding the Nekochan.net site and performing the Nekochan "transformation" on my desktop. By that I mean: installing a background image, adding aterm transparency, changing the desktop borders, nixieclock, etc. It seem to me a better icon management utility was also required to complete the make over. Another catalyst was a discussion here in the forum that stated that SGI has pretty much given up on it's desktop development. While initially a depressing thought, I also felt empowered by all the knowledgeable folks here who were compiling and writing their own freeware. I also wanted to contribute to this community and help keep IRIX alive.

BACKGROUND

I had some experience with Motif programming, but had no idea how to access the icons of other applications...in fact I didn't quite understand the distinction between the X server and the window manager. I went on a massive web search for info on how to do this and emailed all of the established X gurus, several of which were kind enough to reply, but the universal answer was the icon pixmap of one application cannot be retrieved by another. The one exception to that was Antony Fountain who provide me a sneaky way to intercept the data but I held it in reserve since I felt it was too system intrusive and might put some folks off. So I resorted to doing a cheesy screen capture of the 4dwm icon window in order to get something up and running. (I also tried re-parenting the icon window, but that too was messy). The main draw back to the screen capture approach was that a "quick" minimize of each application was necessary in order to copy the pixmap which induced a "flicker" in each application at startup. By the way, "flicker" and "quick" are relative measures since if depends on the speed of the display's X server and if done too fast resulted in a garbled copy of pixels. Anyway, I had that version running on my machine for a few weeks but felt it was too kludgey for release. What I did learn was that even is this intrusive and unstable state -- the iconbar was nice to have around. Even when it crashed a few times a day, I kept restarting it because I missed the convenience it provided. I hope you all agree.

Meanwhile I got some books on X from the library and concentrated on understanding how a window manager works under X. I learned a ton -- chiefly that a window manager is just like any other X client with one exception: it does substructure redirection on the root window in order to intercept the layout info for the other children of the root window (i.e. all top windows). Unfortunately for me, only ONE client at a time can ask for substructure redirection on a particular window and since I wanted to cooperate with 4dwm not replace it, I thought I was stuck.

Instead I turned to the other source for icon pixmaps that 4dwm uses, the RGB images in /usr/lib/images (actually it first looks in $HOME/.icons). I figure I could force users who cared about the screen capture "flicker" could duplicate the icons' pixmaps manually and place them in one of the search directories. The problem here was how to read SGI's RBG image format. You may have seen my post at http://www.nekochan.net/phpBB2/viewtopic.php?t=738 which details some of my frustration and eventual success -- in short I looked for a conversion library and out of disgust with the C interface of SGI's IFL manually wrote a routine (By the way, I do like the RGB format).

In parallel, my late night reading paid off. I found that the icon pixmap is sent to the window manager one of two ways: as an icon window hint or as a pixmap hint. The O'Reilly X books showed me how to read those hints and I was off! (Actually, so far I've only implemented the latter which seems to be a much more commonly used method -- a notable exception is SGI's mailbox application). I am very proud of have implemented this, precisely because it does what I was told from the beginning could not be done.

An unexpected payoff occurred with the gnome applications that have long given me trouble on my Octane2 with V6 graphics (see http://www.nekochan.net/phpBB2/viewtopic.php?t=761 ) -- the absent/garbled icons are caused by the gnome application telling the window manager that it's icon pixmap has a depth of 30 bits (i.e. the best visual for the system) instead of the correct 24 bits. I could plainly see the numeric difference in the WMHint property run on a system with Vpro graphics versus an older system with SE graphics. Mystery solved but problem not fixed!

One last piece to the story. Motif expert Antony Fountain of "Ask Antony" fame pointed out that the big SGI icons are probably a bit dated in appearance and that today's users would prefer something smaller. I was also thinking along these lines having seen (but not used) the Mac OS X solution. Antony show me how to scale XImages, so the magnification/demagnification of the icons is rightfully credited to him.

DOWNLOAD / INSTALL

I have made a tardist of the alpha test version for use with the IRIX Software Manager. By default it selects a mips4, Motif 2.1 version of the software (I built it under 6.5.20f using the MIPSPro 7.3 C compiler). Folks with machines that predate the R10000 and/or do not have the feature stream with Motif 2.1 loaded can optionally select a mips3, Motif 1.2 binary executable instead.

down load it from: http://www.nekochan.net/wiki/downloads/iconbar-alpha.tardist

After install, just type (with /usr/local/bin in the execute path) iconbar to run, or iconbar -help for a list of options. It's a good idea to turn off the 4dwm iconbox application first which can be done from the toolchest (Desktop->
Customize->Windows->Display Windows Overview[uncheck]).

To use iconbar, bring the pointer down to the 1-pixel thick line at the bottom center of the screen. It should like like this after it pops up:

http://www.nekochan.net/wiki/gallery/album36 ... crn?full=1

You get a pop-up menu by right clicking on an icon.

This is an alpha test version so don't expect too much. I'm hoping a few interested individuals will install this and help me to debug and improve it. I know for a fact that it crashes - I'm just interested in when . I also know that some icons get garbled (see CAVEATS below) just tell me which applications. I'm also VERY interest in how you would like the interface modified.

I'm thinking for now, this thread in the forum is good place to post bugs, issues and ideas and since it is public, might eliminate some duplication of effort.
ROAD MAP

I plan to issue the beta test release with source code, once I've had a chance to clean it up some. Also, the popping up and down of the magnified icon windows needs an overhaul since it clearly is generating too many expose events that slow the whole thing down. Finally, the main engine for finding/removing icons is a search of the root window's descendant tree. This search is triggered by a timer (right now set for 200 ms) but I feel that this is inefficient and CPU costly. It should be X event driven, but that means modifying the default Xt event loop. That is the next project I will probably tackle but it may take some time. I will probably will not have any significant free time to work on this project for at least another month. So don't expect a beta release before then.

Here's a few other idea that I'd like to explore some time in the future:
    - anti-aliasing of the demagnified icon images
    - a mailbox notifier
    - options for the location and size of the bar (not just bottom center)
    - a means of specifying which applications to exclude (e.g. your desktop clock)
    - a means of specifying a preferred sorting (i.e. I like the Mozilla icon in the first slot when it open)
    - variable icon widths
    - a hook into the toolchest
    - some transparency effects
    - multiple desktop (desks) handling (i.e. different bars on different desks)
    - stacking icons vertically that are of the same class (i.e. all the Nedit icons collected together with a pop-up sub-bar)

Let me know what else you all would like to see. After the source is available, perhaps a CVS server could be set up, although I have no idea where or how.

CAVEATS

Iconbar will crash . When it does, you may have to restart the window manger by System->Utilities->Restart Window Manager.
    Multiple windows opening an closing can cause a core dump : Because of the timer driven structure, I believe that window hierarchy data becomes obsolete while the program is trying to use it. It needs better error handling and/or an event driven model as discussed above.

    Icon image garbled : when the program does not find an icon first by searching the Window Manager Pixmap hint, next by searching $HOME/icons directory and last be searching the /usr/lib/images directory -- it defaults to the old screen capture method which only works some of the time. Incidentally, this sequence of searching for the icon image could be changed from the 4dwm default so that the existence of a user icon file over rides the one the application sends to the window manager. I would like some input regarding this design decision - the down side of switching order is the manual (user) maintenance of the icon image file (i.e. updating).

    Animated icons don't : For now, I have ignored the method by which an application supplies an icon window under it control for animation (e.g. SGI mailbox).

    Missing applications : I have explicitly told the program to ignore the following named applications for now: ToolChest, iconbox, iconbar, nixieclock, gr_osview, xeyes, Desks Overview, top, bottom and xbiff.

    Multiple desks : I haven't looked into it's performance with multiple desk at all, it on the to do list.




Sorry about the long message. Thanks and I hope you all find this little utility useful.

-squeen
As you mention, it doesn't support multipledesktops sanely.

Two mutually exclusive suggestions for this:
* Only show the icons from the current desktop
* Switch desktop on select

Other than that, I've only a few minor niggles:

* There's no option for making popup nonanimated - it's a little juddery for me.
* The black outline round a selected icon impinges onto the desktop when the bar is hidden.
* It seems a little wide - there's a grey space for me on the right hand side.

However, *very* good work.

It's nice to see the IndigoMagic experience improving, even if it's not by the hand of SGI.

I've not really looked at Motif - how hard is it? Are there any good UI designers for it. I've had an idea I've wanted to do for quite a while.
--
lisa
Ooh, another interaction with multiple desktops. Occasionally, on quit it pulls all the windows running onto the current desktop.
--

lisa
Yep, nice work on this one Squeen, I can't wait to get home and give it a try.
Here's a small thing that seems unnecessary with most iconbars I've seen...dynamic resizing!

When you mouse over an icon it zooms up, that I like...what gets me is that the bar resizes, pushing all the other icons out a bit...

The reasons I'm against this are:
1) Seems like unnecessary work...all those pixmaps have to be moved, redrawn etc
2) If you then try to go to the next icon over, a lot of times you'll go TWO icons over, because you leave your icon, it shrinks the bar back down, and now you're further over than you would have been...it's an issue of trying to hit a moving target so to speak
3) Biggest reason, is it causes slowdown (not only in your iconbar, but in pretty much every icon bar I've tried, including on my 1+ ghz PC...)

Now, not trying to bash what you've done, really that's my only functionality complaint in an otherwise nice app :)

Next question is, are you going to take this to a further level with integrated pager, clock,etc. or leave it strictly an icon bar and let other programs deal with that other stuff?
How nice to get such a quick response. Richard Stallman (GNU) is correct in that the best part of software is sharing it.
Here's a few responses:

lisp:
Two mutually exclusive suggestions for this:
* Only show the icons from the current desktop
* Switch desktop on select


How about a color code for icons on other desks with a toggle on whether or not they are displayed? Also, I was kinda thinking (long term) about some buttons like the gnome bar that switches between the desktops.

I've not really looked at Motif - how hard is it? Are there any good UI designers for it. I've had an idea I've wanted to do for quite a while.


I think Motif is very easy to learn - X designer is a commerial GUI designer, but I've never used it. The best book I've found (almost universally respected) is Douglas Young's The X Window System, Programming and Applications With Xt . Young worked for SGI when he wrote it (and then went on to create Viewkit which I haven't used because of my distaste for C++). By borrowing from the code in the book you'll have working applications that you barely understand in no time (and understanding will also come with time). No other reference besides the man pages will ever be needed for most applications. Later, you might want to go to a lower level and learn Xt and X lib - something I'm just starting to do.

on quit it pulls all the windows running onto the current desktop


Good catch - I really need to spend a bit of time understanding multi-desks and 4dwm.

* There's no option for making popup nonanimated - it's a little juddery for me.
* The black outline round a selected icon impinges onto the desktop when the bar is hidden.
* It seems a little wide - there's a grey space for me on the right hand side.


1) I think the jitter is the same issue vegac is addressing (see below).
2) I'm not sure what you are describing here - can you provide more detail or an image?
3) Yes, the gray space has got to go.


vegac:
dynamic resizing!

When you mouse over an icon it zooms up, that I like...what gets me is that the bar resizes, pushing all the other icons out a bit...

The reasons I'm against this are:
1) Seems like unnecessary work...all those pixmaps have to be moved, redrawn etc
2) If you then try to go to the next icon over, a lot of times you'll go TWO icons over, because you leave your icon, it shrinks the bar back down, and now you're further over than you would have been...it's an issue of trying to hit a moving target so to speak
3) Biggest reason, is it causes slowdown


I agree and this, I suspect, will be the most common complaint (I run it on a top-end machine so it's a bit more tolerable). This is the area that needs the most work. I'm not really happy with the current result. In the short term, if you left-click on an icon to get the menu and turn off magnification, dynamic sizing will go away. However, I am hopeful that a smart resizing routine can be found that solves this problem. At least from what you say, this application is not the only one facing the dilemma.

Next question is, are you going to take this to a further level with integrated pager, clock,etc. or leave it strictly an icon bar and let other programs deal with that other stuff?


I wouldn't be against any of the things you mention. Once it is completely stable, adding features would be next. Once the source code is out there, perhaps others can aide here as well (plugins?). I don't really know how to proceed since this is my first publically released application.
How about a color code for icons on other desks with a toggle on whether or not they are displayed? Also, I was kinda thinking (long term) about some buttons like the gnome bar that switches between the desktops.


It'd be good if this was configurable - I prefer to switch desk by hotkey, so buttons would be wasted real estate.

1) I think the jitter is the same issue vegac is addressing (see below).


Not quite - I was reffering to the part where the bar scrolls on and off the screen.

2) I'm not sure what you are describing here - can you provide more detail or an image?


Right, pop the bar up, and sweep the mouse across. I get a black square outline around the icon the mouse is over. Now, with an icon outlined, move the mouse quicky up. The icon is still outlined. A few seconds later the bar retracts, but the black outline is high enough up to still be on the screen. Indeed, this time, I can see a thin line of grey appearing on the very bottom line of the screen. Perhaps an invisible window a bit like X2X and X2VNC use may be the way forward?

I wouldn't be against any of the things you mention. Once it is completely stable, adding features would be next. Once the source code is out there, perhaps others can aide here as well (plugins?). I don't really know how to proceed since this is my first publically released application.


I'd strongly recommend dynamically loadable plugins. Indeed, it may be an idea to generalise the bar, so the icon part is itself a plugin. If done properly, this should minimise the resources needed and maximise the functionality available.

A little bug I've noticed.

If you start up the launch program, and then start iconbar, you get:

Code: Select all

**geticon: unable to find Launch icon data...falling back to screen capture!

attributes = 97 x 99
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  73 (X_GetImage)
Serial number of failed request:  766
Current serial number in output stream:  766



Question: (I've not checked myself) - what happens if a modal dialog pops up?
--

lisa
Other fun - it only appears on the desktop it's invoked on. The X2X/X2VNC solution would fix this, too.
--

lisa
quick 1 second feedback before work:

1: love it :)

2: add xclock to the list of things not grabbed (sif nixie clock. me am teh old skool. ugh)

3: clicking an icon that is already focused and not minimised should brobably then minimise it ala winxx

4: transparent aterms focused usign the iconbar sometimes get back the odd 'transparent titlebar' behaviour (from having a custom set title) un till unfocused and refocused

5: did i mention that i love it?

:)

incredibly cool work


- NauSeuM
ubi dubium ibi libertas
Would it be feasable to use a zoom feature somewhat like the one used in the Windows Character Map utility? This will let you click or drag the mouse across and enlarge only the selcted item and it overshadows the surounding items until you pass to the next item or click on it again. I'not implying using that exact feature, but it would be a good basis for a starting point.

My only concern iwth this app is that it has the potential to end up like the tray in Windows. I'm very happy not having a tray anymore and would like it to be more like the Dock in OSX. The Dock in OSX has alot of features that are nice and some that are silly wastes of CPU cycles that you only use when showing it off. All in all it's a great start to add in some shortcuts for us lazy folk that haven't set up or taken the time to memorize hotkeys.

Very cool app, BTW :D
A couple of replies:

lisp:
Not quite - I was reffering to the part where the bar scrolls on and off the screen.


Oh, I understand and that would be simple to do.

Right, pop the bar up, and sweep the mouse across. I get a black square outline around the icon the mouse is over. Now, with an icon outlined, move the mouse quicky up. The icon is still outlined. A few seconds later the bar retracts, but the black outline is high enough up to still be on the screen. Indeed, this time, I can see a thin line of grey appearing on the very bottom line of the screen. Perhaps an invisible window a bit like X2X and X2VNC use may be the way forward?


Yes, right now the app requires a 1-pixel wide windows at the bottom of the screen to monitor for Show/Hide -- this could be changed to a transparent window in the pop-up plane which would eliminate the gray/black line. Also, probably not too hard a change

If you start up the launch program, and then start iconbar, you get:
Code:
**geticon: unable to find Launch icon data...falling back to screen capture!


attributes = 97 x 99
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 73 (X_GetImage)
Serial number of failed request: 766
Current serial number in output stream: 766


This is a draw back associated with the screen capture mechanism. If the program crashes, leaving the icon window unmapped you can get errors like this. A restart of the window manager will overcome it for now, but an X error handler in the code (or a removel of this fallback method in favor of installing the default icon) should fix it in the beta release.

NauSeuM :
add xclock to the list of things not grabbed

The beta release could easily have a resource file (.iconbarrc?) in which a user can list ignorable apps and some other preferences and/or a command line option.

clicking an icon that is already focused and not minimised should brobably then minimise it ala winxx


I would still want the option of having that raise the window to the top of the stacking order. Maybe a click vs. double click thing.

transparent aterms focused usign the iconbar sometimes get back the odd 'transparent titlebar' behaviour (from having a custom set title) un till unfocused and refocuse


Hmm..It sure does. I don't know what, if anything, I could do about that.

Shtoink:

Would it be feasable to use a zoom feature somewhat like the one used in the Windows Character Map utility? This will let you click or drag the mouse across and enlarge only the selcted item and it overshadows the surounding items until you pass to the next item or click on it again.


Yes. I'd thought of this as a work around and haven't ruled it out, but I was also thinking of having the shrink ratio (currently 75%) customizable in the future. If it were too small, the full size icon could hide its neighbors. I'm hoping that there is a better solution.

My only concern iwth this app is that it has the potential to end up like the tray in Windows. I'm very happy not having a tray anymore and would like it to be more like the Dock in OSX.


I also have a reluctance to make it an application launcher -- if that is what you mean. Could you be more specific on what you think the differences are? I don't have access to a Mac.




This is really great feedback. Keep it coming! BTW a kill -HUP will cause the program to exit normally.
Th eproblem with launch isn't quite like that. Launch is operating perfectly. I suspect it may just not have an icon, or may object to being minimised.
--

lisa
Minimizing Launch does in fact just show the generic icon, BUT when I ran launch the iconbar didn't seem to have any problems...

I'm guessing the problem with the screenshot thing is that it's trying to take a shot in a specific format and you have a different video format, or something to that nature?
Unfortunately, launch does not misbehave on my devleopement system although I know the current method is prone to these types of errors. If this is a pressing problem for you lisp I could just eliminate the screen grab fallback and instead go directly to the default icon image from /usr/lib/images and post an updated binary.

Also, I have access to an O2 R5K, 195MHz machine. I'll try running it with launch on there. Which variant do you have installed the mips3 or mips4 binary?
I tmya have been because it was on a different desktop.
--
lisa
squeen wrote: Also, I have access to an O2 R5K, 195MHz machine. I'll try running it with launch on there. Which variant do you have installed the mips3 or mips4 binary?


I'm afraid I was lazy and just installed whatever came as default
--

lisa
Great little program! I've installed this on all my systems. This could be a must-have program ;)

Anywise, here are some of my thoughts. I should say that I really do believe in the UNIX philosophy: small is beautiful, do one thing well, let the user choose, build a filter, etc.

Some repsonses to your roadmap list:
    Icon antialiasing would be great.
    I'd like to see the default IRIX mailbox used, especially if it can be animated on the iconbar.
    Options for iconbar location and scale would be great. One thing you may want to look into is Xinerama aware code, so that ppl using 2 screens don't have the iconbar split between them.
    Exclude icons by dragging them off the bar and onto the desktop &/or through a menu option saved to a .iconbar file.
    Lockable icons as well as a few basic sorting options.
    I'd prefer that iconbar not be a program launcher. Toolchest does a great job of that.
    Optional transparency effects would be cool.
    Vertical icon stacking is another great idea.
    Consider Handling multiple desks just like iconbox:
      Icons on other desks are shown by an concave icon*.
      Icons on the current desk are shown by an embossed icon*.
      Icons on the global desk are always shown by an embossed icon*.
      Icons remain on the desktop where they originated unless explicitly moved.
      Icons on the current desk are restored with a single-click.
      Icons from other desks are restored by double-clicking but this does not break them away from their original desk.
    * See my alblum to see what I mean about iconbox: http://www.nekochan.net/wiki/gallery/album43
And some additional ideas of my own:
    Icons can be reordered by dragging.
    Clicking on the icon of a open window minimizes it to the bar (for symmetry's sake)
    Iconbar minimum & maximum size constraints.
    Scrollbar/arrow button for when there are more icons than screen space.
    Use of a more standard window with a title bar and menu (like ov).
    Options to turn off the title bar & menu (like ov).
    Cascading menu for controlling options and performing actions (like ov).
    Standard right click menu for icons (like iconbox).
    Keyboard shortcuts.
    Clearer divisions between icons.
    Option for auto-hide.
    Option for always-on-top.
    More advanced window management (tile, cascade, fit, snap, etc.)

squeen wrote: Missing applications : I have explicitly told the program to ignore the following named applications for now: ToolChest, iconbox, iconbar, nixieclock, gr_osview, xeyes, Desks Overview, top, bottom and xbiff.

Would be nice if this worked just like a control panel. Nice gui for making a list of programs and when you click okay it writes options out the .iconbar file. Another thing I think would be cool is to be able to exclude certain programs by dragging them off the iconbar and onto the desktop (like the clock) and having that noted in .iconbar.

Some of these suggestions might be impractical or require changes to 4Dwm, not sure. But I thought I'd throw them out anyway.
If possible, when animated icons are available, I'd like the option to disable them. Is there a place to get the latest version or source code?
- Jim
:Indigo: :Indigo: :Indy: :Indy: <- signed by The Screensavers :) :Indigo2IMP: (230L) (230L) :540: :1600SW: :1600SW: <- touchscreen :PI: :Octane2:
I just looked at the screenshot and it looks quite nice!
I'm going to try it out immediately.
Great work Squeenyweeny!
:D
Shall I describe it to you? Or do you want me to get you a box?