Make timeout optional

This commit is contained in:
Chris Down 2018-11-01 00:35:38 +00:00
parent a80efc202e
commit f748a2e5a6

View file

@ -21,8 +21,15 @@ has_clipnotify=0
# shellcheck disable=SC2206
cm_selections=( $CM_SELECTIONS )
if command -v timeout >/dev/null 2>&1; then
timeout_cmd=(timeout 1)
else
echo "WARN: No timeout binary. Continuing without any timeout on xsel." >&2
timeout_cmd=()
fi
_xsel() {
timeout 1 xsel --logfile /dev/null "$@"
"${timeout_cmd[@]}" xsel --logfile /dev/null "$@"
}
get_first_line() {