I have written my first bash script and it uses imagemagick to crop/scale/and composite png's for a Gtk theme I am working on. The script calls for the user to input their monitor screen Width with multiple screen Height dimensions for imagemagick to work its magick on the image files. What I would like is to have the script only ask once for the monitor Width and automagickly use the same dimension for each individual cut/crop etc. I hope I am making sence. Here is a sample of the original code. It works but, the script uses 6 different Heights and only 1 Width.
Code: Select all
echo "Enter your screen WIDTH followed by the HEIGHT of x34:"
read -e MTY
convert -size $MTY metacity-1/metacity_light_layer.png -scale $MTY! +profile '*' metacity-1/light_layer.png
convert -size $MTY metacity-1/metacity_light_layer_inactive.png -scale $MTY! +profile '*' metacity-1/light_layer_inactive.png
convert -size $MTY+0+0 gtk-3.0/assets/WindowFillD.png -crop $MTY+0+0! +profile '*' metacity-1/unfocused.png
cp metacity-1/unfocused.png metacity-1/focused.png
cp metacity-1/unfocused.png xfwm4/focused.png
composite metacity-1/light_layer.png metacity-1/focused.png metacity-1/light_focused.png
composite metacity-1/light_layer_inactive.png metacity-1/unfocused.png metacity-1/unfocused.png
Code: Select all
echo "Enter your screen WIDTH:"
read -e WDTH
MTY=$WDTH"x34"
MTYB=$WDTH"x34+0+0"
convert -size $MTY metacity-1/metacity_light_layer.png -scale $MTY! +profile '*' metacity-1/light_layer.png
convert -size $MTY metacity-1/metacity_light_layer_inactive.png -scale $MTY! +profile '*' metacity-1/light_layer_inactive.png
convert -size $MTYB gtk-3.0/assets/WindowFillD.png -crop $MTYB! +profile '*' metacity-1/unfocused.png
Help