diff options
Diffstat (limited to '')
| -rwxr-xr-x | xedit | 8 | ||||
| -rwxr-xr-x | xedit-filter | 5 |
2 files changed, 10 insertions, 3 deletions
| @@ -0,0 +1,8 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # My X editor | ||
| 4 | # Requires: terminal | ||
| 5 | |||
| 6 | editor=${EDITOR:-${VISUAL:-vi}} | ||
| 7 | |||
| 8 | terminal $editor | ||
diff --git a/xedit-filter b/xedit-filter index 93e908c..9422760 100755 --- a/xedit-filter +++ b/xedit-filter | |||
| @@ -1,10 +1,9 @@ | |||
| 1 | #/!bin/sh | 1 | #/!bin/sh |
| 2 | 2 | ||
| 3 | # Open stdin in a text editor and sends modified selection to stdout | 3 | # Open stdin in a text editor and sends modified selection to stdout |
| 4 | 4 | # Requires: xeditor | |
| 5 | xeditor=${XEDITOR:-gedit} | ||
| 6 | 5 | ||
| 7 | f=$(mktemp) | 6 | f=$(mktemp) |
| 8 | cat > "$f" | 7 | cat > "$f" |
| 9 | $xeditor "$f" && cat "$f" | 8 | xeditor "$f" && cat "$f" |
| 10 | 9 | ||
