You are not logged in.
Dear all,
I want to customize nightly firefox icon like this. For now only could get menu-system-internet and plank OK. But for panel icon I didn't reach out how to..
PROBLEM:
OK
OK
Offline
There are a number of threads on this board regarding this issue. Let me sum up what I know here.
The Window buttons plugin (and xfwm4) use EWMH to select which icon to use. To see this icon, you could run "xprop" and click on the window in question. Look at the _NET_WM_ICON(CARDINAL) field.
If you want to change this, you need to use a tool like xseticon to change this icon. (make sure you install it - if you're distro doesn't offer it, you may need to build it from source).
I know of two ways to change this icon:
Using Devilspie. Install the devilspie package and create a .ds file in ~/.devilspie (e.g. ~/.devilspie/firefox.ds) with the following content:
( if
( is ( window_class ) "Firefox" )
( begin
( spawn_async
( str "xseticon -id "
( window_xid ) " /path/to/new/icon.png" ) )
( println "match" )
)
)
...and:
ensure that the "window_class" is correct (xprop will show you the window class)
change "/path/to/new/icon.png" to the actual path to the new png icon that you want to use
Start up devilspie via "devilspie -a" and the icon should change.
If this works, add "devilspie" to your autostart programs.
.
Using a wrapper script. Since on most systems, /usr/local/bin comes before /usr/bin in the path, you can drop a "firefox" wrapper script in /usr/local/bin that will start the app and change the icon. You could use a wrapper script like:
#!/bin/bash
### EDIT THESE VALUES #########################################################
# set APP to real executable
APP="/usr/bin/firefox"
# set ICON to icon file - only png supported
ICON="/full/path/to/png/icon"
# wait time for application window to display - adjust to suit
WAIT=1
###############################################################################
###############################################################################
### DON'T CHANGE ANYTHING BELOW
###############################################################################
function change-panel-icon {
sleep $WAIT
activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
activeWinId="${activeWinLine:40}"
xseticon -id "$activeWinId" "$ICON"
}
$APP & change-panel-icon
...ensure:
that the APP variable points to the correct _real_ executable
change the ICON variable to point to the new png icon
make this file executable.
When you next start firefox via your menuing system or from a command line, this wrapper script will execute, start the program and change the icon.
Hope this helps.
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 use .desktop launchers for different Firefox profiles -- each one with a different icon.
The launcher files have the different icon set:
Exec=/opt/firefox/firefox -p home %u
Icon=/home/boodo/.icons/letter-h-128.png
These are nicely shown in the XFCE applications menu etc.
The problem is that the window buttons all default to the main Firefox icon.
Is there some smart solution for XFCE to use the right icon for the window -- maybe an extra command / wrapper in the Exec line of the launcher file?
(I imagine I can't use devilspie as they're all called "Firefox". Using a launcher to call an .sh script seems ugly to me, would be nice to take care of it all in the launcher. Anything more elegant than putting all those lines in the launcher?)
Last edited by boodo6 (2018-09-04 12:49:44)
Offline
You can start firefox and pass a new class name to it:
/opt/firefox/firefox --class FFhome -p home %u
...and then use devilspie to match on that new class name.
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
Works great, thank you!
Offline
A version of xseticon is now maintained by xeyownt, who also provides build instructions.
Devilspie is no longer maintained, but there is now a devilspie2.
Devilspie2 uses lua as its scripting language:
if (get_class_instance_name() == "Firefox") then
os.execute("xseticon -id " .. get_window_xid() .. " /path/to/icon.png");
end
Last edited by xfce-amateur (2022-06-27 10:34:20)
Offline
[ Generated in 0.024 seconds, 8 queries executed - Memory usage: 546.2 KiB (Peak: 547.04 KiB) ]