Any way to fool JWM and/or ROX regarding desktop size?

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

Unfortunately it seems that running the drive icons manager (to push the icons more to the center) rewrites the PuppyPin and the other desktop icons move left while the drive icons move right.
If I switch to a PuppyPin that repositions the desktop icons to the right it also forces the drive icons back to their leftmost positions. Hmmmph.
Have to unite/synchronise these two functions somehow...
(Surely drive icons and desktop icons should respect the same left hand margin shouldn't they?? Or at least not modify each others positions)

User avatar
MochiMoppel
Posts: 1119
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 359 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by MochiMoppel »

greengeek wrote: Fri Jan 26, 2024 8:50 pm

I always find X Restart a bit annoying - but hey it's way better than a full reboot.

In your case it's more than annoying, it's

  • dangerous (like all X restarts as they kill applications instead of closing them)
  • useless, because you want to switch pinboards. A restart is hardcoded to start ROX with a pinboard named "PuppyPin", but your alternate pinboard would have a different name. If I understand @mikewalsh 's remarks correctly, his scenario is different. He wants to replace a messed up PuppyPin with a good one he had saved somewhere outside Puppy. But even in his case a X restart is not necessary, not even a restart of ROX-Filer. ROX-Filer allows to switch engines while in flight :o

So at the moment in order to reposition my desktop icons - I think i would need to create an alternative PuppyPin, switch to that, then simply revert to the original when I toggle out of shrunken mode.

A real toggle is a bit tricky because there is no reliable way to tell, which of your pinboards is currently in use, but yes, something like a toggle is possible. Much easier and probably sufficient for a start would be 2 buttons/icons, one for each pinboard.

Does the "Lock" icon comment here apply in modern Pups?

This is an old comment and applies to an old version of the fixPuppyPin script. May be better to move right side icons to the left to avoid fixPuppyPin 's attention. You'll have to move them anyway to your visible area.

Unfortunately it seems that running the drive icons manager (to push the icons more to the center) rewrites the PuppyPin

Yes, if you push "Refresh/Realign existing button". In case of newly created buttons the setting works even for alternate pinboards.

and the other desktop icons move left while the drive icons move right.

Can't confirm. Other icons are not affected.

User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

MochiMoppel wrote: Fri Jan 26, 2024 1:06 pm

Pinboards can be conveniently switched with a command like rox -p /path/to/tvpin and switched back to PuppyPin with rox -p /root/Choices/ROX-Filer/PuppyPin

This may be the best way for me to reposition icons horizontally (Both desktop icons and drive icons at once). I have put together a script that will read PuppyPin line by line and add "100" to the x value for each icon. Then it creates a new "PuppyPin_rightshift100" and switches to this file - leaving the original PuppyPin untouched.
This is intended to achieve the rightward displacement of the desktop icons (by 100 pixels).

This is ok for me because I only have a few icons at the left of the screen. WILL NOT suit anyone who has LOCK icon or trash etc at the right side (as it will push icons off screen which is the opposite of this exercise...). Also I seldom have more than 6 or so drive/partition icons.

I would probably have to re-use this script each time after plugging in any new usb drives as event manager would push drive icons (at least) back to the left.

As Mochi suggested - I would have to have a second script that returns to the original PuppyPin to get things back to normal.
This combination would be only one part of the overall objective to pull all desktop icons and tray towards the centre.

Use at own risk.
DO NOT use this script if you have a save file or save folder.

Testing purposes only
Remove false .gz suffix

PuppyPin_rightshift100.gz
Remove false .gz suffiz
(929 Bytes) Downloaded 11 times

.
And to restore to original PuppyPin - use this script:

PuppyPin_restore.gz
Remove false .gz suffiz
(52 Bytes) Downloaded 13 times
User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

Here is a script that automates wizard's method of lifting and shrinking the tray.

WARNING - this is probably not the right way to modify an xml file but hey it seems to be working for me.

WARNING - this permanently modifies the jwmrc-tray file so DONT USE IT if you have a savefile or save folder.
(Having said that it is pretty easy to manually go back to the previous settings as it makes a backup file called /root/.jwmrc-trayBKUP)

Doing my testing on Fossapup 9.5 with no save file or folder. (Fossa 9.6 has slightly different jwmrc-tray file so needs a slightly different script...)

When I click the script the tray instantly jumps up to the desired position and it's width shrinks. (i will probably reduce the amount of shrinkage slightly in my final iteration when I add all the mod scripts together. Will probably also make a second script to easliy automate returning to a backup of the original jwmrc-try file)

Use at own risk. Testing only.

jwmrctraylift.gz
Remove false .gz suffix
(519 Bytes) Downloaded 9 times
User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

Why/How does drive icon manager superceed PuppyPin?

I would expect that when I update and reactivate PuppyPin the drive icons should go where they are specified within PuppyPin.

But it appears that the drive manager is able to decide where the drive icons go - despite where PuppyPin tells them to go.

I seem to be able to change their x value but not their y value.

ie: what prompts drive manager (or udev?) to redraw drive icons? There must be some reason that it gets triggered to overrride PuppyPin.

What am I misunderstanding?
(Testing with Fossapup 9.5)

User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

Note to self - have a closer look at the zoom and panning discussed here:

viewtopic.php?t=937

User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

I've realised that if I use my script to move the drive icons - I subsequently become unable to unmount a drive by clicking the little green "eject" icon in the top right corner of the drive icon.

I assume the drive manager allocates two spaces for each drive - the big icon space and also the tiny "corner icon" space. When I move the main icon via script it appears the little corner icon gets lost.

So I need to research more about how drive manager works before I continue.

User avatar
bigpup
Moderator
Posts: 6297
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 739 times
Been thanked: 1296 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by bigpup »

The settings that you can change by using the Puppy Event Manager ->Rox Icons

The settings for the placement of the icons on the desktop.

These settings are stored in the eventmanager file in /etc

So maybe your scripts need to be making changes to this eventmanager file :idea:

This part of the files settings:

Code: Select all

# ROX-specific stuff
#

#read by pup_event_frontend_d. whether hotplug drive icons on desktop or a single 'drives' icon...
# * this is still needed outside the rox desktop * for frotend_change, drive_all
ICONDESK=true

#read by pup_event_frontend_d. only effecive if ICONDESK=true. show individual partitions as icons...
ICONPARTITIONS=true

#show partitions labels
LABELPARTITIONS=false

# adjust drive icons placement
# gap between icons and edge of screen (>0 if need to leave space for a tray)...
ICON_PLACE_EDGE_GAP=80
# indent from edge before icons start...
ICON_PLACE_START_GAP=32
# spacing between successive icons (64 matches other icons on desktop)...
ICON_PLACE_SPACING=96
# left, right, bottom, or top of screen...
ICON_PLACE_ORIENTATION=bottom

when you do position changes in the Event Manager ->Rox Icons
You do need to select refresh/realign Existing Icons to get the changes used.

So not exactly sure how your script would do that.
Maybe look at the command code in the actual eventmanager program script file.
It should be in /sbin/ and or usr/sbin/

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

Not a solution - but an interesting xrandr function is able to scale the desktop.
(Unfortunately still leaves the video origin (0,0) at top left of the screen but may have some uses...)

Increase the screen size by 20% (zoom-out):
xrandr --output <screen-name> --scale 1.2x1.2
eg

Code: Select all

xrandr --output LVDS-1 --scale 1.2x1.2

Reset xrandr changes:
xrandr --output <screen-name> --scale 1x1
eg

Code: Select all

xrandr --output LVDS-1 --scale 1x1

https://unix.stackexchange.com/question ... plications

ShrunkDesktopViaXrandrScale.png
ShrunkDesktopViaXrandrScale.png (58.03 KiB) Viewed 73 times
User avatar
greengeek
Posts: 1201
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 342 times
Been thanked: 145 times

Re: Any way to fool JWM and/or ROX regarding desktop size?

Post by greengeek »

bigpup wrote: Tue Jan 30, 2024 9:25 am

..The settings for the placement of the icons on the desktop.

These settings are stored in the eventmanager file in /etc

Thanks @bigpup . I have now tried experimenting with this eventmanager file and it is definitely the key to getting the drive icons where I want them - however I can't find a way to get my scripts to make the reposition go "live" - without manually doing a Restartx as @mikewalsh suggested.

But definitely one of the keys to making this desktop shrinking work.

Using awk to set edge gap:

Code: Select all

#!/bin/bash

# Specify the file to modify
file_to_modify="/etc/eventmanager"  # Replace with the actual file path

# Use awk to search for the variable and echo its current value
current_value=$(awk -F'=' '/ICON_PLACE_EDGE_GAP=/{print $2}' "$file_to_modify")
echo "Current value of ICON_PLACE_EDGE_GAP: $current_value"

# Use awk again to modify the file in-place
awk -F'=' -v OFS='=' '/ICON_PLACE_EDGE_GAP=/{print "ICON_PLACE_EDGE_GAP", 180; next} 1' "$file_to_modify" > tmp && mv tmp "$file_to_modify"

gxmessage "Value of ICON_PLACE_EDGE_GAP has been changed to 180"

Using awk to set start gap:

Code: Select all

#!/bin/bash

# Specify the file to modify
file_to_modify="/etc/eventmanager"  # Replace with the actual file path

# Use awk to search for the variable and echo its current value
current_value=$(awk -F'=' '/ICON_PLACE_START_GAP=/{print $2}' "$file_to_modify")
echo "Current value of ICON_PLACE_START_GAP: $current_value"

# Use awk again to modify the file in-place
awk -F'=' -v OFS='=' '/ICON_PLACE_START_GAP=/{print "ICON_PLACE_START_GAP", 132; next} 1' "$file_to_modify" > tmp && mv tmp "$file_to_modify"

gxmessage "Value of ICON_PLACE_START_GAP has been changed to 132"
Drive_icons_repositioned.png
Drive_icons_repositioned.png (66.29 KiB) Viewed 67 times
Post Reply

Return to “Users”