Create a select menu with smenu

Not Spoiled for Choice

© Lead Image © acik, 123RF.com

© Lead Image © acik, 123RF.com

Article from Issue 205/2017
Author(s):

The smenu tool reduces the effort of creating shell menus to one line, with numerous options for a wide range of design alternatives.

If you program for the shell frequently, sooner or later you will have to create a select menu, which usually requires several lines of code – unless you use smenu. Smenu reduces the menu's script to a single line. A number of parameters allow you to adapt the design and to simplify your work a little.

The source code for smenu is available on its project page [1], which contains installation instructions, as well as some useful tips. The smenu wiki [2] contains links to two YouTube videos that demonstrate the practical use of the program. The README file provides a structured overview of smenu's options [1].

Basic Function

In smenu's simplest form, a command's output is passed via pipe to the smenu command. For example, <command> | smenu displays a selection on a single line. To create a line-by-line menu, use <command> | smenu -c (Figure 1).

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Workspace: Text Expander

    A couple of utilities and a dash of Bash scripting are all you need to roll out a simple yet flexible text expander.

  • Zenity and KDialog

    Zenity and KDialog let you integrate your scripts with the native KDE or Gnome environment.

  • Bash scripting

    A few scripting tricks will help you save time by automating common tasks.

  • Automating FTP

    If you find your self executing the same few steps in FTP, you’ll save time and effort with a little automation.

  • Sunflower File Manager

    Sunflower is a highly configurable graphical file manager with two windows that implement an unusual concept by trying to integrate the command line with the file manager.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia