aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-18 17:33:02 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-18 17:33:02 +1200
commitae31d2fd097db16f0a2d78de6f08ffaf21825e4a (patch)
tree54550d3c94345e76f5d3c0569a9067e941c36d1a
parentMove wget config into XDG (diff)
downloaddotfiles-ae31d2fd097db16f0a2d78de6f08ffaf21825e4a.tar.gz
dotfiles-ae31d2fd097db16f0a2d78de6f08ffaf21825e4a.zip
Apply XDG to xyzzy(6df)
-rw-r--r--games/xyzzy.sh6
-rw-r--r--man/man6/xyzzy.6df4
2 files changed, 6 insertions, 4 deletions
diff --git a/games/xyzzy.sh b/games/xyzzy.sh
index 5cc03278..b4fc4695 100644
--- a/games/xyzzy.sh
+++ b/games/xyzzy.sh
@@ -1,6 +1,8 @@
# ADVENTURE
-if [ -e "$HOME"/.xyzzy ] ; then
+state=${XDG_CONFIG_HOME:-$HOME/.config}/xyzzy/dest
+mkdir -p -- "${state%/*}"
+if [ -e "$state" ] ; then
printf >&2 '%s\n' 'Nothing happens.'
exit 1
fi
-printf '%s\n' 'I see no cave here.' > "$HOME"/.xyzzy
+printf '%s\n' 'I see no cave here.' > "$state"
diff --git a/man/man6/xyzzy.6df b/man/man6/xyzzy.6df
index 7270b95d..0d928b45 100644
--- a/man/man6/xyzzy.6df
+++ b/man/man6/xyzzy.6df
@@ -8,7 +8,7 @@
Invoking
.B xyzzy
in a directory will tag that directory as a target for teleportation, writing
-its name to the file ~/.xyzzy. Typing it again at any given point will then
-change into that marked directory.
+its name to the file $XDG_CONFIG_HOME/xyzzy/dest. Typing it again at any given
+point will then change into that marked directory.
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>