Closed HalfdeadBone closed 1 year ago
Eww provides you with the EWW_CMD
magic variable, which can be used to simplify your command in this case.
With that, your on-click handler or whatever can look like :onclick "${EWW_CMD} close my-widget
or `:onclick "${EWW_CMD} close-all
, respectively.
I'm not quite sure what exactly you're asking for here, to be honest
Oh sorry i am overthinker and i caused a little chaos. I have started to do the explanation of what i am doing and later didn't precise proposition
So the problem that i had, was that sometimes when using bash the location or naming might be off and you need to do it statically or think around it to make it dynamic. Also i have not found any Dynamic solution, to call for names, at least in projects from /r/unixporn. (mostly names of all widgets)
My thinking, was that the best option would be $CLOSE_ALL
and $CLOSE
and W_NAMES
(widget names) for 2 reasons:
$EWW_CMD
variable - i missed it in "Magic Variables" and i have spent some time to find a workaround solution. Sorry for the chaos.
Description of the requested feature
As the title said - simple comand inside .yuck that could
CLOSE
orCLOSEALL
widgets in choosen daemon?Workaround : Thanks to
--config
flag we can use sh like this:(Same goes for opening) because daemon runs it the chosen config
pwd
(command for "where am i" in linux) with chosen widgets it is posible to close and open them.Using this command we execute
:onclick "/close.sh widget"
for the output of what widget is opened in directory via(deflisten ALLWIDGETS ./allwidgets.sh )
HOWEVER this solution kills ALL widgets - even inactive.
Proposed configuration syntax
You can associate the action like in previous part, by sending
eww
call frompwd
Whole example here https://github.com/HalfdeadBone/CloseYuckExampleOR
By using Built in functions, that has been written in rust + how the daemon works:
I don't know rust to do the commit Edit: I'm gonna try.
Additional context
No response