kolunmi / sandbar

dwm-like bar for the river wayland compositor
Other
40 stars 4 forks source link

Document how to run a script every n seconds and how to redirect this to fifo #13

Open Brixy opened 1 year ago

Brixy commented 1 year ago

Hi and thank you very much for your work.

I would like to switch to sandbar from waybar; but honestly: I don’t quite understand how to work with fifo.

This works:

VOLUME=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
TEST="A test."
echo "all status $VOLUME $TEST" >$FIFO

But how can I run a) a script that checks the volume every second and b) another script that checks the wifi status every 10 seconds and redirect these to $FIFO?

Thank you!

Edit: The following command works very well; but I don’t whether this is the suggested and an energy efficient method as it is not possible to select different sleep intervals for different contexts.

riverctl spawn 'while true; do ~/.config/river/sandbar-status.sh; sleep 5; done'
Tomcat-42 commented 4 months ago

Hi @Brixy, see if #16 addresses your issue (I pretty sure that it does), and if it's ok could you please close this issue?