Is it possible to use wmctrl
or something else to make a specific window automatically display on all desktops?
I use the Prime Player Google Play Music miniplayer Chrome extension to control music playback. I already have a bash alias I can invoke to make the miniplayer stay on top of other windows, but I want to also have it send the miniplayer window to all desktops so I don't have to right-click and select Send to Desktop → All Desktops (via openbox).
Ideally, I would have a script run something in the background and as soon as it detects the miniplayer window it puts it on top and sends to all desktops. Is this possible?
Best Answer
You can actually do this without a third party script. Openbox supports an extensive range of per-application settings.
Creating an app-specific rule
Application rules are matched against different properties like the window name, class, role or title. Most of these properties can be obtained for a specific window by running
and clicking on the window in question.
Seeing how you are planning to specify the rule for a Chrome extension window you might want to supply as many matching properties as possible so as to make the rule as specific as possible. You don't want it to apply to all Chrome windows. Try out different matching properties and see what works best for you.
Having defined the matching window you can set different properties that will exclusively apply to the window/application in question. Here's an excerpt of the default
rc.xml
which describes all available properties:In your specific case you will be interested in specifying the
layer
anddesktop
of the application. Here's an example of a rule that would designate all windows of a specific application to be always on top and omnipresent on all available desktops:I chose an arbitrary application name and class for this example. As stated before you will have to make sure to find the correct values for your specific application.
Edit: I looked into your specific application and came up with a rule that works on my system:
I hope this works for you as well.
Modifiying your openbox configuration to add an app specific rule
To add an application rule open your openbox
rc.xml
(found under~/.config/openbox/rc.xml
for stock openbox or~/.config/openbox/lxde-rc.xml
for LXDE) and navigate to the<applications>
section at the very end of the file.Insert your application specific rules between the
<applications>..</applications>
tags. Then save the file and proceed to reload the configuration by executing:The application specific rules should be in effect after this and will automatically get applied to newly spawned windows.