OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Change Wallpaper If Rotate Screen
zs_ftp
post Jan 7 2007, 11:12 PM
Post #1





Group: Members
Posts: 14
Joined: 10-July 06
From: Russia, Novosibirsk
Member No.: 10,367



How to make change of wallpapers, at turn of the screen?
example: in landscape mode - wall_l.jpg, in portrait mode - wall_p.jpg.

I Use IceWM and pdaXrom r121.
Go to the top of the page
 
+Quote Post
daniel3000
post Jan 8 2007, 05:21 AM
Post #2





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



I don't think there is a way, besides patching and recompiling the matchbox or openbox desktop.

However, there may be a workaround which I'll try in the next days:
I observed that if the screen is rotated, the right side of a 640x480 wallpaper is cropped and the lower part shows the repitition of the upper part (tiled wallpaper).

So it may be possible to create a 640x640 wallpaper image where simply the right OR bottom part is cropped, depending on the screen orientation.
This at least avoids the ugly tiling.

And if you create a graphically sophisticated image, this method may be good to generate "two" very well looking wallpapers.

Will report when I have tested this.

daniel
Go to the top of the page
 
+Quote Post
newkirk
post Jan 8 2007, 08:02 AM
Post #3





Group: Members
Posts: 74
Joined: 28-May 03
From: Pennsauken NJ
Member No.: 60



I've dug into this before, to the point of studying the matchbox source. /etc/sysconfig/clamshell is home to scripts that are called when clamshell state changes - closed, portrait, landscape. So, for example, you could put a script in /etc/sysconfig/clamshell/portrait.d/ and it would be executed when the screen is spun to portrait orientation. It's more efficient however to put the script in scripts.d and symlink to portrait.d and landscape.d, since the script receives 'landscape', 'portrait', or 'closed' as first parameter.

The problem I ran into is that, as Daniel mentioned, matchbox-desktop doesn't reload the config file unless it's restarted, which is not what we want. If there's some way to tell it to reload config files and repaint ('kill -HUP `pidof -x matchbox-desktop`' should work but doesn't) then the scripts would just need to change to the appropriate wallpaper (either modify config file or swap 2 config files), then trigger the reload.

Now, with all that said, I DID find a way to do it. As it turns out, matchbox-desktop doesn't reload its config, but it DOES reload the wallpaper image itself. SO I was successful insofar as I can configure it to use something like /mnt/card/wallpaper/paper.png, which is a symlink to the actual wallpaper to be used, then if that symlink points to a DIFFERENT image when the screen is swapped between portrait and landscape, it will load the new wallpaper.

caveats:
1 - Loading the images takes a noticeable amount of time, so the smaller the image the smoother the transition.
2 - Images MUST be the same format - IE, both png or both jpg.
3 - you cannot change centered vs tiled vs stretched - that involves reloading the config.
4 - you can only select wallpapers by editing the swapper script, NOT via Look'n'Feel tool.

So here's my patch-up solution: Create the file /etc/sysconfig/clamshell/scripts.d/swappaper, make it executable, and put this in it, modified to reflect your chosen wallpapers and appropriate paths:

CODE
#!/bin/bash

case "$1" in
portrait)
   ln -fs /mnt/card/wallpaper/DeanRock.jpg /mnt/card/wallpaper/paper.jpg
;;
landscape)
   ln -fs /mnt/card/wallpaper/CloudColumn.jpg /mnt/card/wallpaper/paper.jpg
;;
esac


Then symlink it:
CODE
ln -s /etc/sysconfig/clamshell/scripts.d/swappaper /etc/sysconfig/clamshell/portrait.d/0swapper
ln -s /etc/sysconfig/clamshell/scripts.d/swappaper /etc/sysconfig/clamshell/portrait.d/0swapper

Note that the preceding zero is vital - 0swapper will come first in order, ensuring that it changes the picture BEFORE it actually reloads it...

Final prep, you'll need to execute the landscape 'ln' command from the script manually, then select the paper.jpg or whatever in lookandfeel. (until the symlink has been created you can't select it as wallpaper)

j
Go to the top of the page
 
+Quote Post
daniel3000
post Jan 9 2007, 12:22 AM
Post #4





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



This is a great workaround, thank you!
Go to the top of the page
 
+Quote Post
zs_ftp
post Jan 9 2007, 06:34 AM
Post #5





Group: Members
Posts: 14
Joined: 10-July 06
From: Russia, Novosibirsk
Member No.: 10,367



my solve:

