Refresh wallpaper on boot, How? (SOLVED)

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
gychang
Posts: 591
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 206 times
Been thanked: 64 times

Refresh wallpaper on boot, How? (SOLVED)

Post by gychang »

I have attached an external monitor with startup script that turns off the LVDS (laptop screen) and turns on VGA-0 (external monitor connected with VGA). ( xrandr --output VGA-0 --mode 1920x1200 --rate 60.0 --output LVDS --off & ). On my fossapup64, the only problem is with each boot wall paper doesn't look right (stretched and shifted to the right), and always have to correct it with right clicking on desktop screen to get "Backdrop..." and click on "Stretch" then "Fit" then the wallpaper looks proper.

Is there a command that will "refresh" the wallpaper so that it will look proper?

Attachments
backdrop.png
backdrop.png (37.98 KiB) Viewed 879 times
Last edited by gychang on Sat Jul 23, 2022 9:02 pm, edited 1 time in total.

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

HerrBert
Posts: 357
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 126 times

Re: Refresh wallpaper on boot, How?

Post by HerrBert »

I think it's a timing problem...
When starting your script rox desktop is probably already running.

You can try to run roxfiler -p /root/Choices/ROX-Filer/PuppyPin from a terminal to restart the desktop.

If this works, add it to your script so desktop will be restarted after switching monitors.

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Refresh wallpaper on boot, How?

Post by williams2 »

This probably does not need the & at the end of the line.
If there is a timing problem, the ampersand could be contributing to the timing problem, if not causing it.

This might work better:

Code: Select all

xrandr --output VGA-0 --mode 1920x1200 --rate 60.0 --output LVDS --off
sleep 1
fixPuppyPin
cd
rox -p /root/Choices/ROX-Filer/PuppyPin

You might not need the sleep instruction.

User avatar
gychang
Posts: 591
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 206 times
Been thanked: 64 times

Re: Refresh wallpaper on boot, How?

Post by gychang »

HerrBert wrote: Sat Jul 23, 2022 3:45 pm

I think it's a timing problem...
When starting your script rox desktop is probably already running.

You can try to run roxfiler -p /root/Choices/ROX-Filer/PuppyPin from a terminal to restart the desktop.

If this works, add it to your script so desktop will be restarted after switching monitors.

it does work!, thanks, added to the end of the start script. :thumbup:

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
gychang
Posts: 591
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 206 times
Been thanked: 64 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by gychang »

williams2 wrote: Sat Jul 23, 2022 5:46 pm

This probably does not need the & at the end of the line.
If there is a timing problem, the ampersand could be contributing to the timing problem, if not causing it.

This might work better:

Code: Select all

xrandr --output VGA-0 --mode 1920x1200 --rate 60.0 --output LVDS --off
sleep 1
fixPuppyPin
cd
rox -p /root/Choices/ROX-Filer/PuppyPin

You might not need the sleep instruction.

Your code also works!, what does the cd do in your code?, why is & not needed?, with & inserted also works. as u suggest also works without sleep 1. :thumbup2:

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

HerrBert
Posts: 357
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 126 times

Re: Refresh wallpaper on boot, How?

Post by HerrBert »

williams2 wrote: Sat Jul 23, 2022 5:46 pm

This probably does not need the & at the end of the line.
If there is a timing problem, the ampersand could be contributing to the timing problem, if not causing it.

This might work better:

Code: Select all

xrandr --output VGA-0 --mode 1920x1200 --rate 60.0 --output LVDS --off
sleep 1
fixPuppyPin
cd
rox -p /root/Choices/ROX-Filer/PuppyPin

You might not need the sleep instruction.

TBH i did not recognize the ampersand at the end of the code line :oops:
So i guess your code is the better choice. :thumbup2:

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by williams2 »

If rox is not running at all
(typically there is one instance of rox running, each rox window is created by the instance of rox that is running)

If rox is not running and you start rox by making the pinboard appear, creating the desktop.
If you do this, the directory you are in (your working dir)
will be you home dir for rox. Clicking the House icon at the top will show you the files in the dir that rox thinks is your home dir.

cd is like this cd /root if you are running as user root.
cd is like this cd /home/spot if you are running as user spot.

cd and cd $HOME and cd ~/ all do about the same thing.

for example, you could do this:

Code: Select all

cd /mnt/home/
rox -p /root/Choices/ROX-Filer/PuppyPin

and rox would treat /mnt/home/ as it's home.

probably, you would want rox's home to be /root/
the cd makes sure rox's home is /root/

