Closed Botspot closed 3 years ago
I did it like this:
screen_width="$(xdpyinfo | grep 'dimensions:' | tr 'x' '\n' | tr ' ' '\n' | sed -n 7p)"
screen_height="$(xdpyinfo | grep 'dimensions:' | tr 'x' '\n' | tr ' ' '\n' | sed -n 8p)"
height=700
width=800
xposition=$(((screen_width/2)-(width/2)))
yposition=$(((screen_height/2)-(height/2)))
scrot -a "$((xposition+1)),$((yposition+33)),${width},${height}" blur.png
convert -blur 10x5 ~/blur.png ~/blur.png
xlunch -g ~/blur.png --width $width --height $height --xposition $xposition --yposition $yposition
Notice I had to account for the window border when I did $((xposition
+1
)),$((yposition
+33
))
. I think if xlunch had an option for this, it would be a cleaner way to do it, and the blur would not be offset on other installs with differently-sized window borders.
The problem is that there isn't really a clean solution for this on all systems, and it would potentially add a dependency to xlunch which we try to avoid to keep it light. Since windows in X can be moved and resized multiple times before the user even sees them it's not as simple as grabbing it once on startup from within the program. And calling another program to deal with this from inside xlunch in quite hacky. The truth is that this can already be achieved much better than any hack we can implement by adjusting a couple settings in most compositors. So a hack in xlunch to do something a script could do and a compositor could do better simply isn't a good value.
Hmm, I see your point.
Yeah it's a bit unfortunate, but this inter-window relationship is really the domain of the compositor.
I wonder how conky
does it. Conky uses a pseudo-transparent background, ie, it captures what's behind it and uses that as its own background. It does not require a compositor to work.
Conky could probably blur it's background quite easily.
Perhaps we could do something like this? (a pseudo-transparent background at least)
Yeah it's not impossible, but it requires us to add a blur algorithm to xlunch and a bunch of logic for capturing what is behind it. All the while compositors are available and ready to use this effect.
I did it and it looks amazing!
![2020-11-27-112336_1920x1080_scrot](https://user-images.githubusercontent.com/54716352/100473113-3ca23d00-30a3-11eb-8559-cde74e05c2fb.png)
Are you sure this is out of the scope of xlunch? (I think many people would find it useful)