Skip to content

Commit

Permalink
Skip the copy to clipboard on non-X sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarier committed Feb 15, 2017
1 parent cafdc39 commit 1a1fbdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion totp
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ if [ ! -r "$KEY" ] ; then
fi

CODE="$(/usr/bin/oathtool --totp --base32 "$(<"$KEY")")"
echo -n "$CODE" | xsel --clipboard
if [ "z$DISPLAY" != "z" ] ; then
echo -n "$CODE" | xsel --clipboard
fi
echo "$CODE"

0 comments on commit 1a1fbdf

Please sign in to comment.