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

[FEATURE] Window TTL #859

Closed
heroin-moose opened this issue Aug 4, 2023 · 5 comments
Closed

[FEATURE] Window TTL #859

heroin-moose opened this issue Aug 4, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@heroin-moose
Copy link

heroin-moose commented Aug 4, 2023

Description of the requested feature

Consider giving a window an optional time-to-live attribute: when the window has been opened it has ${TTL} seconds to live. After that the window is automatically closed. Subsequent eww open <window> calls should reset the timer.

A typical use case would a desktop notification of a sort (e.g. brightness or volume level).

Proposed configuration syntax

(defwindow brightness-level :time-to-live "5s" [...])

Additional context

No response

@heroin-moose heroin-moose added the enhancement New feature or request label Aug 4, 2023
@skiletro
Copy link

skiletro commented Aug 6, 2023

I doubt this would be added since it can be implemented just using scripts instead, but it definitely be a lot easier

@heroin-moose
Copy link
Author

And far less racy.

@viandoxdev
Copy link
Contributor

And far less racy.

I agree, this is one of the features it would make sense to implement into eww. I've done this with scripts before but it usually involves lock files and timestamps or UUIDs. Overall more complexity than I would hope for a relatively simple (and useful) behavior. I might look into it some time later (on vacation right now) but no promises.

@elkowar
Copy link
Owner

elkowar commented Aug 10, 2023

Funny that you mention this, I've literally started working on this exact feature on the side a few days ago! I feel as though it definitely makes sense to have, as it makes eww immediately 10x more convenient for popups (i.e. a volume popup when changing volume)

This would then also harmonize very well with potentially adding window args (#431) which I still want to get back into soon

@elkowar
Copy link
Owner

elkowar commented Feb 17, 2024

Implemented in a9a35c1

@elkowar elkowar closed this as completed Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants