clipedit: change terminal
This commit is contained in:
parent
74bd62f90e
commit
b4001fbfef
1 changed files with 2 additions and 3 deletions
|
|
@ -2,8 +2,7 @@
|
||||||
, lib
|
, lib
|
||||||
, xclip
|
, xclip
|
||||||
, coreutils
|
, coreutils
|
||||||
, terminal-command ? "kitty sh -c"
|
, terminal-command ? "alacritty -e"
|
||||||
, editor-command ? "hx"
|
|
||||||
}:
|
}:
|
||||||
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
|
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
|
||||||
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
|
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
|
||||||
|
|
@ -11,7 +10,7 @@ writeShellScriptBin "clipedit" ''
|
||||||
PATH=$PATH:"${lib.makeBinPath [ coreutils xclip ]}"
|
PATH=$PATH:"${lib.makeBinPath [ coreutils xclip ]}"
|
||||||
tmp_file=$(mktemp)
|
tmp_file=$(mktemp)
|
||||||
xclip -out -selection -clipboard > $tmp_file
|
xclip -out -selection -clipboard > $tmp_file
|
||||||
${terminal-command} "${editor-command} $tmp_file"
|
${terminal-command} $VISUAL $tmp_file || ${terminal-command} $EDITOR $tmp_file
|
||||||
xclip -in -selection clipboard < $tmp_file
|
xclip -in -selection clipboard < $tmp_file
|
||||||
rm $tmp_file
|
rm $tmp_file
|
||||||
''
|
''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue