Code Monkey home page Code Monkey logo

bmenu's Introduction

Version

B-Menu

Screenshot

B-Menu is a minimalistic general purpose terminal menu written in C. It was designed to replace terminal-based login managers such as CDM. However, it can easily serve as a simple terminal menu for any situation where you would like to execute a command from a set of menu selections.

B-Menu has zero dependencies and it is intentionally feature-minimal. This keeps it easy to install, configure, and run.

Note that bmenu uses ANSI/VT100 terminal escape sequences to draw the menu in the terminal window. Most modern terminal programs support these sequences so this should not be an issue for most users. If yours does not, the menu may not render properly in your terminal window.

Table of Contents

  1. Download and Install
  2. Configuration
  3. Usage
  4. Run as a Login Manager
  5. License
  6. Tips

Download and Install

To install this project from source, you will need to have the tools git, gcc, and make to download and build it. Install them from your package manager if they are not already installed.

Once you have the necessary tools installed, follow these instructions:

git clone https://github.com/bartobri/bmenu.git
cd ./bmenu
make
sudo make install

This will build and install bmenu in to the /usr/local/bin directory.

Uninstall:

sudo make uninstall

Configuration

By default, b-menu looks for menu options in $HOME/.bmenu. This file should consist of one menu option and one command on each line, seperated by a colon.

Example:

Clear Screen:/usr/bin/clear
Dir Listing:/usr/bin/ls -l

Usage

Use the -c option to override the default menu file path:

bmenu -c /full/path/to/menu/file

Use the -t option to override the default menu prompt:

bmenu -t 'Choose an Option:'

Run as a Login Manager

To run b-menu when you login, place the following code in $HOME/.bash_profile:

if [[ "$(tty)" == '/dev/tty1' ]]; then
    [[ -n "$BMENU_SPAWN" ]] && return
    export BMENU_SPAWN=1
    # Avoid executing bmenu when X11 has already been started.
    [[ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ]] && exec bmenu
fi

If you do this, it is best to include a menu option to launch a shell. Add the following to your menu options file:

Shell:/bin/bash --login

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. See LICENSE for more details.

Tips

Tips are always appreciated!

bmenu's People

Contributors

bartobri avatar jtcruthers avatar tekknolagi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.