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

22
pkgs/clipedit/default.nix Normal file
View file

@ -0,0 +1,22 @@
{ writeShellScriptBin
, lib
, xclip
, coreutils
, terminal-command ? "kitty -e"
,
}:
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
writeShellScriptBin "clipedit" ''
PATH=$PATH:"${
lib.makeBinPath [
coreutils
xclip
]
}"
tmp_file=$(mktemp)
xclip -out -selection -clipboard > $tmp_file
${terminal-command} $VISUAL $tmp_file || ${terminal-command} $EDITOR $tmp_file
xclip -in -selection clipboard < $tmp_file
rm $tmp_file
''