Karl, thank you very much for your response which I studied, but I couldn't figure how to use your "retrovol" example in another application.
-------------------
So if there is a generic method to allocate a tray icon to an app which doesn't have one, might it help to look at "Simple Menu" from technosaurus (where in his opening post in the link below he specifically wrote "... for whatever reason I decided not to make a menu entry[/tray icon] for it").

Scrolling down there are posts from:
* technosaurus re smenu-0.2.pet
* LIBL and jemimah re non-English use
[which may be of general interest to some readers who might like to try Simple Menu, with or without any interest in the tray icon aspect].

My regards

With Simple Menu a tray icon seems to be superfluous, but I have other pet and sfs apps where it would be nice to be able to use a choice of tray icon in place of the default icon.

I have not asked technosaurus, partly because likely he's busy and, to me, it would seem impolite.

Hi Jasper - yes, the default red-X icon is kind of a job to get around if indeed it can be done.

Mostly jwm gets it right and uses the app-specific icon, but if it can't then it uses the 'generic' (for gtk-dialog-based mini-apps and so on). Possibly you might be able to use jwm's group tag - see the jwm man for more info - to set a preferred icon, but then again you'd have to narrow the group (class) to a specific subgroup (name) and it could defeat your intent if you don't get everything properly done.

Dotdesktop files are the usual source for icons in the rootmenu, but sometimes the icon is different (or generic) in titlebar/tasklist for jwm.

xprop is a good tool for determining various window properties (class, name, icon and so forth). It's been awhile, but if I recall correctly xdotool can be used to manipulate those to some extent.

Funny, slacko55 has been giving me somewhat of a related issue lately - medit shows a correct red pen icon in menus but I get a printer icon in titlebar/tasklist.. minor but annoying

1. I first assumed that you wanted to change the default window icon so that all applications that didn't specify an icon would use the new default icon instead of the red X.

Perhaps that was a correct assumption.

2. But perhaps you just want to know how to assign an icon to an application which currently doesn't have one -- not change the default.

Jasper wrote:

. . . I have other pet and sfs apps where it would be nice to be able to use a choice of tray icon in place of the default icon.

Yes, that sounds more like #2. You don't want to actually change the default icon; you want the application to use an icon other than the default.

So I'll now assume that the latter is what you are asking. (I hope that is the case, because the answer to #2 is easier than the answer to #1, since I think the default icon is actually hard-coded inside the jwm executable and changing it would require patching the source and recompiling or doing some precision editing of the executable.)

Many applications supply a window icon and request that the window manager use it by passing the _NET_WM_ICON hint. Those that don't do that can have a window icon associated with it, for use by JWM, by placing an image file with a basename that matches the resource name for the application in one of JWM's IconPaths.

What are JWN's IconPaths? They can be found by looking in the /root/.jwmrc file. For instance, here are the IconPaths in my /root/.jwmrc file:

Your results may vary, but it looks like these four paths are fairly common in recent Puppies, since I've found the same in Racy 5.2.2, Slacko 5.5-PAE, and Precise 5.5.

What is a "resource name"? It is a name passed to the window manager by the application in the WM_CLASS hint. Not all applications pass a WM_CLASS hint. For those that do, you can see the resource name of the application by using the xprop utility recommended by `f00 in his post above. Enter the following command and then click on the application's window:

Code:

xprop | grep WM_CLASS

This will spit out two names. The first is the resource name; the second is the resource class. Often the resource name will be the same as the name of the executable, but that is not always the case.

So, let's say you have an application named whatever. You use the above command and find out that the resource name is also whatever. So you create an icon file and name it whatever.xpm, and you place it in the /usr/local/lib/X11/mini-icons/ directory because that was one of the IconPaths in your /root/.jwmrc file.

With any luck you can than restart JWM, then launch the application and see the new icon on its title bar and in JWM's tray.

As for the icons in the menus, they are defined differently. As `f00 mentioned above, they are defined in the .desktop files. If you want to add or modify a menu icon, find the .desktop file for the application in the /usr/share/applications/ directory, then add or modify the "Icon=" line. If you want, you can use the same icon as you used for the window icon. For instance:

Code:

Icon=whatever.xpm

Again, the icon file should live in one of the directories shown in the <IconPath> fields in your /root/.jwmrc file. If you want to use an icon file in a directory that is not in one of JWM's IconPaths, you can provide the absolute pathname of the icon file. For instance:

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum