Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-06-25 11:29:10

xfce-amateur
Member
Registered: 2021-06-23
Posts: 11

[solved] Window switcher doesn't respect desktop entry icon parameter?

I like it if I can spawn a terminal emulator with ranger (for example) running inside it directly from the desktop, having created a desktop entry file (ranger.desktop) for the purpose. It's nice if instances invoked in this way can have their own icon that distinguishes them from other terminal emulators that may be running. I can achieve what I want with xfce4-terminal with a desktop entry that looks like this:

[Desktop Entry]
Type=Application
Name=Ranger
Terminal=true
Exec='xfce4-terminal --title="Ranger" --icon=rstudio -x ranger'
StartupWMClass=ranger

With this file, every instance of ranger I launch gets a nice blue "R" icon (I don't use R-Studio, so I'm happy to borrow its icon in this way).

However, if try to make the desktop entry responsible for setting up the icon, rather than the invocation of xfce4-terminal, I run into problems. My desktop entry then looks like this:

[Desktop Entry]
Type=Application
Name=Ranger
Terminal=true
Icon=rstudio
Exec='xfce4-terminal --title="Ranger" -x ranger'
StartupWMClass=ranger

With this setup, the R-Studio icon appears in the Whiskermenu (which is what I want), but in the window switcher (alt-tab), the application appears under the xfce4-terminal icon (whereas I want to see the rstudio icon here too). (The tasklist in the dock, interestingly, displays a mixture: if I launch multiple ranger instances, right-clicking on the xfce4-terminal icon in the tasklist reveals them, with some of them having R-Studio and some of them having xfce4-terminal icons.)

Obviously one solution is to let xfce4-terminal be responsible for setting up the icon, but this is not possible with terminal emulators that lack the --icon switch, e.g. kitty.

Is this a bug, or am I doing something wrong?

Last edited by xfce-amateur (2022-06-26 12:36:16)

Offline

#2 2022-06-25 16:42:23

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: [solved] Window switcher doesn't respect desktop entry icon parameter?

Hello and welcome.

Both the Window Buttons plugin and Alt-tab use libwnck to get the application icon (based on the classname of the application). The Whiskermenu uses the .desktop file. So what you're trying to do is going to be problematic. xfce4-terminal offers an "--icon" parameter to work around this.

Other options include using devilspie and/or xseticon to change the icon of any given application. Have a read through this thread for a discussion and examples of each approach.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2022-06-26 12:41:26

xfce-amateur
Member
Registered: 2021-06-23
Posts: 11

Re: [solved] Window switcher doesn't respect desktop entry icon parameter?

I appreciate the help ToZ. Thanks!

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 524.83 KiB (Peak: 531.38 KiB) ]