(you might need to killall ROX-Filer first)

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by williams2 »

why is & not needed?, with & inserted also works

The ampersand at the end of the line tells xrandr to go away and work in the background.

Without the ampersand, xrandr will stay running in your script, and after it finishes running, then the next instruction will execute.

Without the ampersand, xrandr may not finish executing before you tell rox to show the PuppyPin desktop.
xranrdr should run, then rox should set the pinboard.
With the ampersand, there is no guarantee that those 2 lines will execute in the right order.

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by williams2 »

The fixPuppyPin instruction sets where the icons are at the right edge of the screen.
If you change the resolution, those icons might be in the middle of the screen, for example.

User avatar
gychang
Posts: 591
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 206 times
Been thanked: 64 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by gychang »

williams2 wrote: Sat Jul 23, 2022 9:47 pm

If rox is not running at all
(typically there is one instance of rox running, each rox window is created by the instance of rox that is running)

If rox is not running and you start rox by making the pinboard appear, creating the desktop.
If you do this, the directory you are in (your working dir)
will be you home dir for rox. Clicking the House icon at the top will show you the files in the dir that rox thinks is your home dir.

cd is like this cd /root if you are running as user root.
cd is like this cd /home/spot if you are running as user spot.

cd and cd $HOME and cd ~/ all do about the same thing.

for example, you could do this:

Code: Select all

cd /mnt/home/
rox -p /root/Choices/ROX-Filer/PuppyPin

and rox would treat /mnt/home/ as it's home.

probably, you would want rox's home to be /root/
the cd makes sure rox's home is /root/

(you might need to killall ROX-Filer first)

thanks for the explanation. I remember sometimes kilall ROX-Filer causes problem with wallpaper behavior in past.

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
gychang
Posts: 591
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 206 times
Been thanked: 64 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by gychang »

williams2 wrote: Sat Jul 23, 2022 10:01 pm

why is & not needed?, with & inserted also works

Without the ampersand, xrandr will stay running in your script, and after it finishes running, then the next instruction will execute.

sounds similar to && ...

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by williams2 »

sounds similar to && ...

No.

foo & means go away and execute foo in the background and never come back, so execute the next instruction in the script immediately.

foo && echo "it is true"

means, execute foo then if foo worked without errors, print on the screen it is true
foo does not execute in the background.

foo || bar means execute foo, then, after foo finishes running, execute bar
but only if foo ran with errors and did not work.
Neither foo nor bar execute in the background.

Type help test

User avatar
MochiMoppel
Posts: 1232
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 21 times
Been thanked: 437 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by MochiMoppel »

williams2 wrote: Sat Jul 23, 2022 9:47 pm

If rox is not running and you start rox by making the pinboard appear, creating the desktop.
If you do this, the directory you are in (your working dir)
will be you home dir for rox.

Not in my version.

Clicking the House icon at the top will show you the files in the dir that rox thinks is your home dir.

If your ROX-Filer does this then I would consider it to be a bug. Mine doesn't. If you mean the House icon in the toolbar of a ROX-Filer window then this icon is supposed to open $HOME (usually /root). If you mean the icon on the desktop (mine looks like a Folder), which invokes /usr/local/bin/rox , then this icon will indeed open the working directory which was current when ROX-Filer was started, but I wouldn't call it the home directory.

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Refresh wallpaper on boot, How? (SOLVED)

Post by williams2 »

Not in my version.

Not in mine, either. (BionicPup64)

I'm not sure when this bug was fixed.
XenialPup used ctrl+X to delete files,
BionicPup uses the <delete> key to delete files.

I haven't tested older versions of Puppy to find when the bug was fixed.

It worked like this: If you restart the pinboard when there is no instance of rox running (eg if rox crashed)
then rox would think that "home" was the CWD.

For example, if you did this:

Code: Select all

killall ROX-Filer
cd /sbin
rox -p /root/Choices/ROX-Filer/PuppyPin

it would make rox's home = /sbin
so clicking the rox home button would show the /sbin dir.
and clicking the "file" icon on the pinboard would open a rox window showing /sbin
and typing rox in a terminal would open a rox window showing /sbin.

This rox seems to use the HOME env variable as the home that rox uses.
Which is good, it fixes the bug.
I didn't notice that the bug was fixed because I always cd first, before restarting rox.

So the answer to the question would be,
I cd so that some versions of rox that use the CWD (current working dir) as it's home will be set to HOME.

Post Reply

Return to “Users”