- Allow INVERT for colour inversion of displayed images (for bright BG)
- Fix PREFIXes ("+" was not recognized)
- Fix "EXIT" to exit program in dialog mode (was only going back)
- Fix "BACK" to go back to the previous menu in dialog mode (was doing nothing)
# 1 : means colour 1
# 2 : means colour 2
# [...]
# 1 : means colour 1
# 2 : means colour 2
# [...]
+# INVERT : invert the output for image viewing (for white backgrounds)
+# 0 : do not invert (default)
+# 1 : invert
SERVER="$1"
SELECTOR="$2"
SERVER="$1"
SELECTOR="$2"
+# Invert image viewer
+if [ "$INVERT" = 1 ]; then
+ INVERT="--invert"
+else
+ INVERT=
+fi
+
+PREFIX="[0-9hIg+]"
# $0 [FILE] (dialog)
# Display a gopher menu for the given resource
# $0 [FILE] (dialog)
# Display a gopher menu for the given resource
--menu "$title" \
"$LINES" "$COLUMNS" "$LINES" \
--file "$tmp.menu" 2>"$tmp.choice"
--menu "$title" \
"$LINES" "$COLUMNS" "$LINES" \
--file "$tmp.menu" 2>"$tmp.choice"
if [ $val = 3 ]; then
CHOICE=""
elif [ $val = 1 ]; then
if [ $val = 3 ]; then
CHOICE=""
elif [ $val = 1 ]; then
g|I)
if img2aa --help >/dev/null 2>&1; then
img2aa --mode=DITHERING \
g|I)
if img2aa --help >/dev/null 2>&1; then
img2aa --mode=DITHERING \
--width=74 "$tmp" | less
elif jp2a -h >/dev/null 2>&1; then
if convert -h >/dev/null 2>&1; then
convert "$tmp" "$tmp.jpg"
jp2a --border --chars=" .-+=o8#"\
--width=74 "$tmp" | less
elif jp2a -h >/dev/null 2>&1; then
if convert -h >/dev/null 2>&1; then
convert "$tmp" "$tmp.jpg"
jp2a --border --chars=" .-+=o8#"\
--width=74 "$tmp.jpg" | less
else
echo "required program not found to view images: convert" \
--width=74 "$tmp.jpg" | less
else
echo "required program not found to view images: convert" \