Gargoyle, the interactive fiction interpreter, doesn’t support showing the little introduction screen that glulxe does; the screen with cover art and a description of the game. So I wrote my own quick-and-dirty shell script to do just that. You can use it as sort of a wrapper to start gargoyle.

In a nutshell

  • Compile babel
  • Save script
  • Run script to see cover image and description for interactive fiction games before opening them with gargoyle.

Prerequisites

  • Compile from source
    • babel
      • put in same directory as script below
  • You probably already have these
    • zenity
    • feh
    • xmllint
  • In case you’re missing one of the above
    • Ubuntu: sudo apt install zenity feh libxml2-utils

Code

  • Customize location of babel
  • Customize –filename location on line 8
#!/bin/sh
if [ -z "$1" ]
then
	#select file
	# NB: Customize filename location below
	#     it's the directory the file-select
	#     dialogue opens to
	gamefile=$(zenity --file-selection --title="Select Game" --filename="$HOME/Games/interactive_fiction/")
	echo "Gamefile: $gamefile"
	if [ -z "$gamefile" ]
	then
		exit
	fi
else
	gamefile=$1
fi 
# get ifid
ifid=$(./babel -ifid "$gamefile" | cut -c7-)
# extract ifiction file (xml)
./babel -ifiction "$gamefile" -to /tmp
# get cover
./babel -cover "$gamefile" -to /tmp
# Get Title and author
title=$(sed '2 s/xmlns=".*"//g' /tmp/${ifid}.iFiction| xmllint --xpath '/ifindex/story/bibliographic/title/text()' -)
author=$(sed '2 s/xmlns=".*"//g' /tmp/${ifid}.iFiction| xmllint --xpath '/ifindex/story/bibliographic/author/text()' -)
# find cover format
ext=$(sed '2 s/xmlns=".*"//g' /tmp/${ifid}.iFiction| xmllint --xpath '/ifindex/story/cover/format/text()' -)
# extract destription
zenity --info --width=800 --title="$title by $author" --text="$(sed '2 s/xmlns=".*"//g' /tmp/${ifid}.iFiction| xmllint --xpath '/ifindex/story/bibliographic/description/text()' -)"
# show cover
feh -F --title "$title by $author" /tmp/${ifid}.${ext}
# run with gargoyle
/usr/local/bin/gargoyle "$gamefile"

Usage

whatever-you-name-it.sh [if-game-file]

If you don’t supply a game file as an argument, you’ll get a file-select dialogue from zenity.. choose the game.

Quitting feh (image viewer)

If you’re not familiar with feh, you just have to hit q to quit.

Caveat Emptor

  • Not all interactive fiction games have a cover image and description
    • In that case, the script will probably just show a blank zenity dialogue and then start gargoyle.

Background

I really enjoy using Gargoyle for interactive fiction, but there’s one feature that it doesn’t do (yet).

When I open a gblorb or zblorb file with glulxe, I get an intro screen with an image and a short blurb introducing the game.

This is maybe 0.001% of the experience of playing a game, but I like it.

Apparently, the image and description are part of something called the Treaty of Babel. Gargoyle doesn’t support this yet, but it’s possible to use the command line babel program and a little scripting to create a little wrapper that extracts the description and image before loading a game in gargoyle.