This is easy in JWM, but I couldn't find a way in Openbox to assign window icons to applications that didn't have them built in (the little icons that appear on the titlebar and in the taskbar). And I was seeing a lot of default Openbox icons. If anyone has a better way to do this, please share.
The best I could come up with is a little script that is run as the application launches, and it assigns an icon using xseticon. To find the window ID, I use xdotool and assume the newly launched application is the focused window. The application is launched with a command like this:
Code: Select all
firefox "$@" & icon-me firefox.png 25
The png is the image I want to assign as the icon, and the number at the end is a delay in seconds to make sure the application fully launches before this "icon-me" script is run (save in, say, /usr/local/bin and give permissions to execute):
Code: Select all
#!/bin/bash
sleep $2
ID=$(xdotool getactivewindow)
xseticon -id $ID /usr/share/pixmaps/$1
The delay can be varied by application (usually 2-5 seconds is enough, but big applications like Firefox can take longer). The icons are placed in /usr/share/pixmaps.
Here's xdotool provided
by technosaurus (just unpack and place in /usr/bin), and a deb package of xseticon, which I think will install in all Debian and Ubuntu compatible pups: