Skip to content

Commit

Permalink
define XAUTHORITY if it is unset
Browse files Browse the repository at this point in the history
the mission requiring xeyes might not work if the XAUTHORITY variable is
unset. In that case, it defaults to ~/.Xauthority, which will fail
because GameShell redefines $HOME.

Also, if it is defined but starts with ~, I need to change the ~ to
$REAL_HOME.
  • Loading branch information
phyver committed Aug 7, 2022
1 parent 71d3883 commit 4a71912
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions missions/intermediate/04_bg_xeyes/gshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# if the XAUTHORITY variable isn't defined, it defaults to ~/.Xauthority
# since GameShell redefines HOME, the file won't be found.

if [ -z "$XAUTHORITY" ]
then
export XAUTHORITY=$REAL_HOME/.Xauthority
else
export XAUTHORITY=${XAUTHORITY/~/$REAL_HOME}
fi

0 comments on commit 4a71912

Please sign in to comment.