Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to use solid color to flash instead of transparency #1

Open
synaptiko opened this issue Apr 6, 2018 · 5 comments
Open

Ability to use solid color to flash instead of transparency #1

synaptiko opened this issue Apr 6, 2018 · 5 comments

Comments

@synaptiko
Copy link

This is not exactly an issue more like feature request or question.

I really like the idea 馃憤 Good job. But because I use non-solid background, the effect doesn't look like that good with as on the demo gif.

Is there a way to flash by solid color instead of transparency? I mean that you could define blue color & some threshold for blending and this would be used as an "focus" effect.

What do you think?

@Airblader
Copy link

It'd have to use an entirely different mechanism, at least. The only (possibly) good way I see is using the composite overlay window to draw in the area of the window in an animated way. Would be quite a bit more involved.

With the current mechanism I don't see how it'd be possible.

@fennerm
Copy link
Owner

fennerm commented Apr 6, 2018

Yeah this is something I'd love to implement but it would be tricky. I'll do some reading on composite overlay windows and try to get a sense of the scale of the problem.

It seems like this might also open up more complicated types of animations though, which would be cool.

@jpmvferreira
Copy link

Apologies for bothering, but is this feature something that is still being considered to implementation?
I would certainly enjoy very much if this were to be implemented, and I'm not alone, but I have been discouraged of trying to do so myself because of how hard it seems to be (and how frightening it is to start looking at a new code base).
There doesn't seem to be a "buy me a coffee" section on this Github repository, but I certainly would if there were!

@fennerm
Copy link
Owner

fennerm commented Aug 29, 2023

Hey @jpmvferreira thanks for reaching out. Unfortunately I can't see having time to implement this even with your kind donation offer.

My understanding is that it would be a a bit tricky - especially for someone who has minimal X11 knowledge like myself.

I'd be overjoyed to accept a PR though and would be happy to support however I can.

@jpmvferreira
Copy link

In case somebody is looking for a very specific workaround, which suits me well in this case, I've made a small shell script that detects whether the user is focused on a window or not, and if so, sets the background to a given color. Otherwise, if the focus is on the root X window, then it sets the usual background.

Here is the code:

#!/bin/sh

# set desired color
COLOR=grey

xprop -spy -root _NET_ACTIVE_WINDOW | stdbuf -o L cut -d " " -f 5 | while read -r WINDID; do	
	if [ "$WINDID" == "0x0" ]; then
		$HOME/.fehbg
	
	else
		hsetroot -solid $COLOR
	fi

done

It requires that the background is set by feh and that hsetroot, stdbuf and xprop are available in your system.
Run this in the background after X has started and it should work (you shouldn't probably trust my shell scripting that much, but it works for me!).

I've been thinking of doing a fade-in/fade-out animation by setting wallpapers really fast, but this would require a set of images to be pre-processed, put in a folder, and then call feh to animate it.
It could be done, but I don't think it would be that straightforward and there are a couple of edge cases which might show up that would require a more robust solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants