Giter Site home page Giter Site logo

ap2amr / shellmenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from derdere/shellmenu

0.0 0.0 0.0 868 KB

It's a python3 script which displays a menu, bases on a configuration json file, to easyly acces your most common commands.

License: GNU General Public License v3.0

Python 91.79% Makefile 4.67% Shell 3.54%

shellmenu's Introduction

ShellMenu

ShellMenu is a fallout 4 inspired Menu system written in python, configured with a single JSON file.

ShellMenu Screenshot Fallout Screenshot

Dependencies

  • make
  • python3.5 or greater
  • pip for python3.5 or greater
  • unzip
  • wget

Installation

After installing all dependencies use pip to install the package netifaces:

sudo pip install netifaces

Then use make to run the installation:

sudo make install

Usage

To start just run the following command in your terminal:

shell-menu

Within the menu you can open a help prompt using the h key. You can reload using the r key. You can edit your current config by pressing c and you can execute terminal commands using the t key. To exit the menu press q or ESCAPE. You can navigate throu the menu using the arrow keys or W,A,S,D. Some keys like ENTER, d or KEY_RIGHT have the same functions. Here is a table of the keylayout:

KeyFunction
hShow Help
wUp
Arrow Up
sDown
Arrow Down
EnterConfirm selection
e
d
Arrow Right
TABGo Back
a
BACKSPACE
Arrow Left
qExit ShellMenu
x
ESCAPE
tExecute command
cEdit configuration
rReload Menu
HShow --help for selection

Configuration

The configuration is stored entirely in a JSON file. The following explanation assumes that you have basic knowledge of the JSON syntax. If that's not the case have a look at the folowing link: w3schools JSON syntax

Commands

If you want to add a command option to your menu (for example opening htop) you just have to add a key with a string value to your JSON object. The key will be shown inside the menu and the string value will be the command executed.

"Open htop": "htop"

After completing the execution of the command the menu will reopen by default. If you wish the command to wait until you press enter end the command with the string &read all lowercase no whitespaces.

"Show Datetime": "date&read"

Text

If you want to add text to a menu just add a key with an array value containing each line of text as a string value. The content of the key will not be displayed so its content doesn't realy matter, it just has to be unique. If the key is not unique that will override the previous one. (I just add a number counting up each time.)

"T1": [
    "Text Line 1",
    "Text Line 2"
],
"T2": [
    "Another Line of text"
]

Do not use new line characters to create new lines rather than just a new string value to prevent displaying errors!

Submenu

Creating a submenu is simple just add a key with an object value containing more keys. The key will be the title displayed in the parent menu, and the content of the object will be used to display the submenu.

"Open Submenu": {
    "T1": [ "Submenu Title" ],
    "Submenu Option": "echo Hello&read"
}

If you want to see all examples used in one config file take a look at "examples/readme_example.json".

Origin

Before I was a Linux fan, I was a bit put of by the use of the terminal. Mainly bacause I wasn't compfy using it. But I still wanted to get into Linux and a lot of my dev friend where using Ubuntu. So what I did was: I installed Ubuntu Server Edition on one of my old Laptops, forcing me to only use the terminal. After hours of tinkering around to get the freaking wifi to work I started to look at curses/terminal based applications. So after finding some applications like wicd-curses, ranger, pulsemixer and gotop, I wanted a way to acces them easely. And as a developer, who was currently playing the Fallout 4 game, I took the for me quickest aproach and just recreated the TUI from the Fallout Terminals. I was quite happy so far and now after a few years of ignoring this litte project I decided to revive it and tidy it up for others to enjoy.

I am planing on creating a faster more customizable version using c++ in the future. And for some fun I will also recreate the fallout hacking minigame, at least if no one has already done so. Have fun using this Version, I am open for sugjestios for the versoin 2.0. I won't be changing this old one up to much tho.

shellmenu's People

Contributors

derdere 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.