wl-clipedit

This commit is contained in:
Filippo Berto 2023-11-17 11:08:32 +01:00
parent e240fbdc46
commit b74916095a
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
3 changed files with 21 additions and 1 deletions

View file

@ -0,0 +1,18 @@
{ writeShellScriptBin
, lib
, wl-clipboard
, coreutils
, terminal-command ? "kitty -e"
}:
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
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
''