site  contact  subhomenews

JWMDesk desktop icons fix, take-2

April 23, 2022 — BarryK

I posted about JWMDesk here:

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

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
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

#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
for aX in 672 736
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
#...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