You are not logged in.
Back in 2020/2021, I would use my terminal emulator with a video playing underneath. Typically, I would be writing code and the video would be something like slow TV or ASMR, since I found it easier to focus for long periods of time with those than with a black background or a static image.
I have Kitty (my terminal emulator) set up to display all characters as opaque, so the readability is still good. I'm using i3 as my window manager and picom as my compositor. Typically, the window providing the background video would either be a "Picture-in-Picture" window created by Firefox or just mpv. I would put the terminal and video together in a tabbed container, with the terminal focused. Here's an example of what that looks like:
Previously, all I had to do to make this work was add a rule to picom's "opacity-rule" (see below), so that the video would stay opaque. I took a long break from coding, and at some point this setup stopped working.
It seems picom changed the order in which the opacity rules are applied. Previously, rules at the end of the list would override those at the start. Now it's the opposite (later rules take precedence). So, the rule for setting the opacity to 0 for windows with a hidden window state had to be moved to the end of the list. Kind of annoying, but it was undocumented behavior to begin with, so whatever. It took a while to diagnose, but was an easy fix.
However, the video behind the terminal will also now be stuck on whatever frame was shown when it became inactive. This is true of a lot of different programs (regular Firefox window, mpv, libreoffice impress). However, some programs will continue to update while inactive (vlc, xclock, kitty, audacity, GIMP).
At first, I thought this might be a picom or i3 issue, but the fact that it only happens with some applications makes me think it's because the applications are trying to be "smart" and stop updating the window when i3 tells them they're inactive/hidden. I'm able to trick mpv into thinking it's active using xprop, like so:
xprop -id 0x01a00002 -f _NET_WM_STATE 32a -set _NET_WM_STATE ""
Of course, I could create a script and keybinding to do this quickly. However, I would really prefer it happen automatically; it's pretty hack-y; and _NET_WM_STATE gets reset if the window becomes active again. (So, video playback stops, and I'd need to manually reset _NET_WM_STATE.)
Does anyone have an idea of how to get an automatic solution? Perhaps there're some hooks in i3 that run when the tree changes and when the focus changes, and I can bind a script to them?
# basic configuration
# see /etc/xdg/picom.conf for explanations
backend = "glx";
vsync = true; # only draw full screens
use-damage = false; # only redraw the parts of the screen that changed
daemon = true;
log-file = "/home/joedang/log/picom.log";
log-level = "warn";
glx-copy-from-front = true;
glx-swap-method = 2;
xrender-sync-fence = true;
fading = true;
fade-in-step = 0.1;
fade-out-step = 0.02;
fade-delta = 7;
# blur-method = ;
# blur-size = 40;
# blur-strength = ;
# blur-background = true;
# transparancy settings for i3
active-opacity = 1.0;
inactive-opacity = 1.0;
#inactive-opacity = 0.9; # on the fence about this
#inactive-opacity-override = false;
inactive-dim = 0.1;
frame-opacity = 1.0;
# You can get a window's class (and more) by running `xprop` and clicking on the window.
opacity-rule = [
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"85:class_g = 'URxvt'",
"85:class_g = 'dmenu'",
"100:role = 'PictureInPicture'",
"100:class_g = 'mpv'",
"100:role = 'browser'",
"100:class_g = 'Gimp'",
#"100:_NET_WM_WINDOW_TYPE:s *= 'DOCK'",
#"100:class_g = 'i3bar'",
"100:class_g = 'i3lock'",
"100:class_g = 'i3-frame'"
];
# "90:class_g = 'Zathura' && !_NET_WM_STATE@:32a",
# "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
# "50:class_g = 'i3frame' && !_NET_WM_STATE@:32a",
# "85:class_g = 'Kitty'",
# "80:class_g = 'i3bar' && !_NET_WM_STATE@:32a",
#focus-exclude = [
# "class_g = 'mpv'"
#];
invert-color-include = [
"TAG_INVERT@:8c = 1"
];
shadow = true;
shadow-color = "#00AAAA";
shadow-radius = 15;
shadow-offset-x = -15;
shadow-offset-y = -15;
shadow-exclude = [
"!I3_FLOATING_WINDOW@:c",
"class_g = 'i3-frame'"
];
# "!class_g = 'dmenu'",
# "!class_g = 'Dunst'"
wintypes:
{
normal = {};
menu = { shadow = true; };
toolbar = { shadow = false; };
utility = {};
splash = {};
dialog = {};
combo = {};
tooltip = { shadow = true; opacity = 0.95; };
dropdown_menu = { shadow = true; };
popup_menu = { shadow = true; opacity = 0.95; };
notification = { shadow = true; };
dnd = { shadow = false; opacity = 0.75; }; # drag-and-drop
dock = { shadow = false; opacity = 1.0; };
unknown = { shadow = false; };
}
Offline
it's because the applications are trying to be "smart" and stop updating the window when i3 tells them they're inactive/hidden
https://github.com/mpv-player/mpv/issues/10829
"mpv --force-render"
You could also try to make i3 treat it as desktop window (and not hide it itfp)
Offline