Stuart Henderson <[email protected]> wrote:
> On 2023/11/09 11:38, Landry Breuil wrote:
> > The wordexp() use is awkward so i've replaced it by an ugly handrolled
> > lookup for configs in:
> > - $HOME/.sway{idle,lock}/config
> > - $XDG_CONFIG_HOME/sway{idle,lock}/config
> > - $HOME/.config/sway{idle,lock}/config if $XDG_CONFIG_HOME is unset
> > - and fallback to /etc/sway{lock,idle}/config
> >
> > the wordexp() use for paths/image locations was also super awkward, but
> > with image=/usr/local/share/backgrounds/xfce/xfce-blue.jpg
> > in ~/.config/swaylock/config swaylock correctly loads the background
> > image, so just use full paths... or rely on $PATH for swayidle commands.
>
> Obviously we don't want full wordexp but it would be nice if we had
> _something_ better and easy to use in place of the various ad-hoc
> wordexp alternatives that are in-tree (at least 10 ports already, plus
> these two, and as it seems popular with some of these wayland-related
> ports maybe we'll see more from there).
>
> For some existing ports we patch to use glob() instead (though this
> can break documented use of the software e.g. $VAR, and is totally
> unusable for what swaylock/swayidle try to do), for others hand-
> rolled alternatives of varying quality (this one for example has
> unchecked malloc).
>
> Most programs really just want ~ and $VARIABLE expansion (though
> of course they don't bother to set WRDE_NOCMD...)
I think the point is these pieces of code must always be written
narrowly to do just what they need to -- and nothing extra -- except always
that little bit of extra starts to be depended upon, and soon you have full
return to shell equivelancy
it's just plain awesome /sarc
"they" will continue to call system() -- oh i mean wordexp() -- because
they don't realize it is the same thing
they, n.
the children writing wayland from scratch hoping to introduce all the old
types of holes from the 90's.