site  contact  subhomenews

JWMDesk desktop icons fix, take-2

April 23, 2022 — BarryK

I posted about JWMDesk 3.5.1.3 here:

https://bkhome.org/news/202204/jwmdesk-desktop-icons-fix.html

Roger looked at the PET and advised me of a problem with my fix, so I have fixed the fix, now bumped to 3.5.1.4.

The problem is that JWMDesk can change the default y-axis gap of the first row of icons at the top of the screen (32 pixels), and also change the default y-axis spacing between icons (96 pixels).

I fixed JWMDesk (I think), but this has lead to other issues in EasyOS, where those "32" and "96" pixels parameters are hard-coded.

The main problem, immediately apparent problem anyway, is the logic that places container icons. I have modified /usr/local/easy_containers/ec-fix-desktop, changes in bold:

#20220423 ref: jwmdesk /usr/local/desksetup/func
Y_EDGE_GAP=32; Y_SPACING=96
Y1=128; Y2=224; Y3=320; Y4=416
if [ -d /root/.desksetup ];then
#define gap between desk icons and screen top
Y_EDGE_GAP=$(cat /root/.desksetup/edge-gap 2>/dev/null)
[ ! "$Y_EDGE_GAP" ] && Y_EDGE_GAP=32
#spacing along y-axis changes if no labels...
ICON_LABEL="$(cat /root/.desksetup/icon-label 2>/dev/null)"
[ "$ICON_LABEL" == "Off" ] && Y_SPACING=76
Y1=$((${Y_EDGE_GAP}+${Y_SPACING}))
Y2=$((${Y1}+${Y_SPACING}))
Y3=$((${Y2}+${Y_SPACING}))
Y4=$((${Y3}+${Y_SPACING}))
fi

#code from easy-containers... 20220423 replace y-coords with variable Y1 etc...
find_free_coords_func() {
for aY in $Y1 $Y2 $Y3 $Y4 #128 224 320 416
do
for aX in 672 736
do
aPTN="x=\"${aX:0:2}[0-9]\" y=\"${aY:0:2}[0-9]\""
grep "$aPTN" /root/Choices/ROX-Filer/PuppyPin > /dev/null
[ $? -ne 0 ] && break 2
done
done
#...aX and aY are free coordinates.
}

The three inbuilt container icons should already exist in PuppyPin, so the above function is for drawing extra containers. Having obtained the free coordinates, the script then goes ahead and creates the icon in PuppyPin.

Haven't tested the above changes yet, but seems logical.    

Tags: easy