1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/bin/bash
#
# Simple wrapper for the SVGA Photo-CD Viewer pcdview.
# Greps cdrom-location from user .xpcdrc && let the user choose graphics mode.
# Then it shows all images of the Photo CD in "one run".
#
# Supplied for the Debian version of xpcd by Stephan Alexander Suerken <absurd@debian.org>
#
xpcdrc_file=${HOME}/.xpcdrc
graphic_mode_default=21
#
# Panic default...
#
set -e
#
# Smartly find out a default cdrom loacation
#
if test -e ${xpcdrc_file} ;
then photo_cd_location_default=`grep cdrom ${xpcdrc_file} | cut -d= -f2 | tr --delete [:space:]`;
echo "Using Photo CD location default from ${xpcdrc_file}.";
else echo "Could not find file '${xpcdrc_file}'.";
echo "Thusly, I cannot determine your default Photo CD location.";
echo "(You may change this by using xpcd once.)";
echo "Using stubborn Photo CD location default.";
photo_cd_location_default="/cdrom" ;
fi
#
# Read cdrom location
#
echo -n "Select the location of the Photo CD [${photo_cd_location_default}]: ";
read photo_cd_location
if test "${photo_cd_location}" == "";
then photo_cd_location=${photo_cd_location_default};
echo "Using default location ${photo_cd_location_default}..."
fi
#
# Read graphics mode
#
echo
echo "Available graphic modes"
echo "-----------------------"
pcdview -l
echo "-----------------------"
echo -n "Choose a graphic mode [${graphic_mode_default}]: "
read graphic_mode
if test "${graphic_mode}" == "";
then graphic_mode=${graphic_mode_default};
echo "Using default mode ${graphic_mode_default}..."
fi
#
# Run pcdview
#
pcdview -m${graphic_mode} $* ${photo_cd_location}/photo_cd/images/*
|