-
Notifications
You must be signed in to change notification settings - Fork 57
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
[Feature Request] Shell / text provider #75
Comments
providers:
- type: 'shell'
alias: 'music'
command: 'node music_player_backend.js'
update_method:
continuous: false
interval: 5000
template: |
{{ music.output }}
{{ music.prevOutputs }}
Edit (Dec. 2024): the suggested config snippet above was for Zebar v2, which has since been overhauled to a new format/architecture. |
That sounds perfect to me! |
Parsing a text file would be handy. Then users could script in whatever language they want and write to a file. Personally I'd want to exec PowerShell, but I'm perfectly happy writing to a file and having zebar read it. |
I was really missing the feature, so I made the following workaround for myself that works. It's a simple GET request on an webserver and within the webserver i'm calling an CLI script. function App() {
......
const [commandOutput, setCommandOutput] = useState('Timer isn\'t set.');
useEffect(() => {
.....
const interval = setInterval(fetchCommandOutput, 20000); // Refresh every 2 minutes
return () => clearInterval(interval);
}, []);
const fetchCommandOutput = async () => {
try {
const response = await fetch('http://localhost:9999/time-tracking');
const text = await response.text()
setCommandOutput(text);
} catch (error) {
setCommandOutput('Unable to fetch timer.')
}
} <div className="right">
<div className="time-tracking">
{commandOutput === 'off' ? (
<>
<i className="nf nf-md-timer_off" /> No active timer
</>
) : (
<>
<i className="nf nf-md-timer_check" /> {commandOutput}
</>
)}
</div>
..... |
Has the new version of GlazeWM and ZeBar resolved the issue of reading local files? Which version is it? |
Summary
Request to add support for reading from text files and/or executing scripts at scheduled intervals in Zebar.
Description
I've used GlazeWM v2 to display time tracking information from Toggl. I've created a shell script to output the status of a CLI to a text file, which was then read by the status bar. A cronjob on my local machine ran the script every two minutes to keep it up-to-date. Can Zebar include a feature to read from a text file or possibly execute a script at scheduled intervals?
Use Case
This feature would be useful for displaying dynamic and real-time information from various sources, such as time tracking tools, system monitoring scripts, or any other data that can be output to a text file or script.
PS: I've just installed the new version of GlazeWM & Zebar and it works great!
The text was updated successfully, but these errors were encountered: