WIP: rice

This commit is contained in:
Filippo Berto 2024-10-21 12:27:32 +02:00
parent f842c92339
commit 1096479c4a
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
14 changed files with 81 additions and 32 deletions

View file

@ -0,0 +1,23 @@
{ writeShellScriptBin
, lib
, wl-clipboard
, coreutils
, editor ? "hx"
, 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 -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"
''