The officially official Devuan Forum!

You are not logged in.

#1 Today 18:35:22

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 173  

awk-menu: a simple line selection tool + examples

If you have ever booted one of my isos or tried α-utilz, you have seen it

it is easy to use, but also very hackable, you can make custom keybindings and more
its says "examples" in the title, but these scripts are relative complex and quite usefull by themselves

the only dependencie is awk (gawk or mawk), which makes this ideal for very minimalist systems
if you need a minimalistic tool to change screen resolution, connect your wifi or mount usb-drives, check out:
gitlab.com/_alphalpha_/awk-menu
screenshot1.png
screenshot2.png

Online

#2 Today 19:03:01

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 173  

Re: awk-menu: a simple line selection tool + examples

i forgot to add a simple template:

#!/bin/sh
[ ! "$SCRIPTS" ] && SCRIPTS="${0%/*}"
. "$SCRIPTS"/lib/text-center || exit 1
. "$SCRIPTS"/lib/awk-menu    || exit 1
. "$SCRIPTS"/lib/text-box    || exit 1

awk_menu_tmsg="template"
awk_menu_tmsg="$(text_box "$(text_center "$awk_menu_tmsg")")"

input_text="> Option 1
> Option 2
> Option 3
> Exit Script"
input_text="$(text_center "$input_text")"

selection="$(awk_menu "$input_text")"
case "$selection" in
  "> Option 1")	sleep;;
  "> Option 2")	wait;;
  "> Option 3")  return;;
  "> Exit Script") exit 0;;
esac

exit 0

Last edited by alphalpha (Today 19:18:07)

Online

Board footer