You are not logged in.
I currently am running i3 as my wm with compton as a compositor. I noticed this piece on the arch wiki about compton.
opacity-rule = [
"90:class_g = 'URxvt' && focused",
"60:class_g = 'URxvt' && !focused"
];It adjustes the opacity based on whether the window currently is focused or not. However I think I would prefer if it tinted the window instead. Not sure if compton actually supports tinting windows, couldn't find anything. Also would be nice if the effect only lasted while actually switching windows, only to turn back a few seconds later.
Anyone have any ideas?
Last edited by chrjen (2019-01-09 22:48:09)
Offline
fwwi, urxvt in particular can tint itself, "urxvt -fade 50 -fadecolor '#666666'"
Compton supports "inactive-dim" - see the wiki you linked.
Offline
Yes «inactive-dim» is what I was looking for it seems, thank you. Really helps with seeing which
window I am currently focusing when switching using the keyboard. Also I don't use URxvt, I just
copy-pasted the example from the wiki, but thanks again.
Though would be even more amazing if it was only like that when actually switching between
windows, as mentioned above. ![]()
Offline
I'm frankly not sure how you vision that - do you want an effect on the focused or the focus loosing window (and why)?
Offline
I want the effect when switching between windows because it's not always
easy to tell which window I am currently focusing. It would be extra nice
if it only lasted while switching.
Offline
#!/bin/bash
last_act=0
while read dummy dummy dummy dummy act_win; do
((act_win == 0 || act_win == last_act)) && continue
last_act=$act_win
echo "Active: $act_win"
while read wid dummy; do
(( $wid != $act_win )) && xprop -id $wid -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 2147483645
done < <(wmctrl -l)
sleep 0.25
while read wid dummy; do
(( $wid != $act_win )) && xprop -id $wid -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 4294967295
done < <(wmctrl -l)
done < <(xprop -root -spy _NET_ACTIVE_WINDOW)You'll need xprop and wmctrl, the script is full of bashisms, so keep the shebang. Also be aware that the WM *might* interfere (dunno for i3wm) by setting the active transparency itself.
Offline
Well it kinda works, though not quite. For one it uses opacity which doesn't
do much for me since most of my windows are already translucent, but more
importantly it handles every event with the delay. So if I toggle between two
windows really fast, faster than 0.25 seconds, your scripts starts lagging behind
and you just end up with flicker as it tries to catch up. It only gets worse the
bigger the delay is.
Offline
Play around with the numbers used in the script. There's that "sleep 0.25" in the middle for the delay, try something else.
And those confusingly looking decimal numbers you see can also be written like this in bash:
2147483645 --> $(( 0x7ffffffd ))
4294967295 --> $(( 0xffffffff ))To change opacity you can tweak that "7f" in the front, and the color is that "ff ff fd" part.
Offline
Hi Ropid,
I already tried messing with the sleep, it's what I meant by delay. However
increasing it only exacerbates the issue I mentioned. Also I tried messing
with the colours as you suggested, but they didn't do anything sadly.
Offline
It's possible to fork the inner loop and kill the running one (covering for fast switches in a row), but tinting is a no-starter: the property (introduced by xcompmgr and supported by pretty much all compositors) only controls the opactiy (as the name kinda gives away) - there's no color component, it's just a 32bit integer.
You could probably maintain original opacities, if that's your concern.
And of course you could patch compton - no idea whether such feature would be accepted upstream.
Offline