1. installed feh
2. create 2 wallpaper (640x480 and 480x640)
3. edit /etc/sysconfig/clamshell/scripts/x11src

after "if pidor xvkdb..." add
/usr/local/bin/feh --bg-scale ~/wp/lng.jpg
and for portrait mode
/usr/local/bin/feh --bg-scale ~/wp/prt.jpg

wink.gif
Go to the top of the page
 
+Quote Post
kkazakov13
post Jan 12 2007, 10:11 AM
Post #6





Group: Members
Posts: 409
Joined: 3-December 06
Member No.: 13,063



QUOTE(zs_ftp @ Jan 9 2007, 05:34 PM)
my solve:

1. installed feh
2. create 2 wallpaper (640x480 and 480x640)
3. edit /etc/sysconfig/clamshell/scripts/x11src

after "if pidor xvkdb..." add
/usr/local/bin/feh --bg-scale ~/wp/lng.jpg
and for portrait mode
/usr/local/bin/feh --bg-scale ~/wp/prt.jpg

wink.gif
*



I tried it, but for example

/usr/local/bin/feh --bg-scale /storage/images/wallpapers/linux1.png

doesnt' change the wallpaper, it just simply gives no output, but wallpaper isn't changed.
Go to the top of the page
 
+Quote Post
daniel3000
post Jan 15 2007, 07:03 AM
Post #7





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



QUOTE(kkazakov13 @ Jan 12 2007, 08:11 PM)
I tried it, but for example

/usr/local/bin/feh --bg-scale /storage/images/wallpapers/linux1.png

doesnt' change the wallpaper, it just simply gives no output, but wallpaper isn't changed.
*


Maybe it depends on the desktop you are running.
The feh feature may work in Matchbox-desktop, but not in Rox, for example, because Rox has its own background "drop" feature.
Just a guess.

daniel
Go to the top of the page
 
+Quote Post
Ling
post Jan 15 2007, 07:05 AM
Post #8





Group: Members
Posts: 352
Joined: 3-June 04
From: Virginia, US
Member No.: 3,563



Is it not possible to compile plasterer for pdaXrom?
Go to the top of the page
 
+Quote Post
kkazakov13
post Jan 15 2007, 07:05 AM
Post #9





Group: Members
Posts: 409
Joined: 3-December 06
Member No.: 13,063



QUOTE(daniel3000 @ Jan 15 2007, 06:03 PM)
QUOTE(kkazakov13 @ Jan 12 2007, 08:11 PM)
I tried it, but for example

/usr/local/bin/feh --bg-scale /storage/images/wallpapers/linux1.png

doesnt' change the wallpaper, it just simply gives no output, but wallpaper isn't changed.
*


Maybe it depends on the desktop you are running.
The feh feature may work in Matchbox-desktop, but not in Rox, for example, because Rox has its own background "drop" feature.
Just a guess.

daniel
*



Yes, it was ROX. I don't use matchbox-desktop at all, don't like it. Would be good if can change background somehow via script with Rox
Go to the top of the page
 
+Quote Post
daniel3000
post Jan 15 2007, 07:07 AM
Post #10





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



QUOTE(daniel3000 @ Jan 8 2007, 03:21 PM)
However, there may be a workaround which I'll try in the next days:
I observed that if the screen is rotated, the right side of a 640x480 wallpaper is cropped and the lower part shows the repitition of the upper part (tiled wallpaper).

So it may be possible to create a 640x640 wallpaper image where simply the right OR bottom part is cropped, depending on the screen orientation.
This at least avoids the ugly tiling.
*


I can now report that this method works nicely.

Simply use an image of size 640x640 as "tiled" wallpaper.
Just take care that it contains good looking areas of 640x480 and 480x640 from the upper left corner.

Since the background image is rotated together with the screen and desktop, the wallpaper contents will always be oriented correctly with the desktop.

daniel
Go to the top of the page
 
+Quote Post
Meanie
post Jan 16 2007, 09:40 PM
Post #11





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



In theory, this could be achieved easily with the wallpaper package. You will also need to install python-shell and python-pickle
Go to the top of the page
 
+Quote Post
Meanie
post Jan 16 2007, 11:47 PM
Post #12





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



ok, rox takes a soap message which tells it where the info for the backdrop (wallpaper) comes from.

i have created a little package which can control the background image displayed by rox from the command line so it can be called from the rotate script. look for rox-backdrop in the new packages announcement

This post has been edited by Meanie: Jan 17 2007, 06:03 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd July 2014 - 08:09 AM