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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply shader selectively using picom #33

Open
theottm opened this issue Apr 4, 2024 · 4 comments
Open

Apply shader selectively using picom #33

theottm opened this issue Apr 4, 2024 · 4 comments

Comments

@theottm
Copy link

theottm commented Apr 4, 2024

Hi,

picom allows one to apply a shader to a specific window using a matching pattern, including name, window type, window state, etc. I am having a hard time finding how to match things properly in EXWM and I probably need a lower level understanding of how EXWM works. Maybe you can help me ?

It seems like what appears as a window is made of different layers. First the proper X window, then appearing under it, an emacs frame. It looks like the X window is associated to a buffer of that frame. Now I more or less see how I can manipulate these things in emacs, though I am not sure how I can access them from picom.

How can I match the emacs frame that is behind a window ? How can I match all the X windows without matching the underneath emacs frame ? Is there some attribute that distinguishes them, like _NET_WM_WINDOW_TYPE, or is one the child of the other, or any other way I could distinguish them ?

For example if I do
picom --backend glx --window-shader-fg-rule invisible.glsl:'_NET_WM_WINDOW_TYPE@:a *= "NORMAL"' I can match all the X windows and the emacs frames, which seems to boil down to everything apart from polybar in my setting.

Cheers,

Théo

@theottm
Copy link
Author

theottm commented Apr 4, 2024

I found a way thanks to xprop.

It seems that the X windows consistently have this property _NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
while emacs frames have
_EMACS_SERVER_TIME_PROP(ATOM) = _EMACS_SERVER_TIME_PROP. Assuming this is enough to characterize them, we can use these props to match.

So to match all emacs frames: '_EMACS_SERVER_TIME_PROP@:a %= "*EMACS*"'
and to match all X windows: '_NET_WM_ALLOWED_ACTIONS@[*]:a = "_NET_WM_ACTION_MINIMIZE"'.

@Stebalien
Copy link
Contributor

You should match Emacs on the WM_CLASS ("emacs", "Emacs"), but the shader will apply to the entire frame, not individual windows.

Other windows are basically just windows without that WM_CLASS, although you likely want to restrict your matches to WM_STATE "normal".

@theottm
Copy link
Author

theottm commented Apr 4, 2024 via email

@Stebalien
Copy link
Contributor

You can probably give your EXWM windows a custom frame title.

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

2 participants