Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-08-04 18:25:11

mezzoman
Member
Registered: 2014-08-04
Posts: 2

Redefine Panel Window Button Icons based on WM_CLASS

Firefox marketplace has these new Desktop Web Apps that install with a click that are basically toolbar-less  wrappers around a given website.  The .desktop files that get installed have their own icons, and install into ~/.local/share/applications, properly.  Its neat.  They launch with a click like any proper .desktop file. 

However XFCE isn't picking up their icons as stated in the .desktop file.  The xfce_panel window buttons are showing a generic window icon instead.  I checked the WM_CLASS using xprop and it has its own class that matches.  Does anyone know where the window buttons panel plugin gets it icon mapping from? When I run xprop I get:

WM_CLASS(STRING) = "Webapprt", "Owa-clock-6003506a2decd8037b4648f33455a589"

And the .desktop file is:

[Desktop Entry]
Name=Clock
Comment=Displays the current Time. Featuring customizable Themes. Made by the Creator of Timer Tab.
Exec="/home/symple/.clock-6003506a2decd8037b4648f33455a589/webapprt-stub"
Icon=/home/symple/.clock-6003506a2decd8037b4648f33455a589/icon.png
Type=Application
StartupWMCLass="Owa-clock-6003506a2decd8037b4648f33455a589"
Terminal=false

What part does the window button pull its icon from?  Or does anyone know how to redefine the window button icon based on the WM_CLASS?  I've tried to redefine a bunch of apps just as a test and the Window Buttons plugin ignores changes to the WM_CLASS

Thanks in advance!

XFCE 4.10
Archlinux

Last edited by mezzoman (2014-08-04 20:32:53)

Offline

#2 2014-08-04 22:46:27

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,374

Re: Redefine Panel Window Button Icons based on WM_CLASS

What part does the window button pull its icon from?

I believe that the window icon is pulled from the NET_WM_ICON hint. The application you indicate does not set this hint. There was this discussion from 2009 about a similar issue.

Or does anyone know how to redefine the window button icon based on the WM_CLASS?

I'm not sure about using WM_CLASS, but there is a package in the AUR, xseticon, that allows you to change this window icon. The following command worked for me:

xseticon -name "Clock" /home/toz/.icons/clock.png

I've used the information from this page to create a launcher for the Clock application that also changes its icon. The code I ended up using was:

#!/bin/bash

function clock-up {

sleep 1
activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
activeWinId="${activeWinLine:40}"
iconStore="$HOME/.icons"

xseticon -id "$activeWinId" "$iconStore/clock.png"

}

/home/toz/.clock-6003506a2decd8037b4648f33455a589/webapprt-stub & clock-up

If you want to discuss this with the developers, probably best to post to the xfce4-dev mailing list.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

#3 2014-08-05 00:20:40

mezzoman
Member
Registered: 2014-08-04
Posts: 2

Re: Redefine Panel Window Button Icons based on WM_CLASS

I missed that nifty little program.  Thanks a ton.  Its interesting that the Firefox guys set out to specifically change their Webapp runtime to set the WM_CLASS property around FF 29.  This would be for upstream, and I don't consider it a bug in XFCE.  Firefox should just set the window icon to the Favicon/App icon on the web when in app mode and be done with it.  Thanks again!

Offline

Board footer

Powered by FluxBB