You are not logged in.
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
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
I appreciate the help ToZ. Thanks!
Offline
[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 524.83 KiB (Peak: 531.38 KiB) ]