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] Preserve Dynamic Content After "Hot-Reload" #1250

Open
hwangthienhoang opened this issue Dec 22, 2024 · 0 comments
Open

[FEATURE] Preserve Dynamic Content After "Hot-Reload" #1250

hwangthienhoang opened this issue Dec 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@hwangthienhoang
Copy link

Description of the requested feature

Issue:

Currently, whenever Eww resources (e.g., yuck, scss, etc.) are updated, the windows reload, and all dynamic content rendered previously is lost.

Example:

When toggling dark mode (which updates scss), my list of notifications is cleared. These notifications are rendered using a deflisten variable. While switching to defpoll could bypass this issue, it’s not an ideal solution due to potential performance and design concerns.

Suggested Solutions:

Introduce :initial with CLI/Method Support:
Allow :initial attributes to access the results of CLI methods or other attributes dynamically.

I'm seeking a clean and efficient approach to handle this scenario and would appreciate any solutions or improvements.

Proposed configuration syntax

No response

Additional context

;; (deflisten notifications :other_initial "cat /.cache/notifications.json" "/.config/eww/scripts/notictl.sh listen -total")
(defpoll notifications :initial '{"count": 0, "notifications": [], "popups": []}' :interval "1s" "cat ~/.cache/notifications.json")``

@hwangthienhoang hwangthienhoang added the enhancement New feature or request label Dec 22, 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

1 participant