You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add variables that runs a script before opening the window.
exec: Runs everytime the config is loaded.
exec-once: Run once i.e. while loading the window for the first time.
Currently there's a workaround for this. Use deflisten to initialise a script and exit the script with exit N. But adding a variable for this particular a particular job looks neat. Plus since exec and exec-once don't return anything it may not be called a variable. We can name it something else.
Another improvement is it you can make defvar more flexible by making it run an internal script and store the last ever line printed by the script. This can be useful for i.e. calendar widget where everytime you click on a button to open calendar, it'll show the current date. I know there's this solution "why not use formattime() and print the year directly" but when we need to jump between different dates we'll need to store the current date/year.
I will greet any improvements or workaround to my comment. Thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Add variables that runs a script before opening the window.
Currently there's a workaround for this. Use
deflisten
to initialise a script and exit the script with exit N. But adding a variable for this particular a particular job looks neat. Plus sinceexec
andexec-once
don't return anything it may not be called a variable. We can name it something else.Another improvement is it you can make
defvar
more flexible by making it run an internal script and store the last ever line printed by the script. This can be useful for i.e. calendar widget where everytime you click on a button to open calendar, it'll show the current date. I know there's this solution "why not useformattime()
and print the year directly" but when we need to jump between different dates we'll need to store the current date/year.I will greet any improvements or workaround to my comment. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions