Comments (3)
I'm not sure it will fix your issue, but you should try printing with print(line[-1], flush=True)
.
Doing this fixed some of my script, so it might works for you.
from eww.
I'm not sure it will fix your issue, but you should try printing with
print(line[-1], flush=True)
. Doing this fixed some of my script, so it might works for you.
thanks it worked! but one more thing:
in the line below, is it invalid to set the initial value of deflisten as the output of an command?
I ran eww state and it shows the literal command that I ran instead of the output of the value.
(deflisten active-ws
:initial `hyprctl activeworkspace -j | jq '.id'`
`scripts/hypr.py -a`)
;; eww state
;; active-ws: hyprctl activeworkspace -j | jq '.id'
from eww.
That is indeed invalid! The idea of the initial value is to have some value that shows before any scripts push their first output, thus setting the initial value to some command would mean that eww would still have to wait for the command to finish before being able to proceed with rendering anything. To ensure that your variable is set to a correct value as fast as possible, I recommend just starting out your hypr.py script by running hyprctl activeworkspaces -j | jq .'id'
, such that eww gets a meaningful value as fast as possible.
And ye, that flush=True
fix ensures that your script actually outputs the data, rather than just buffering it and then printing it in some batch at some point -- eww can't really do anything to avoid this being required :/ Thus, I'll close this issue. Feel free to re-open or create a new one if there are other issues.
from eww.
Related Issues (20)
- [FEATURE] Run Command to Initialize `deflisten` Variables HOT 1
- [BUG] Listeners aren't function properly (I think?)
- [BUG] Rendering regression with Phosphor font HOT 3
- [BUG] EWW_RAM returning strange values HOT 2
- eww crates.io name HOT 5
- [META] gtk3-rs is no longer being maintained HOT 2
- [FEATURE] Re-render Only When Variable Changes HOT 1
- [BUG] eww systray draws its own menus rather than letting the applications draw their own menus HOT 2
- [BUG] Wrong time in eww HOT 3
- [BUG] Show-truncated in labels and buttons HOT 3
- [BUG] Expander widget does not expand if name is specified
- [BUG] Eww uses monitor model instead of a serial HOT 4
- [BUG] Calendar auto returns to current date when changing month or year
- [BUG] Cargo.lock version is incorrect in latest release HOT 1
- lto build HOT 2
- [FEATURE] allow partially exclusive HOT 1
- [BUG] Failed to initialize eww paths, Caused by Permission denied HOT 1
- [FEATURE] Add systray class when it is empty HOT 3
- [FEATURE] Resize bars when running
- [BUG] scss color property not updating when switching to desktop
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eww.