Hi Jasper,
When I read your first post, I thought I understood your question, but after reading your other posts I am now not so sure.
Jasper wrote:Post subject: Default tray icon (red X)
Subject description: How to change that?
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:
Code: Select all
# grep IconPath /root/.jwmrc | grep -v '<!-'
<IconPath>/usr/local/lib/X11/mini-icons</IconPath>
<IconPath>/usr/local/lib/X11/pixmaps</IconPath>
<IconPath>/usr/share/pixmaps</IconPath>
<IconPath>/usr/local/share/pixmaps</IconPath>
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:
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:
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:
For more details on this stuff see
JWM Configuration: Icons
Good luck.