Skip to content

Compact application for creating text menus with executable entries. Use it to build straightforward static shortcut menus or dynamically generate advanced menus for more complex programs.

License

10xJSChad/climenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

climenu

C application for creating interactive text menus with custom buttons. Menus can be read from config files or stdin, navigate using keys, and execute shell commands easily. Useful for simplifying command execution and organization, but can also be used to quickly create more advanced menu applications.

Do not question why it's called climenu when it creates tuis.

If you're looking for something even simpler, I also made cmenu, which is pretty much just a terminal dmenu clone.

Basic example (example.conf):

climenu_1.mp4

climenu in a file explorer (explorer.sh):

climenu_2.mp4

Features:

  • Incredibly simple config syntax, creating entries is a breeze.
  • Can read entries from stdin, allowing for dynamic generation of menus by external programs.
  • No external dependencies, it'll easily compile on anything that resembles Linux.
  • Runs just fine on any terminal emulator that supports common ANSI escape codes.

Usage:
 climenu [ENTRIES PATH] [UPDATE INTERVAL]
 If no entries file is provided, climenu
 will attempt to read entries from stdin.

Keys:
  Navigate: JK, UP/DOWN arrows.
  Select:   Space, Enter
  Exit:     CTRL+C, Q

Entry types:
 [Header]: Defines a menu header with a text description.
 [Entry]:  Defines a button with a label and a shell command to execute.
 
Entry properties:
 [Header] and [Entry]:
   <str>:   Specifies the text to display for the header or button.
   fgcolor: foreground color. [black,blue,cyan,green,magenta,red,white,yellow]
   bgcolor: background color. [black,blue,cyan,green,magenta,red,white,yellow]
   runstr:  Execute the entry string and display the result [true]

 [Entry]:
   <exec>:    Specifies the shell command to execute when the button is pressed.
   exit:      Exit after executing an entry command. [true]
   wait:      Waits for a key press after executing the command. [true]
   colormode: When the entry should be displayed in color. [selected]

Roadmap:

  • Scrolling, currently it does not scroll and thus you can't really have a whole lot of entries.
  • More dynamic entry text, would be nice if an entry could conditionally change its text and color.
  • Not a feature, but the parser isn't great to look at, should be rewritten for clarity.

Contribution Guidelines:

  • Do not refactor unless you're already adding or fixing something. If the code has nothing to do with what you're trying to accomplish, don't refactor it. Do feel free to change anything in the vicinity of the code you are working on, though.
  • Keep the scope of your contribution small and simple, this application is not supposed to be feature-packed and super customizable. Try to keep your features as general as possible, climenu doesn't need to meet the needs of every user.
  • The program must still compile with a simple gcc climenu.c when you're done, this is less of a guideline and more of a hard rule.

Requirements:
  Linux (Other *nix-es probably work fine, too)
  A C compiler.

Building:
  cc climenu.c

About

Compact application for creating text menus with executable entries. Use it to build straightforward static shortcut menus or dynamically generate advanced menus for more complex programs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published