Last active
August 29, 2015 13:56
-
-
Save hoodie/9209935 to your computer and use it in GitHub Desktop.
split wallpapers for 12 screen display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FORMAT=png | |
RESIZE_NAME="FULL" | |
RESIZE_OUTPUT=$RESIZE_NAME.$FORMAT | |
CUTOUTPUT="CUT" | |
SCREEN_WIDTH=$(( 1920)) | |
SCREEN_HEIGHT=$((1081)) | |
WIDTH=$(( $SCREEN_WIDTH *4)) | |
HEIGHT=$(( $SCREEN_HEIGHT *3)) | |
# screen0 monitor 0 -> 02 n[1 ] =2 | |
# screen0 monitor 1 -> 06 n[2 ] =6 | |
# screen0 monitor 2 -> 10 n[3 ] =10 | |
# screen0 monitor 3 -> 03 n[4 ] =3 | |
# screen0 monitor 4 -> 07 n[5 ] =7 | |
# screen0 monitor 5 -> 11 n[6 ] =11 | |
# screen1 monitor 0 -> 00 n[7 ] =0 | |
# screen1 monitor 1 -> 04 n[8 ] =4 | |
# screen1 monitor 2 -> 08 n[9 ] =8 | |
# screen1 monitor 3 -> 01 n[10] =1 | |
# screen1 monitor 4 -> 05 n[11] =5 | |
# screen1 monitor 5 -> 09 n[12] =9 | |
mapping[0 ]="02" | |
mapping[1 ]="06" | |
mapping[2 ]="10" | |
mapping[3 ]="03" | |
mapping[4 ]="07" | |
mapping[5 ]="11" | |
mapping[6 ]="00" | |
mapping[7 ]="04" | |
mapping[8 ]="08" | |
mapping[9]="01" | |
mapping[10]="05" | |
mapping[11]="09" | |
for FILE in $* | |
do | |
echo $FILE | |
NAME=$(basename $FILE .jpg) | |
echo $SCREEN_WIDTH $SCREEN_HEIGHT | |
echo $WIDTH $HEIGHT | |
OUTPUT_PATH="./"$NAME"/" | |
#OUTPUT_PATH=./ | |
if [ -d $OUTPUT_PATH ] | |
then | |
echo files already exist | |
else | |
mkdir $OUTPUT_PATH | |
export MAGICK_THREAD_LIMIT=12 | |
convert $FILE \ | |
-resize $WIDTH"x"$HEIGHT^ \ | |
-gravity center \ | |
-crop $WIDTH"x"$HEIGHT+0+0 +repage \ | |
-crop $SCREEN_WIDTH"x"$SCREEN_HEIGHT +repage \ | |
$OUTPUT_PATH/$CUTOUTPUT"%02d."$FORMAT | |
fi | |
for n in {00..11} | |
do | |
n=${n#0} | |
IMAGE=$(readlink -f $OUTPUT_PATH"CUT"${mapping[$n]}.$FORMAT) | |
if [ $n -lt 6 ] | |
then | |
#xfconf-query -c xfce4-desktop -p /backdrop/screen1/monitor$(($n))/image-show -s true | |
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor$(($n))/image-path -s $IMAGE | |
else | |
#xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor$(($n-6))/image-show -s true | |
xfconf-query -c xfce4-desktop -p /backdrop/screen1/monitor$(($n-6))/image-path -s $IMAGE | |
fi | |
done | |
done | |
xfdesktop --reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this was tested on the wall