sekrit: use timeout in cp if present

This commit is contained in:
Lucas 2022-07-30 14:45:04 +00:00
parent 7dbf7e8711
commit fc3171ae5e
1 changed files with 7 additions and 1 deletions

View File

@ -109,8 +109,14 @@ sekrit_cp()
key=$1
path=$(make_key_path "$key")
[ -f "$path" ] || err "no data for key $key"
timo=
if command -v timeout >/dev/null 2>&1; then
timo="timeout 10"
fi
_sekrit_decrypt "$path" |
xclip $rmlastnl -loops 1 -quiet -selection clip 2>/dev/null
$timo xclip $rmlastnl -loops 1 -quiet -selection clip 2>/dev/null
}
sekrit_gen()