Re: [dev] [dwm] New software: swm & infobar

From: Raymond Cole <rc_AT_wolog.xyz>
Date: Tue, 5 Nov 2024 08:34:49 +0000

On 24/11/04 12:06AM, Jeremy wrote:
> I like this
> if [ "$butt" -eq 1 ]; then
>

My terrible humor LOL.

On second thought, I think that's awful in terms of readability so I've
just renamed it "button".

> I did my bar a similar way, except each widget is a script responsible for its own formatting, like:
> mpc status -f '%artist% ~ %title%' | if read -r song && read -r state rest; then
> case "$state" in
> '[playing]') echo "$song ►";;
> *) echo "$song ◼";;
> esac
> else
> echo "◼"
> fi; mpc idle >/dev/null
>
> And then the main bar program loops each script. Only problem is when
> I fuck myself & create 900000 processes for no reason then my bar stops
> working.
>

I had a look at your bar program. So it has background scripts that
output to files independently and depends on inotify to wait for updates.
One of my first ideas of infobar is the same in essense, but with
scripts writing to FIFOs instead of files and without use of inotify.
But with that approach, if multiple scripts update per minute or per
second independently, the moment they output won't be aligned, resulting
in more updates of the bar. I took a different approach also for reducing
the number of processes and making it easier to respond to input.

In daily usage people only glance at the status once in a while and most
information is needed only very occassionally, so I think it's ideal
that the status monitor runs highly economically by default, while more
frequently updated information is handily available with a click.

> I did a shorter version of fifolog(conccat) without line-delimiting a
> little while back - see below.
>
> [...]

Nice. I will see if I can borrow some ideas.

Thank you for responding, Jeremy. Your further comments will be
appreciated.

Raymond
Received on Tue Nov 05 2024 - 09:34:49 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 05 2024 - 15:36:09 CET