Des menus dans votre terminal - retour accueil
git clone git://bebou.netlib.re/zenu
Log | Files | Refs |
commit 36dcfa7025c9549c2123102174c57a1d9fce4d93 parent f4a2fea170d6aa256e8db46154cbd9ec2a3783dd Auterice: mc <mc@unistra.fr> Date: Wed, 10 May 2023 07:48:29 +0200 move test menus to eg/ those menus will become examples so I can get my private stuff. Diffstat:
A | eg/edit | | | 3 | +++ |
A | eg/mail | | | 15 | +++++++++++++++ |
A | eg/main | | | 10 | ++++++++++ |
A | eg/mru | | | 5 | +++++ |
A | eg/network | | | 27 | +++++++++++++++++++++++++++ |
D | menus/mail | | | 15 | --------------- |
D | menus/main | | | 10 | ---------- |
D | menus/mru | | | 5 | ----- |
D | menus/network | | | 27 | --------------------------- |
9 files changed, 60 insertions(+), 57 deletions(-)
diff --git a/eg/edit b/eg/edit @@ -0,0 +1,3 @@ +_notes +## react +;; (n) vim ~/README +'cd %:h' +'setf roguemode' diff --git a/eg/mail b/eg/mail @@ -0,0 +1,15 @@ +read main box +sync from partage +read old stuff +compose +index +## react +;; (r) mutt +;; (o) mutt -f ~/Maildir/Trash +;; (s) mbsync -ac ~/Maildir/rc +;; (c) echo not yet +;; (i) set mu index + if [ "$TMUX" ] + then tmux split -dl3 $@ + else $@ + fi diff --git a/eg/main b/eg/main @@ -0,0 +1,10 @@ +mail +recent (MRU) +jobs +notes +network +## react +;; (m) zenu+ mail +;; (r) zenu+ mru +;; (w) zenu+ network +;; (n) vim ~p/start +'cd %:h' +'setf roguemode' diff --git a/eg/mru b/eg/mru @@ -0,0 +1,5 @@ +directories +files +## react +;; (d) c +;; (f) e diff --git a/eg/network b/eg/network @@ -0,0 +1,27 @@ +chose interface +up +down +get ip addr +get up (u+g) +## pre +local save=$zenu_store/network_interface +local state=$zenu_store/network_state +local nif= +touch $save +read nif < $save +echo +ip -br a | sed -r " + s/ /! / # separator for pick + s/^/ / # margin +"| tee $state | +sed "/${nif:-é}!/s/.*/\x1b[7m&\x1b[m/;s/!/ /" +## react +;; (c) + zenu.up $(( $(< $state wc -l) + 1 )) + < $state IFS='!' pick -Xd > $save + read nif < $save +;; (u) doas ip li set $nif up +;; (d) doas ip li set $nif down +;; (g) doas /sbin/dhclient $nif +;; (+) doas ip li set $nif up + doas /sbin/dhclient $nif diff --git a/menus/mail b/menus/mail @@ -1,15 +0,0 @@ -_read main box -_sync from partage -read _old stuff -_compose -_index -## react -;; (r) mutt -;; (o) mutt -f ~/Maildir/Trash -;; (s) mbsync -ac ~/Maildir/rc -;; (c) echo not yet -;; (i) set mu index - if [ "$TMUX" ] - then tmux split -dl3 $@ - else $@ - fi diff --git a/menus/main b/menus/main @@ -1,10 +0,0 @@ -_mail -_recent (MRU) -_jobs -_notes -net_work -## react -;; (m) zenu+ mail -;; (r) zenu+ mru -;; (w) zenu+ network -;; (n) vim ~p/start +'cd %:h' +'setf roguemode' diff --git a/menus/mru b/menus/mru @@ -1,5 +0,0 @@ -_directories -_files -## react -;; (d) c -;; (f) e diff --git a/menus/network b/menus/network @@ -1,27 +0,0 @@ -_chose interface -_up -_down -_get ip addr -get up (u_+g) -## pre -local save=$zenu_store/network_interface -local state=$zenu_store/network_state -local nif= -touch $save -read nif < $save -echo -ip -br a | sed -r " - s/ /! / # separator for pick - s/^/ / # margin -"| tee $state | -sed "/${nif:-é}!/s/.*/\x1b[7m&\x1b[m/;s/!/ /" -## react -;; (c) - zenu.up $(( $(< $state wc -l) + 1 )) - < $state IFS='!' pick -Xd > $save - read nif < $save -;; (u) doas ip li set $nif up -;; (d) doas ip li set $nif down -;; (g) doas /sbin/dhclient $nif -;; (+) doas ip li set $nif up - doas /sbin/dhclient $nif