eww icon indicating copy to clipboard operation
eww copied to clipboard

[FEATURE] define placeholder "{}" as var

Open x70b1 opened this issue 1 year ago • 0 comments

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 avatar Aug 30 '24 20:08 x70b1