Skip to content

[FEATURE] Dynamic adding of defvar's, defpoll's and deflisten's #1312

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

Open
NopeImNotHere opened this issue May 5, 2025 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@NopeImNotHere
Copy link

Description of the requested feature

This might have already been answered or somehow implemented, but a way to create new Vars through passing them in through a literal.

Proposed configuration syntax

(literal :content "(defvar test false)"), etc.

Additional context

I've been trying to add a dynamic tray by using the revealer with multiple button's to jump to the windows in Hyprland, I however am not able to add the vars dynamically to be able to activate the revealer.

@NopeImNotHere NopeImNotHere added the enhancement New feature or request label May 5, 2025
@NopeImNotHere
Copy link
Author

rough draft will add more information later

@NopeImNotHere
Copy link
Author

Here's the Information:
I am currently trying to create an Application "tray" which holds an Icon of the current open Applications, this Icon needs to have a revealer which then should reveal Buttons for all the different open Windows. The Issue I have run into is that the revealer needs static variables of true or false, these static variables need to be predefined. Of course, I can't predefine static variables for all of my Apps that I might or might not use. Which is why I thought maybe one can just pass the vars through a literal sadly that does not seem to be the case.

Potential Code

(defwidget applications []
  (box
    (literal :content ("defvar variable false"))
    (eventbox
      :onhover "update variable somehow"
      :onhoverlost "update variable somehow"
      (box :space-evenly false
        (label :text "test")
        (revealer :reveal variable
          :duration "100ms"
          :transition "slideleft"
          (label :text "Green" :class "green-label"))
        (revealer :reveal variable
          :duration "100ms"
          :transition "slideleft"
          (label :text "Red" :class "red-label"))
        
      )
    )
  )
)

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