#!/bin/sh # # Moves pixmaps in the current directory to ~/graphics/pixmaps/ where 'fmt' is the dimensions # of the pixmap. list=$(ls *.xpm) for f in $list; do idstring=$(xli -identify "$f") case $idstring in *unknown*) continue ;; esac fmt=$(echo "$idstring" | sed -E -e 's/^.*is a //g' -e 's/ X Pixmap.*$//g') if [ ! -d ~/graphics/pixmaps/$fmt ]; then mkdir -p ~/graphics/pixmaps/$fmt fi df=$(basename $f) if [ -f ~/graphics/pixmaps/$fmt/"$df" ]; then echo -n "File $df exists! Enter a new name, or blank to skip: " read df fi if [ "x$df" != "x" ]; then mv $f ~/graphics/pixmaps/$fmt/"$df" fi done .