Awn

Different custom icons for OpenOffice applications

Bug #129806 reported by kevinbeard
6
Affects Status Importance Assigned to Milestone
Awn
Fix Released
Low
haytjes

Bug Description

This is migrated from the old system

Basically, if you customise an icon for OpenOffice it applies to all the different applications (Writer, Calc etc). There is no way to have different customised icons for each.

http://www.planetblur.org/hosted/awnforum/index.php?shard=forum&action=g_reply&ID=193

I already have a patch to make AWN allow different custom icons for the various OpenOffice application. http://patch-manager.dskw.de/?id=34&do=patch

Revision history for this message
kevinbeard (kevinbeard) wrote :

Here's the patch. It was written for svn revision 227 but I can always create a new patch against the latest version from Launchpad if that makes things easier.

Revision history for this message
haytjes (h4writer) wrote :

Think there should be a way to make it possible to not hard-code this in the source.
Wouldn't it be nice if the same system could be used for other application having the same problem?

I just don't know how...

Revision history for this message
Miika-Petteri Matikainen (mpmatikainen) wrote :

I agree that there should be another way of doing this.

Changed in awn:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
kevinbeard (kevinbeard) wrote :

Yes I thought it was a bit of a hack myself but couldn't find any other data available to distinguish between the different OpenOffice applications. If anyone has any suggestions of another way I will gladly change it. On the other hand, I don't think it's that big a deal just to do it for OpenOffice as this is a major common application suite that really should be supported by AWN.

Revision history for this message
Willi (strangeq) wrote :

Could something similar be done to change The GIMP's icon, without changing the preview icon for open images?

Could this technique somehow be used to also solve the VLC bug: https://bugs.launchpad.net/awn/+bug/130523 ?

Revision history for this message
kevinbeard (kevinbeard) wrote :

I've been looking into the VLC issue and it could definitely be solved using the same technique as the problem there is that wnck_application_get_name() returns "." for this app.

However I was wondering if there was a way of doing it by manually setting the application name. I couldn't find a way of setting this for VLC as it doesn't seem to take standard x resource options.

Could be an option for OpenOffice too?

Revision history for this message
kevinbeard (kevinbeard) wrote :

Well, looks like VLC doesn't accept the --name gtk option so that idea is out of the window.

Does anyone else have any ideas how we can pick up unique names for these applications without hard-coding them?

Revision history for this message
Neil J. Patel (njpatel) wrote :

I think this is a problem that can be fixed outside of Awn after the 0.2 release, specifically when I add in the new D-Bus backend and the scripting support. The scripting support will be 'per application' scripts, that can be executed when the application starts, so you can set the icon like that.

The problem of being returned rubbish names is something I am trying to fix at the moment.

Revision history for this message
haytjes (h4writer) wrote :

(I got an private message about this issue, saying a new patch that works against the newest BZR is available here: http://patch-manager.dskw.de/?do=patch&id=51&subdo=view&subid=89)

I was thinking. Maybe there is a way to get this thing working.
Now in this code you can get the title of a program. Isn't it default for application to set their name like:

Mozilla Firefox
lorum ipsorum - Mozilla Firefox
lorum ipsorum - OpenOffice.org Calc
...

I think it would be possible to let the title decide which icon should be needed...

(small example in python)
[code]
program = title
if '-' in title:
   program = title[title.rindex('-')+1:].lstrip()
[/code]

So normally the program gets the default icon and the different openoffice programs will get the same icons, BUT if you set a custom icon on it, it will look to the program name to distinguish the different programs...
That way it isn't hard coded for openoffice and will work with other programs to...

Revision history for this message
haytjes (h4writer) wrote :

I hate c !!!!!! I can't get the three lines in python in c :-(

Here's a not working version. C-devs, would you take a look to it and give some remarks. It's probable because I've never done something like this before and forgetting some stuff. I have read enough about pointers, but I just suck in it...

http://pastebin.ubuntu-nl.org/34179/

Revision history for this message
Miika-Petteri Matikainen (mpmatikainen) wrote :
Revision history for this message
Miika-Petteri Matikainen (mpmatikainen) wrote :

There is a little bug in that code I just posted. Here is the correct version:
http://pastebin.ubuntu-nl.org/34188/

Revision history for this message
Miika-Petteri Matikainen (mpmatikainen) wrote :

A bug again, corrected version here:
http://pastebin.ubuntu-nl.org/34192/

Revision history for this message
haytjes (h4writer) wrote :

Got an improved patch. Normally this patch should make AWN able to distinguish the different programs like openoffice.
Now I just want everyone test this patch, to be sure it works.

remark: after applying this patch it's normal that most of your already set custom icons aren't used anymore. You just have to apply them again.

haytjes (h4writer)
Changed in awn:
assignee: nobody → h4writer
status: Confirmed → In Progress
Revision history for this message
Isaac Joseph (isaacj87) wrote :

Testing it right now.

Revision history for this message
kevinbeard (kevinbeard) wrote :

Wow, I knew I shouldn't have gone on holiday for a week...that's a long time in AWN world!

Revision history for this message
kevinbeard (kevinbeard) wrote :

I had a look through the patch and it seems that if someone has a lot of customised icons already set up there is the potential they could lose them if the text in the window name is different to the app name.

Perhaps you could use the original naming method first to find existing custom icons and if none are found switch to this new way?

Revision history for this message
haytjes (h4writer) wrote :

yeah that's right, but do we really need to look to that? I mean it is still a development version. (But it need to be listened in the changelog)

Revision history for this message
Willi (strangeq) wrote :

I agree that that's not really a problem.
It's easy enough to reassign your custom icons.

haytjes (h4writer)
Changed in awn:
status: In Progress → Fix Committed
Changed in awn:
status: Fix Committed → Fix Released
Revision history for this message
Spencer Creasey (screasey) wrote : Re: Different custom icons for OpenOffice applications [SOLVED]

I haven't seen a good solution (besides a patch?) for this OO icon problem. So here's what I did.

In the ~/.config/awn/custom-icons/ folder I added an icon for OpenOffice 2.3 manually by copying one of the OpenOffice icons already in the directory and renaming it "OpenOffice.org-2.3" (this is the name OpenOffice first displays when it opens on AWN before changing it's icon).

Here's a screenshot of my own directory (above). For some reason when OO opens from both the AWN bar and individual files my custom icons are loaded. Go figure...

Screen:
http://www.css.taylor.edu/~screasey/awn/Screenshot-custom-icons%20-%20File%20Browser.png

Icons (I'm using):
http://www.css.taylor.edu/~screasey/awn/custom-icons.tar

Revision history for this message
Spencer Creasey (screasey) wrote :

Oh, and of course, I'm on trunk.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.