Skip to content

Lateralus138/unishellectv2

Repository files navigation

UniShellect V2 lspids logo

Load a menu of shells/files from a provided JSON configuration file. Version 2 - C++ rewrite.


  1. About
    1. Description
    2. Motivation
  2. Usage
    1. Environment
    2. Files
      1. Debian Installer
        1. Deb Install
        2. Deb Provides
          1. Bash Completion
          2. HiColor Icon Theme
          3. Man Page Entry
      2. Portable
        1. Portable Linux
        2. Portable AppImage
        3. Portable Android
        4. Portable Windows
      3. Bash Completion File
      4. Configuration File
    3. Current Builds MD5
      1. Current Linux MD5
      2. Current Debian MD5
      3. Current Android AARCH64 MD5
      4. Current AppImage MD5
      5. Current Windows X86 MD5
      6. Current Windows X64 MD5
  3. Examples
    1. Help Screen
    2. Normal Usage
    3. Alternate Configuration File
  4. Media
    1. Logo
    2. Help Screen
    3. Man Page
    4. Demonstration
  5. Contribute
    1. Project
    2. Donate
  6. Build Status And Project Information
    1. Build Information
    2. Version Status
    3. CodeFactor
    4. Attributions
  7. LICENSE

Twitter URL


About

Version 2 of UniShellect.

Version 1 was written in Fortran and has a slight bug in the JSON parsing that I'd prefer not to fix as I wanted to write this new version anyway. The bug causes the program to not be able to parse more than 9 entries. Version 2 is written in C++ and negates this issue.

Description

This tool parses a JSON configuration file and loads a highly customizable menu of shells, interpreters, files, commands and possible arguments into any command line interface. Various configuration files can be loaded and this can be great for loading various menus based on various criteria: E.g. project menus, work menus, game menus, etcetera.

You can also set sub-menus by using unishellect itself as the Path and pass the sub menu file as the Args.

This is a cross-platform FOSS project.

Motivation

This is inspired by the hyper-shellect plug-in for the Hyper terminal which is dependent on node.js.

This particular version was inspired from the need for a rewrite of original.

I work and play in all sorts of command line environments in both Windows and Linux and this helps me organize and navigate that world more efficiently and smoothly.


Usage

When, where, and how to use this program.

Environment

This is an open-source (FOSS) command line utility for use in Linux, Windows, and Android shells (terminals/ttys/Termux/etc.). This can be built from source (as per the LICENSE file provided), used portably (single executable put wherever you like), or installed via the provided Debian (.deb) package. An AppImage for the Linux version is provided as well.

The recommended method of use is via the Debian package installation for the Debian (apt, deb) packager manager, but there are other methods provided here or if you would care to provide an installer for a different package manager then please fork this project, build the appropriate workflow and source files, and make a pull-request. More information about contributing here.

Files

All currently built and released files can be found at the releases page:

Releases

Debian Installer

I personally recommend this method as it automatically installs a basic Bash Completion file, a hicolor icon theme, and a man page entry.

Deb Install
  1. Download and install the current .deb installer file at the releases page.
  2. Use one of various command line tools to install the package:
    1. APT
    sudo apt install /path/to/unishellect-2.0.1661201987.deb -y
    # -y to skip affirmation, not necessary
    1. DPKG
    sudo dpkg -i /path/to/unishellect-2.0.1661201987.deb
    1. GDEBI
    gdebi-gtk /path/to/unishellect-2.0.1661201987.deb
    # or
    sudo gdebi /path/to/unishellect-2.0.1661201987.deb
Deb Provides

The deb installer provides a few features (among providing a way to cleany install and uninstall all features):

Bash Completion

The Bash Completion File provides basic Bash completion for switches and parameters and is installed to /usr/share/bash-completion/completions/unishellect when installed with the deb package.

More infomation can be found here:

Bash Completion

HiColor Icon Theme

The deb package installer provide an icon theme for HiColor in case you want to make a .desktop shortcut or anything else. Icons are installed to /usr/share/icons/hicolor/{16,32,48,64,128,256}/apps/unishellect.png.

unishellect logo

Man Page Entry

