WL-Clipedit: fixed wrong number of parameters

This commit is contained in:
Filippo Berto 2023-11-18 21:25:16 +01:00
parent f68a45dfd4
commit 91fb78e143
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED

View file

@ -2,6 +2,7 @@
, lib
, wl-clipboard
, coreutils
, editor ? "hx"
, terminal-command ? "kitty -e"
}:
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
@ -9,10 +10,10 @@
writeShellScriptBin "wl-clipedit" ''
PATH=$PATH:"${lib.makeBinPath [ coreutils wl-clipboard ]}"
tmp_file=$(mktemp)
wl-paste -pn > $tmp_file
${terminal-command} $VISUAL $tmp_file || ${terminal-command} $EDITOR $tmp_file
wl-copy -pn < $tmp_file
rm $tmp_file
wl-paste -t 'text/plain;charset=utf-8' -n > "$tmp_file"
${terminal-command} ''${VISUAL:-''${EDITOR:-${editor}}} "$tmp_file"
wl-copy -t 'text/plain;charset=utf-8' -n < "$tmp_file"
rm "$tmp_file"
''