aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2022-05-09 13:36:39 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2022-05-09 13:36:39 +0200
commitc8fc83e3525959abdc1e7ce91477d74bf6b35a72 (patch)
tree5bab1fd2c4fa3cece510ce05a7f2b87cb18710de
parent4e9c45553f24850ea7973d4326ab922db10a96e9 (diff)
downloadscripts-c8fc83e3525959abdc1e7ce91477d74bf6b35a72.tar.gz
scripts-c8fc83e3525959abdc1e7ce91477d74bf6b35a72.zip
Added edit-menu
Diffstat (limited to '')
-rw-r--r--Makefile1
-rwxr-xr-xedit-menu25
2 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7a8f60d..90a49d0 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ SCRIPTS = addressgrep \
14 dmenu-unmount \ 14 dmenu-unmount \
15 dmenu-urlselect \ 15 dmenu-urlselect \
16 dmenu-websearch \ 16 dmenu-websearch \
17 edit-menu \
17 ffmpeg-screenrecord \ 18 ffmpeg-screenrecord \
18 ffmpeg-facecam \ 19 ffmpeg-facecam \
19 mail-checknow \ 20 mail-checknow \
diff --git a/edit-menu b/edit-menu
new file mode 100755
index 0000000..ed180a2
--- /dev/null
+++ b/edit-menu
@@ -0,0 +1,25 @@
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
14editor=${EDITOR:-vi}
15
16export EDITMENU=$(mktemp)
17in=$(mktemp)
18
19cat > "$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
25cat $EDITMENU

Generated with cgit - Back to sebastiano.tronto.net