The manual page is a more advanced verion of a Help Message and can be accessed from the command line via: man unishellect.

 $ man unishellect
NAME
       unishellect - Load a menu of shells/files from a provided JSON configuration file.

SYNOPSIS
       unishellect [OPTIONS [FILE]]...

DESCRIPTION
       Load a menu of shells/files from a provided JSON configuration file.

       The default configuration file is located in:
       $HOME/.config/UniShellect/unishellect.json in Linux and:
       %USERPROFILE%\.config\UniShellect\unishellect.json
       in Windows.

OPTIONS
       -h, --help
              This HELP message.

       -c, --config
              Load an alternate configuration FILE.

       -m, --monochrome
              All output is monochrome; no color.

EXAMPLES
       $      unishellect

       $      unishellect --help

       $      unishellect --monochrome

       $      unishellect --config ~/.config/UniShellect/<MY_ALTERNATE_CONFIG>.json

EXIT CODES
       0      No errors.

       1      Too many options passed to the program.

       2      Could not get the value of HOME from the environment.

       3      User cancelled/interrupted.

       4      No FILE/argument provided for the -c,–config OPTION.

       101    Error while parsing JSON in a config file.

       other  Any additional errors are related to opening and reading from the provided config file.

CONTACT
       Ian Pride (faithnomoread@yahoo.com)

       This Project ('https://github.com/Lateralus138/unishellectv2')

       GitHub ('https://github.com/Lateralus138')

       Twitter ('https://twitter.com/TheFluxApex')

AUTHORS
       Ian Pride.

unishellect - 2.0.1661201987                                                                                                                                           Mon 22 Aug 2022 08:59:47 PM UTC                                                                                                                                                        UNISHELLECT(1)

Portable

As with any executable file in most operating systems if this is not installed to $PATH (or %PATH% in Windows) then you must provide the full path when you run it. If it is in your $PATH then you can just run it with the file name.

 # In $PATH
 $ unsihellect --help
 # Not in $PATH
 $ /full/or/relative/path/to/unishellect --help
Portable Linux

You can use this portably by downloading the unishellect executable bin file from the releases page and putting it anywhere you like; most preferably in one of your $PATH (echo $PATH) directories.

Portable AppImage

The AppImage is essentially all the files provided in the deb install, but in a portable container. This version is not necessary, but provided for those who perfer containers. It is used in the exact same way as the portable Linux version.

The AppImage is essentially all the files provided in the deb install, but in a portable container. This version is not necessary, but provided for those who perfer containers. It is used in the exact same way as the portable Linux version.

Portable Android

The Android executables ( .aarch64) is portable and should probably be installed to /data/data/com.termux/files/usr/bin/unishellect (removing the extensions if you like). I plan to build a deb installer in the future.

Portable Windows

As with the other versions the Windows version is portable and can be placed where you place your portable programs. I personally tend to have a Bin folder either in C:\Windows\Bin or %USERPROFILE%\Bin (C:\Users\<USERNAME>\Bin) . This is up to your preference. Just like the other versions the same rules of %PATH% apply in Windows and if you have a Bin folder make sure it's in your %PATH% otherwise you need to supply the full path as usual.

Bash Completion File

Bash completion can be provided by placing the unishellect Bash completion file to /usr/share/bash-completion/completions. This is already done if installed with a package manager.

unishellect Bash Completion File:

unishellect_list=(
  -h --help
  -c --config
  -m --monochrome
)
complete -W "$(printf '%s\n' "${unishellect_list[@]}")" unishellect

Configuration File

This is the basis of the JSON configuration file:

{
   "Shells": [
      {
         "Title": "Example Title",
         "Path": "command_or_path_to_excutable",
         "Args": "-a 'Any additional arguments'"
      }
   ]
}

and can run any combination of path/command and arguments including unishellect itself to create subpoenas:

{
   "Shells": [
      {
         "Title": "Sub Menu 1",
         "Path": "unishellect",
         "Args": "-c '/path/to/config/menufile.1.json'"
      },
      {
         "Title": "Sub Menu 2",
         "Path": "unishellect",
         "Args": "-c '/path/to/config/menufile.2.json'"
      }
   ]
}

