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

Persistent shell commands that print a new content as a new line on standard output. #849

Open
amano-kenji opened this issue Aug 5, 2023 · 6 comments

Comments

@amano-kenji
Copy link

amano-kenji commented Aug 5, 2023

Checking some things on a regular basis introduces delay and is inefficient.

For example, if a persistent shell program is a wireplumber script that listens to pipewire events, then it can print a new line to standard output in response to certain pipewire events.

It's inefficient to check the pipewire volume levels every few seconds.

@amano-kenji amano-kenji changed the title Support persistent shell commands that print a new content as a new line on standard output. Persistent shell commands that print a new content as a new line on standard output. Aug 5, 2023
@terminalmage
Copy link
Collaborator

If you don't want something to actively check, then use threading to run the script. Many i3pystatus modules already do this. The threading target can simply update self.output when it has new info, and changes will be reflected in the status bar the next time the interval passes.

@amano-kenji
Copy link
Author

amano-kenji commented Sep 12, 2023

I don't understand what you just wrote, but I want changes to be reflected immediately.

This issue is the reason that I'm migrating to i3blocks.

@terminalmage
Copy link
Collaborator

Without more details, and with that kind of attitude, you're not likely to get much help.

From what I can understand, from the little information you've provided, this seems like something that the shell module is not well-suited for.

If you'd like to provide a more detailed feature request, perhaps someone can take a look.

@amano-kenji
Copy link
Author

On https://github.com/vivien/i3blocks#interval, you can read

The interval value persist (or -3) expects the command to be an infinite loop. Each line of the output will trigger an update of the block.

I want this.

@terminalmage
Copy link
Collaborator

@enkore Functionality like this may be useful, specifically for the shell module. However, i3pystatus.core would still end up attempting to execute the module's run function when the interval has passed, and negative intervals would probably mess with i3pystatus.core.threading. What do you think?

@amano-kenji
Copy link
Author

amano-kenji commented Mar 7, 2024

Because I was frustrated by all existing i3bar/swaybar status programs, I created my own i3bar/swaybar scripting system.

https://codeberg.org/amano.kenji/j3blocks is more difficult to use, but it is very flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants