Ich arbeite entweder mit zwei Rechnern nebeneinander die über Synergy verbunden sind oder an einem Rechner mit zwei Monitoren. Bei zwei Monitoren an einem Rechner sieht das Hintergrundbild immer schlecht aus. Deshalb habe ich ein Bash-Script geschrieben dem man beliebig viele Monitorauflösungen von links nach rechts übergibt und einen Ordner in dem die Bilder gesucht werden, dass dann zufällig aus den passenden Bildern ein großes passendes Bild zusammenstellt. Zusätzlich kann man konfigurieren ob nur passende Auflösungen verwendet werden sollen oder die Bilder nur verkleinert oder auch vergrößert werden sollen um auf den Monitor zu passen.

Hier die Beschreibung der Kommandozeilenoptionen:

        -----===== createMultiDesktopWallpaper =====-----

"createMultiDesktopWallpaper --of=OUTFILE sf=SEARCHFOLDER RES1 RES2 [RES3 [...]]"

Concatenates the images in the given order and writes the result to the file specified by --of

Obligatory parameters: --of= The out-file, meaning the file to write the concatenated image to. This file will be overwritten without notice. --sf= The folder to search in for images. RES[1-x] The resolution of the Desktops for which the background should be created from left to right. The RES-parameters must have the form of WIDTHxHEIGHT (e.g. '1280x1024'). There have to be at least two RES-parameters

Optional parameters: --mode= The mode for choosing the images. Possible values: exact - For every resolution an image with exactly the given size is used. No resizing of images. exact2 - Like exact, but needs a preordered search-folder. Use the orderImagesByResolution script to order it. (Faster) down - Uses images that are at least as big as the given size and resizes bigger images. This might lead to images being cropped because they have a differnt ratio. any - Resizes any picture to the given resolution. This might look bad if you have for example a 24" monitor and some 640x480 images in the search-folder Default: exact --background= The color of the background if the pictures do not have the same size. (default: black) --same Use the same image for all resolutions. Only works with mode 'down' or 'any' --align= Vertical alignment of images that are smaller that the biggest image given --verbose Output additional information

Example: "createMultiDesktopWallpaper --of=bg.png --sf=Pictures 1920x1200 1280x1024"

Um das Script zu benutzen benötigt man ImageMagick und die Scripte createMultiDesktopWallpaper und concatenateImage. Wenn man die Geschwindigkeit optimieren will, kann man das orderImagesByResolution Script benutzen um die Bilder vorher zu ordnen und dann den Modus "exact2" nutzen.

Das Ergebnis sieht dann bei 1920x1200 und 1280x1024 z.B. so aus: (Aus zwei Photos die ich gemacht habe)

[caption id="attachment_172" align="aligncenter" width="300" caption="Generiertes Wallpaper"]Generated Wallpaper[/caption]

Eine andere Sprache als bash wäre bezüglich Caching sicher sinnvoll gewesen, aber nicht bei meiner kleinen Auswahl an Wallpapern lohnt sich ein Caching Mechanismus noch nicht. Natürlich lässt sich ein Dateibasiertes Caching auch mit bash realisieren, aber besonders elegant geht das nunmal auch nicht.