awsetbg: Add montage(1) support

* Using -m X (X standing for screen number) the give background image is
  converted to a big image in the <cache directory>/montage.png.
  Limitations:
    + -m should be the last argument before the image name
    + for better results screens should have the same sizes and the background
      image should fit one screen size.

Signed-off-by: Sébastien Gross <seb-awesome@chezwam.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Sébastien Gross 2008-11-19 12:20:59 +00:00 committed by Julien Danjou
parent 4c031ba398
commit edd0ae73e2
1 changed files with 22 additions and 2 deletions

View File

@ -66,8 +66,8 @@ command="`basename \"$0\"`"
# Functions
display_usage() {
cat << EOF
Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA] /path/to/wallpaper
$command [-u/-U [wallpapersetter]] [-fFcCtTaA] -r/-R /path/to/wallpaperdirectory
Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA] [-m #] /path/to/wallpaper
$command [-u/-U [wallpapersetter]] [-fFcCtTaA] [-m #] -r/-R /path/to/wallpaperdirectory
$command [-lhip]
Use \`\`$command -h'' for a complete help message.
@ -97,6 +97,9 @@ Options:
-i Information about selected wallpaper command.
-m # Use montage to create a big image (image should
fit screen size). Requires montage(1).
# is the number of screen (columns in montage)
Files:
\$XDG_CACHE_HOME/awesome/lastwallpaper In this file the wallpaper you set
@ -210,6 +213,23 @@ while [ $# -gt 0 ]; do
-T) option='$tile'
remember=false
shift ;;
-m)
montage=`which montage`
if test ! -z "$montage"; then
shift
cols="$1"; shift
fns=""
for i in `seq $cols`; do
fns="$fns $1";
done;
shift
$montage $fns -geometry +0+0 -tile ${cols}x $CONFIG_DIR/montage.png
wallpaper=$CONFIG_DIR/montage.png
else
shift
echo "montage not found. Falling back to single image"
fi
;;
-r) option2=$option
option=random
wallpaper=$2 # in this case it's a dir