octotep / menugen

Generates menu based applications using rofi
33 stars 2 forks source link

Menugen

CURRENTLY IN DEVELOPMENT, API IS NOT STABLE

menugen is a bash script which runs menugen scripts (specially formatted bash scripts) and renders them as a series of interactive menus using rofi or fzf.

Motivation

rofi is a great selector, and some great scripts have already been written which take advantage of rofi's features to make quick and easy-to-use menus driven applications. Some examples include:

menugen's entire purpose is to make these types of programs easy to create and maintain.

Getting Started

To start, download menugen to your computer. Next, follow along with a couple of examples which you can find in the repository:

Example #1 - Hello World

First I'll show you the code, then I'll explain some basics about working with menugen.

#!../menugen

#begin main
name="Hello World"
add_item "Here we're adding an item to a menu"            'next' 'echo Running the item'
add_link 'Just a link, will not run an action'            'next'
add_exec 'Just runs an action, will terminate afterwards'        'echo Running the exec'
#end main

#begin next
name="Final menu"
prompt="See ya! > "
add_exec 'All done!' "echo Thanks for playing, come again sometime"
#end next

Save that in a file, maybe helloworld, chmod 700 it, then run with ./helloworld.

Output

Main menu

Next menu

There's a couple of things to notice right off the bat.

TODO