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] define placeholder "{}" as var #1184

Open
x70b1 opened this issue Aug 30, 2024 · 0 comments
Open

[FEATURE] define placeholder "{}" as var #1184

x70b1 opened this issue Aug 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@x70b1
Copy link

x70b1 commented Aug 30, 2024

Description of the requested feature

As far as I can see the {} placeholder in the :onscroll option in the eventbox widget is inserted into the executed command. To work with it the common way is to use a shell condition and do things depending on that.

The example:

(defwidget example []
    (eventbox :onscroll "if [ '{}' == 'up' ]; then echo up; else echo down; fi"

... more settings ...

)

It would be cool if the condition would be possible in the existing yuck way. To get this done we need a predefined variable that contains the event information. Something like this, so that no shell condition is needed (only a shell command is used as example):

(defwidget example []
    (eventbox :onscroll "${( onscroll.direction == "up" ? "echo up" : "echo down" )}"

... more settings ...

)

This idea is probably not only relevant for :onscroll but also for other functions that use {}.

@x70b1 x70b1 added the enhancement New feature or request label Aug 30, 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