Skip to content

Commit

Permalink
Make timeout optional
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed Nov 1, 2018
1 parent a80efc2 commit f748a2e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion clipmenud
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f748a2e

Please sign in to comment.