At Mon, 14 Sep 2026 09:09:42 -0600, "DTB" <[email protected]> wrote:
Subject: Re: Cooless with feh
>
> On Mon Sep 14, 2026 at 6:45 AM MDT, Todd Gruhn wrote:
> > OOOOH. What is '$y' ?
>
> The $y variable in the sh(1) script refers to the Y-coordinate offset,
> which changes to apparently slide the wallpaper down. Here's a version
> of the script which way work better (as $y is unassigned when the script
> first invokes feh(1), making the invocation invalid and terminating the
> script prematurely):
>
> sh -ec '
> while :; do
>       pkill feh || true
>
>       y=$(echo $y 1 + p | dc) # +1 per round
>       test $y -gt 100 && y=0  # 0-100
>
>       feh --class wallpaper -g +0+$y /path/to/wallpaper.tif
>
>       sleep 5
> done' &

BTW, the NetBSD shell(s) can do arithmetic without need for external
commands:

        y=$((y + 1))

e.g. counting 1-5:

        sh -c 'y=0; while [ $y -lt 5 ]; do y=$((y + 1)); echo $y; done'

--
                                        Greg A. Woods <[email protected]>

Kelowna, BC     +1 250 762-7675           RoboHack <[email protected]>
Planix, Inc. <[email protected]>     Avoncote Farms <[email protected]>

Attachment: pgpgpVwVZDHAQ.pgp
Description: OpenPGP Digital Signature

Reply via email to