Current Builds MD5

This information is generated in a GitHub Action immediately after the successful build of this project.

Current Linux MD5

Linux MD5

Current Debian MD5

Debian MD5

Current Android AARCH64 MD5

Android AARCH64 MD5

Current AppImage MD5

APPIMAGE MD5

Current Windows X86 MD5

WINDOWS X86 MD5

Current Windows X64 MD5

WINDOWS X64 MD5


Examples

Help Screen

 $ unishellect --help
┌────────────────────────────────────────────────┐
│ UniShellect                                    │
├────────────────────────────────────────────────┤
│ USAGE: unishellect [OPTIONS [FILE]...]...      │
│ Load a menu of shells/files from a provided    │
│ JSON configuration file. The default is:       │
│ $HOME/.config/UniShellect/unishellect.json     │
│ in Linux and:                                  │
│ %USERPROFILE%\\.config\\UniShellect-           │
│ \\unishellect.json                             │
│ in Windows.                                    │
├────────────────────────────────────────────────┤
│ OPTIONS: switches and arguments                │
│   -h,--help       This HELP message.           │
│   -c,--config     Load an alternate config     │
│                   file.                        │
│   -m,--monochrome All output is monochrome;    │
│                   no color.                    │
├────────────────────────────────────────────────┤
│ Exit Codes: Error codes and their meanings.    │
│   0   No errors.                               │
│   1   Too many options passed to the           │
│       program.                                 │
│   2   Could not get the value of HOME from     │
│       the environment.                         │
│   3   User cancelled/interrupted.              │
│   4   No FILE/argument provided for the        │
│       -c,--config OPTION.                      │
│   101 Error while parsing JSON in a config     │
│       file.                                    │
│   *   Any additional errors are related to     │
│       opening and reading from the provided    │
│       config file.                             │
└────────────────────────────────────────────────┘

Normal Usage

Using the default configuration file unishellect.json located in %USERPROFILE%\.config\UniShellect\ in Windows or $HOME/.config/UniShellect/ everywhere else. You must create this directory and file.

 $ unshellect
[0] Python 3
[1] Apt Upgrade
[2] Update Locate Database
[3] Edit this menu
[4] Temp Screen
[5] Shutdown
[6] Bash
[7] Exit
Make your selection [0-7]: 0
>>> quit()
 $

Alternate Configuration File

 $ unishellect -c '/path/to/my/alternate/config/bash.json'
[0] Edit this menu
[1] Bash Functions - NeoVim
[2] Bash Aliases - NeoVim
[3] Bash Profile - NeoVim
[4] Bash RC - NeoVim
[5] Bash PWD - NeoVim
[6] Bash Completions - NeoVim
[7] Bash Colors - NeoVim
[8] Exit
Make your selection [0-8]: 8
Exiting UniShellect
 $

Media

Logo

LOGO

Help Screen

HELP SCREEN

Man Page

MAN PAGE

Demonstration

DEMONSTRATION


Contribute

Ways you can help if you like.

Project

You can fork this project, make your contributions, and make a pull-request.

Donate

If you like this project and care to donate to my PayPal:

PayPal Donation

Or Buy Me A Coffee if your prefer:

Buy Me A Coffee


Build Status And Project Information

Build Information

Last Workflow Build

Version Status

Name Status
Latest Release Release Version
Latest Downloads This Version Total Downloads
Total Downloads Total Downloads

CodeFactor

This score is with the exception of the json.h library which is not mine. It's large and could be done differently, but it's still a great library and I appreciate it and will still use it. I excluded it from the grade parsing as it is not my work anyway so I don't feel it reflects my actual work. The grade here reflects only code that I have personally written.

colorstatic Code

Attributions

I tend to write the large majority of my own code libraries, but with this project I used a well known JSON C++ library for which I am grateful.

Credit goes to nlohmann/json @ GitHub


License Info

License Excerpt
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.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

About

Load a menu of shells/files from a provided JSON configuration file. Version 2 - C++ rewrite.

Resources

License

Stars

Watchers

Forks

Packages

No packages published