Skip to content

Commit

Permalink
src: Fixed last chance to find Xauthority.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Venries committed Mar 19, 2017
1 parent 175240f commit 8e4e3ca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/xpub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ main () {
fi

# XWayland does not need Xauthority
if ! $isXWayland && [ -z "${xauth}" ] ; then
echo 'No Xauthority found.' 1>&2
exit 1
if ! $isXWayland && [ -z "${xauth}" ]; then
if [ ! -r "/home/${xuser}/.Xauthority" ]; then
echo 'No Xauthority found.' 1>&2
exit 1
fi
xauth="XAUTHORITY=/home/${xuser}/.Xauthority"
fi

$tFlag && echo "XUSER=${xuser}" || printf "%s\n%s\n" "TTY=${xtty}" "XUSER=${xuser}"
Expand Down

0 comments on commit 8e4e3ca

Please sign in to comment.