Skip to main content

Thread: HOWTO: Random Wallpapers on Different Monitors with Different Resolutions


to setup

assumptions: works in gnome. have 1 or 2 monitors. don't have more isn't tested more. think may work...not sure on point.

script setup

1) download attachment wallpaper.sh (it perl file .pl blocked works fine either extension.)

2) sudo apt-get install perlmagick (this installs perlmagick splicing of images , outputing them.)

3) open terminal

4) mkdir ~/.wallpaper (or wherever want put wallpaper images.)

5) place wallpapers in ~/.wallpaper (or wherever made folder). wallpapers must exact resolution of monitor or won't picked.

6) open gedit (applications -> accessories -> text editor or open terminal -> gedit)

7) open wallpaper.sh gedit

config pretty self explanatory let example config.

let say, sake of argument, monitors 1920x1200 , 1440x900. right next each other, horizontally. (bigger monitor on right, smaller on left.) need modify numbers used according setup.

8) find @outputscreen line. add widths , use largest height. if doing vertical, opposite.

code:
my @outputscreen = ('3360','1200');
9) find @screens line. first monitor 1 furthest on right. here put in monitor resolutions. correct our example config.

code:
my @screens = (   ['1920', '1200'],    ['1440', '900'],  );
10) find $orientation line. since our monitors horizontally aligned, correct. if had 1 on top of other, we'd need change vertical.

code:
my $orientation = "horizontal";
11) find @wallpaper_dirs line. change looks this. replace [username] username if used default wallpaper directory location.

code:
my @wallpaper_dirs = (   '/home/[username]/.wallpaper/', );
12) find $output_file line. change looks this. replace [username] username if used default wallpaper directory location. if want desktop image somewhere else, adjust accordingly.

code:
my $output_file = "/home/[username]/.wallpaper/output.jpg";
13) open terminal

14) /path/to/wallpaper/wallpaper.sh

15) if wallpaper shows in wrong place, or else goes wrong, fix config accordingly.

cron job
(if want run every x length of time, if lazy , want stitch wallpaper instead of gimp, run normally.)

1) open terminal

2) crontab -e

3) choose prefered editor (i'd go nano if don't know means.)

4) insert following line @ end of file. suggested length 30 minutes. in other words, every 30 minutes wallpapers try switch. may not if have small # of wallpapers given resolution. if want faster / longer modify number 30. (e.g. 1 every minute. 59 every 59 minutes.) remove >/dev/null 2>&1 if want receive 'mail' (via mail command) cron job.

code:
*/30 * * * * /path/to/wallpaper.sh >/dev/null 2>&1

to revert changes
1) delete relevant file (wallpaper.sh) placed.

2) crontab -e

3) delete crontab line added.
attached files attached files

approved, , thank contributing tutorials & tips!


Forum The Ubuntu Forum Community Other Discussion and Support Tutorials Outdated Tutorials & Tips HOWTO: Random Wallpapers on Different Monitors with Different Resolutions


Ubuntu

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums