diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-05-30 21:08:53 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-05-30 21:08:53 +0200 |
| commit | 8665280d65ff8c9d8b382579d877e42b57a000a6 (patch) | |
| tree | fb6857704eef2e62997cc3798eda6456d8326c91 /experiments | |
| parent | af05c6c366ce928818848a3d8c897e7c52ae9d0f (diff) | |
| download | scripts-8665280d65ff8c9d8b382579d877e42b57a000a6.tar.gz scripts-8665280d65ff8c9d8b382579d877e42b57a000a6.zip | |
Removed experiments folder
Diffstat (limited to '')
| -rwxr-xr-x | experiments/edit-menu | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/experiments/edit-menu b/experiments/edit-menu deleted file mode 100755 index ed180a2..0000000 --- a/experiments/edit-menu +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # A "filter", based on your favorite editor. | ||
| 4 | # It reads lines from stdin, opens a file containing these lines | ||
| 5 | # with your favorite editor, and then prints the content of the file | ||
| 6 | # $EDITMENU to stdout. I have configured my editor to write the | ||
| 7 | # current line to $EDITMENU when pressing ;; (semicolon twice) like this | ||
| 8 | # map ;; !!tee -a $EDITMENU^M " For nvi | ||
| 9 | |||
| 10 | # It can be used to replace dmenu or similar menu applications in | ||
| 11 | # constrained environment. It works even without any (n)curses library, | ||
| 12 | # assuming you use a suitable editor (like ed). | ||
| 13 | |||
| 14 | editor=${EDITOR:-vi} | ||
| 15 | |||
| 16 | export EDITMENU=$(mktemp) | ||
| 17 | in=$(mktemp) | ||
| 18 | |||
| 19 | cat > "$in" | ||
| 20 | |||
| 21 | # This is a dirty trick to "help" the editor (vi) understand that it can | ||
| 22 | # take over the tty to get its input. | ||
| 23 | $editor "$in" < /dev/tty | ||
| 24 | |||
| 25 | cat $EDITMENU | ||
