wl-clipedit
This commit is contained in:
parent
e240fbdc46
commit
b74916095a
3 changed files with 21 additions and 1 deletions
18
custom/wl-clipedit/default.nix
Normal file
18
custom/wl-clipedit/default.nix
Normal 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
|
||||
''
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue