Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 24 Nov 2014, 08:32
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Default tray icon (red X)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [11 Posts]  
Author Message
Jasper


Joined: 25 Apr 2010
Posts: 1158
Location: England

PostPosted: Tue 07 May 2013, 17:20    Post subject:  Default tray icon (red X)
Subject description: How to change that?
 

Hi readers,

I would appreciate a "how to" link a distinct
tray icon to any pet lacking a specific icon.

I use Precise 5.5 with JWM.

My regards

PS It's not important, but it would be nice.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Wed 08 May 2013, 10:12    Post subject:  

Tray apps normally have their icons somewhere in /usr/share/PROGRAMNAME

like retrovol for example :

bash-3.2# ls /usr/local/share/retrovol/images
audio-volume-high.png audio-volume-medium.png
audio-volume-low.png audio-volume-muted.png
Back to top
View user's profile Send private message Visit poster's website 
Jasper


Joined: 25 Apr 2010
Posts: 1158
Location: England

PostPosted: Wed 08 May 2013, 13:04    Post subject:  

Hi Karl et al,

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").

http://www.murga-linux.com/puppy/viewtopic.php?t=77660

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.
Back to top
View user's profile Send private message 
`f00


Joined: 06 Nov 2008
Posts: 809
Location: the Western Reserve

PostPosted: Wed 08 May 2013, 15:11    Post subject:
Subject description: icon - default
 

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 Neutral
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1158
Location: England

PostPosted: Wed 08 May 2013, 17:25    Post subject:  

Hi `f00,

Thank you for your contribution, which I will study in detail and with interest tomorrow, though I may not try to implement your possible work arounds.

I have used xdotool before with success, but it took some three hours for me do a simple task which experts would accomplish in minutes or even seconds.

My regards to all

PS PupMenu, from radky, in Full Mode gives lots of information on apps and enables easy viewing and editing of extensive data as well as many other useful functions.
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 09 May 2013, 00:24    Post subject:  

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:
# 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:
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:
Code:
Icon=/root/my-icons/whatever.xpm


For more details on this stuff see JWM Configuration: Icons

Good luck.
Back to top
View user's profile Send private message 
CatDude


Joined: 03 Jan 2007
Posts: 1497
Location: UK

PostPosted: Thu 09 May 2013, 06:23    Post subject:  

Hi

@ `f00
`f00 wrote:
...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 Neutral


I first noticed similar behaviour back with Slacko-5331 (IIRC) when using Psip Puppy Phone,
if i was to IM someone, i had a strange icon on that window (but not on the two main windows). (see pics)

After a little hunting, i figured out the cause and a solution.

For your particular issue, try the following:

If you look in: /usr/share/icons/hicolor/16x16/apps/ (i have 4351 items in here Shocked )
you will probably find this:
    medit.xpm is a symbolic link to m.xpm
    which is also a symbolic link pointing to printer.xpm

Simply replace the medit.xpm symbolic link for an actual icon of your choice,
then update the icon cache.

Code:
gtk-update-icon-cache -f -i /usr/share/icons/hicolor


Now fire up your app and see if the right icon is displayed.


Hope this helps
CatDude

P.S
The IP in my images was edited to protect the innocent Laughing
.
default.png
 Description   
 Filesize   92.59 KB
 Viewed   256 Time(s)

default.png

fixed.png
 Description   
 Filesize   91.29 KB
 Viewed   251 Time(s)

fixed.png


_________________

Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1158
Location: England

PostPosted: Thu 09 May 2013, 06:33    Post subject:  

Hi npierce,

Success. Your your instructions are a model of clarity, simplicity and excellence.

Thank you very much.

My regards to all, especially the responders

PS I'm not just pleased. I'm delighted.
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 09 May 2013, 11:06    Post subject:  

Jasper,

You're very welcome.

Thanks for taking the time to provide feedback. I do make an effort to be clear, and it is good to hear that (at least sometimes) I succeed. Smile It is nice to know the effort is appreciated.
Back to top
View user's profile Send private message 
`f00


Joined: 06 Nov 2008
Posts: 809
Location: the Western Reserve

PostPosted: Thu 09 May 2013, 11:21    Post subject:
Subject description: ..
 

Thank you, CatDude! - yep, that icon dir is a bit large (one can only wonder what it would do to iconfinder's load time Shocked if that utility were in slacko).

Indeed your solution does help Very Happy thanks again for the hunting/kb

Also props to npierce for a good rundown of _NET_WM_ICON hint - I tend to get lost in that Embarassed
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 09 May 2013, 21:38    Post subject:  

`f00,

`f00 wrote:
. . I tend to get lost in that

Me too. I try to remember to bring a lot of bread crumbs with me when I venture into that forest. Smile


CatDude,

Thanks for the explanation of the medit icons. It clarified something for me, and inspired me to look deeper into how GTK apps find their icons.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

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


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0916s ][ Queries: 12 (0.0070s) ][ GZIP on ]