swaywm/sway

Idle inhibit if a window is focused which matches some criteria

Closed this issue ยท 6 comments

inhibit_idle [criteria] focus|visible|open

How about [criteria] inhibit_idle focus|visible|open? It'd be less code (don't have to deal with criteria in the command) and users could bind it to a key so it can run on the currently focused view.

Then it should be possible to use it with for_window [criteria] ... as well I think.

for_window [criteria] inhibit_idle  -> configuration for future windows
[criteria] inhibit_idle  -> assign to currently open windows
inhibit_idle  -> assign to focused window only

Hmm, I'm not sure I like that design.

We could also add inhibit_idle fullscreen to only inhibit idle if fullscreened.

For me it looks like inventing the wheel and making sway do the work of swayidle.
Shouldn't swayidle just implement org.freedesktop.PowerManagement? The only problem is that I was unable to find a specification for it (all links I found are 404). However, a lot of applications and desktop environments use it.

For me it looks like inventing the wheel and making sway do the work of swayidle.

Nah, applications can inhibit idle for a specific surface, making it possible to e.g. turn off all screens except the ones where a video is playing.