Browse Source

bin/edit-clipboard-gvim

Brennen Bearnes 1 week ago
parent
commit
3307d8db0d
2 changed files with 13 additions and 2 deletions
  1. 3
    2
      home/bin/edit-clipboard
  2. 10
    0
      home/bin/edit-clipboard-gvim

+ 3
- 2
home/bin/edit-clipboard View File

@@ -1,8 +1,9 @@
1 1
 #!/bin/sh
2 2
 
3
-# Edit clipboard contents with $EDITOR.
3
+# Edit clipboard contents with $EDITOR.  This will break in situations
4
+# not using localhost:1...
4 5
 
5
-tmpfile=`mktemp edit-clipboard.XXXXXX`
6
+tmpfile=`mktemp /tmp/edit-clipboard.XXXXXX`
6 7
 xclip -o > "$tmpfile"
7 8
 "$EDITOR" "$tmpfile"
8 9
 xclip -i "$tmpfile"

+ 10
- 0
home/bin/edit-clipboard-gvim View File

@@ -0,0 +1,10 @@
1
+#!/bin/sh
2
+
3
+# Edit clipboard contents with gvim.
4
+
5
+# We need the --nofork here because otherwise the gvim process forks and
6
+# returns to the parent script, so that by the time it's opened the tempfile is
7
+# gone and the clipboard has been cleared.
8
+export EDITOR="/usr/bin/gvim --nofork"
9
+
10
+edit-clipboard