Awn

[Patch] Force custom icon for application

Bug #385421 reported by manwe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Awn
Won't Fix
Medium
moonbeam

Bug Description

This is small patch I've made to force custom icons for selected applications. In version 0.3.2.1 there's option "Change icon" on right click, but:

1. It depends on window's name which tends to change.
2. It doesn't work without xfce and/or gnome because $HOME isn't appended to search path for icon.

 #ifdef LIBAWN_USE_GNOME
   uri = gnome_util_prepend_user_home (name->str);
 #elif defined(LIBAWN_USE_XFCE)
   uri = g_string_free (g_string_prepend (name, g_get_home_dir ()), FALSE);
+#else
+ uri = g_string_free (g_string_prepend (name, getenv("HOME")), FALSE);
 #endif

I've added new fuction awn_x_get_application_class which (as you can guess) returns window's class and changed awn_x_get_icon_for_window so it look's first for $HOME/.config/awn/class-icons/{class} . If not found, looks in $HOME/.config/awn/custom-icons/{name} or returns awn_x_get_icon(), as usual.

There's no option to select class-related icon, user has to manually copy file to $HOME/.config/awn/class-icons/, so it really isn't patch which should be in main tree, but maybe you can use this code and make it work as it should. Besides, I'm really bad in C (haven't use it for at least 3 years), so this code probably sucks anyway. But at least it works ;)

p.s.
Thanks for AWN, it's great.

Revision history for this message
manwe (manwe-manwe) wrote :
Revision history for this message
Mark Lee (malept) wrote :

Thanks for the patch (I'm to blame for forgetting the desktop-agnostic code, oddly
enough). However, this patch is kind of obsolete now, as we're totally rewriting
the dock's underlying code, including this section. In fact, according to one of
the developers who works on the taskmanager, it pays more attention to X properties
now. We haven't yet gotten to the custom icon implementation, so we're leaving this
bug open.

Thanks again!

Changed in awn:
importance: Undecided → Medium
milestone: none → 0.4.0
status: New → Confirmed
Michal Hruby (mhr3)
Changed in awn:
assignee: nobody → moonbeam (rcryderman)
Revision history for this message
Michal Hruby (mhr3) wrote :

A new mechanism for custom app icons was implemented, therefore settings this as Won't Fix.

Changed in awn:
status: Confirmed → Won't Fix
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.