A collection of utility scripts for Linux (including Ubuntu).
The following scripts are available:
Generates an XML wallpaper slideshow file for GNOME/Ubuntu.
Advanced picture uploader for Google+ (a.k.a. Google Picasa Web), capable of watermarking images.
A simple script for GNOME/Ubuntu that sets a random image as current wallpaper.
Updates EXIF date in JPEG images according to the file name.
Creates an XML wallpaper description file for GNOME or Ubuntu.
There is another script of similar functionality in this collection, rotate-wallpaper, which sets a random image file as desktop wallpaper. It has only one downside: you have to run it every time you want to rotate your wallpaper.
However GNOME since 2.28 allows assigning a slide show as wallpaper by providing an image list in XML format. There you can specify the order and duration for each image. Moreover, you can even define a transition from one image to another.
So I decided to create a simple script that generates an XML file for a given set of images and, optionally, sets that as the current wallpaper. It requires GNOME 3+ or Ubuntu (11.10 or later).
generate-wallpaper-xml [options] pictures_dir xml_file
optionsAny combination of the following:
-d <number>Override default display duration (1795 seconds, ca. half an hour)
-s <mode>Sort the files according to
mode, whose values are:
nameSort by file path and name
shuffleRandomize file order
-t <number>Override default transition duration (5 seconds). If 0, no transition is used
-wSet the generated XML file as current wallpaper
pictures_dirPath to directory with pictures
xml_filePath to the output XML file
Create the file
wallpapers.xml in the
Pictures subdirectory (in the user's home directory) from picture files from the same subdirectory:
generate-wallpaper-xml ~/Pictures ~/Pictures/wallpapers.xml
The same as above, but additionally set the generated file as the current wallpaper:
generate-wallpaper-xml -w ~/Pictures ~/Pictures/wallpapers.xml
The same as previous, plus set display duration of each file to 10 minutes (
600 seconds), and disable transitions between images:
generate-wallpaper-xml -w -d 600 -t 0 ~/Pictures ~/Pictures/wallpapers.xml
The same as previous, plus shuffle the file list so that they are ordered randomly:
generate-wallpaper-xml -w -s shuffle -d 600 -t 0 ~/Pictures ~/Pictures/wallpapers.xml
Can be used to prepare images for publishing on the web (or anywhere else). It supports image watermarking and direct upload into Google+ (a.k.a. Google Photos, a.k.a. Google Picasa Web). If the image contains description in its metadata, it is propagated also to the uploaded picture.
By default every picture file is processed as follows:
Any of the above can be switched off by using options (see below).
picasa-upload [options] pictures_dir [album_name]
optionsAny combination of the following:
-BDo not add a black border to the image
-DDo not delete the photos after uploading (leave them in the source directory). If this option is used, processed picture files, having
.picasawebin their names, will be created in the same directory where the source ones reside. Otherwise a temporary directory will be used.
-RDo not resize photos to the default size
-UDo not upload the photos to Google+/Picasa (implies
-WDo not watermark images
-bUse black watermark instead of the default white one
-dDelete original (after successful processing)
-sUse "small" watermark instead of the default one (better for smaller images)
pictures_dirPath to directory with pictures to process
album_nameName of the destination Google+/Picasa album. Mandatory unless
Before first usage you have to review and update some variables defined at the top of the script:
pic_size=1600 # Max size of the pictures to upload file_watermark_white="$HOME/Pictures/Misc/dk-watermark-white.png" # Default watermark file file_watermark_black="$HOME/Pictures/Misc/dk-watermark-black.png" # Black watermark file file_watermark_small="$HOME/Pictures/Misc/dk-watermark-small.png" # 'Small' watermark file picasa_owner="dmitry.kann" # Owner of the Google+/Picasa account
You will also be offered to login to Google at first run.
Upload all the images from the
Pictures/blog subdirectory (in the user's home directory) into the
My blog Google+/Picasa album. Images are automatically watermarked, resized and framed:
picasa-upload ~/Pictures/blog "My blog"
Watermark, resize and frame all the images from the
Pictures subdirectory (in the user's home directory), but don't upload them anywhere. Watermarked image files have the string
.picasaweb inserted before the extension and reside in the same directory as the source image:
picasa-upload -U ~/Pictures
The same as previous, but the images are only resized:
picasa-upload -UWB ~/Pictures
Picks up a random image file (
.png) from the predefined directory and sets it as wallpaper. The script uses the
dconf configuration backend and therefore requires GNOME 3 or Ubuntu (11.10 Oneiric Ocelot or later).
Before you can use the script you have to edit it to modify the value of
dir_wallpapers to point to the directory with image files.
Sometimes you know when a photo has been made, but the image file does not contain the date in its metadata. For instance, if you've scanned a printed photo.
This script updates the EXIF date of a JPEG image according to the file name, for all files in the specified directory. The file name must be in the following format:
pictures_dirPath to the directory with JPEG files
sudo apt-get install jhead
Picturessubdirectory (in the user's home directory):
Om de meest recente broncode te downloaden, clone mijn GitHub repository:
git clone https://github.com/yktoo/yktools.git
This software is distributed on the terms of GNU General Public License Version 3 or (optionally) any later version.
Software and any related documentation are provided on an as is basis, without warranty of any kind. The entire risk arising out of use or performance of the software remains with you.
The source code is available in my GitHub repository.