Make timeout optional
This commit is contained in:
parent
a80efc202e
commit
f748a2e5a6
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue