I set Xfce to make all windows semi-transparent when they don’t have mouse focus. How can I set a particular window to remain opaque when inactive? Xfce doesn’t have an option to change settings for specific windows (as far as I know).
I found a solution for this before, but I can’t find it anymore. I used a command-line program to set a particular window manager hint on the window I wanted, and that prevented the window from becoming transparent. But I can’t remember the program I used or the name of the window manager hint. I think part of the hint name may have been LOCKED
.
This is useful for keeping GIMP windows from becoming transparent when they lose mouse focus, for example.
I have transset-df
but it doesn’t have a way to force a window to keep the same transparency when inactive.
Best Answer
Use Devilspie2 to set the window type to "Utility" for selective applications. This window type will not be affected by "Opacity of inactive windows" in Xfce environment.
Preliminary setup
Install Devilspie2 from the repository (available in Debian and Ubuntu repositories), then create a new configuration file at
$HOME/.config/devilspie2
with the following content.Save the file as
opaque.lua
. The file name can be anything, but it must have.lua
file extension to work with Devilspie2.Preliminary testing
Run Devilspie2 in debug mode and you will see something like below.
The following screenshots are showing inactive window of Dictionary, before and after running Devilspie2. Notice that the opacity changes for Dictionary (bottom) but Xfce Terminal remained less opaque (left) while both windows are inactive.
The inactive window of Dictionary remained fully opaque because the window type has been changed to "Utility" by Devilspie2, with respect to the configuration file.
Modifying setup
The created configuration file contains the first two lines that begin with
debug_print
to show debug messages of "Window Name: ... Application name: ...". These lines allow Devilspie2 to show respective names for both currently running applications and subsequently run applications.Based on the debug messages, user shall follow these steps:
Identify the application of choice, which needs to be fully opaque when inactive. Look for the line containing its
Application name:
and copy the value.Open the same configuration file at
/home/USERNAME/.config/devilspie2/opaque.lua
using a text editor, then replacexfce4-dict
with the application of choice.Save the file.
Quit and run again Devilspie2.
Note that USERNAME refers to the current username.
The modified configuration will now be effective. If the application of choice is already running, switch the window back and forth to see effective changes when the window becomes inactive again.
Persistent setup: Devilspie2 must be running in background for this solution to be effective for every session. To make this persistent, add
devilspie2
under "Applications Autostart" tab in "Session and Startup".What window type
Initially, I found this solution while playing with Devilspie2 by trials and errors. Later I tried running GIMP 2.8 and noticed that main window became less opaque when inactive, but the other two floating windows were remained fully opaque.
Then I had confirmed the window type by running
xwininfo
, then click on one of the floating windows, to print the window manager hints.And bingo, the window type was indeed "Utility"!
Trivial issue: The "Utility" window type has one different behaviour, that is, the application window will no longer appear in the taskbar. User can continue to navigate by Alt+Tab keys instead of taskbar.
That behaviour is normal for "Utility" window type, which can be observed the same for the floating windows a.k.a. the docks in GIMP.
If user feels that this behaviour is not desirable, then changing window type could be a solution with drawback. On the other hand, the behaviour is a trivial issue while being able to keep selective windows as opaque when inactive.
Tested working in Xubuntu 14.04 (Xfce 4.10), using Devilspie2 v0.31.