rungs


Namerungs JSON
Version 1.0.9 PyPI version JSON
download
home_page
SummaryMenu for Fuzzy Linux Procedures
upload_time2024-01-31 18:15:02
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords fuzzy maintenance menu procedure
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rungs -- A Tool for Fuzzy Procedures
`rungs` is a tool help navigate "fuzzy" procedures on Linux where you might want to:
* skip certain steps if certain vague criteria are met
* repeat certain steps if they failed and trying again makes sense

You very simply specify your procedures within a single `.ini` file.

> **Quick Start**: from the CLI
> * **If `python3 -V` shows v3.11 or later, install using `pipx`**:
>   * `python3 -m pip install --user pipx # if pipx not installed`
>   * `python3 -m pipx ensurepath # if needed (restart terminal)`
>   * `pipx upgrade rungs || pipx install rungs # to install/upgrade`
> * **Else for python3.10 and lesser versions, install using `pip`**:
>   * `python3 -m pip install --user --upgrade rungs`
> * **To run**:
>   * `rungs # to run and show all menus`
>   * `rungs {menu-name} # run the specified menu`
>   * `rungs --edit # edit your menus`

**Mnemonic**: step through the **rungs** of your laddered procedure ;-)

##  A Practical Example -- Manually Updating EndeavourOS
Here is an example menu for manually update an EndeavourOS:

![eos-update-menu](https://github.com/joedefen/rungs/blob/main/images/eos-update-menu.png?raw=true)

Notes:
* Except for the first personal command, all commands are standard on EndeavourOS.
* All commands are run literally by `bash` except:
  * `exit` which means exit the menu.
  * `rungs {menu-name}` runs rungs recursively using `python3`
* To run a command:
  * highlight the command by typing the "key" before the ':' or move the cursor with the up/down arrow keys.
  * then press ENTER.
* After the command runs, the next command is highlighted and runs with just ENTER if desired.
* To, repeat and skip commands, just select another command rather than the next.
* **IMPORTANT: If the menu does not fit within your terminal, then resize until it does fit.**

## `rungs` Config: `~/.config/rungs/rungs.ini`
Edit `~/.config/rungs/rungs.ini` to configure your menu. The "eos-update-menu" was configured by adding this section:
```
[eos-update]
a: my-snaps               # replace snaps of root, home, etc 
b: sudo reflector -l20 -cus,ca --sort rate --save /etc/pacman.d/mirrorlist
c: eos-rankmirrors        # update EndeavourOS mirrors
d: eos-update --yay       # EndeavourOS update script
e: sudo paccache -rk1; sudo paccache -ruk0 # cleanup cache
f: sudo pacman -Rns $(pacman -Qdtq)        # cleanup orphans
g: flatpak update
h: flatpak uninstall --unused; flatpak repair
i: sudo journalctl --vacuum-time=2weeks
j: sudo reboot now
x: exit
```
So, the config looks nearly the same as the menu, but if you specify a multiline value, then:
* the first line is shown, and
* the subsequent lines are given to bash literally.

In this manner, for very complicated commands, you can provide a summary description of what is to be run.

Additionally:
* keys must be a single character and unique
* if you specify an multicharacter key, only the lead character is used in the menu

## `rungs` Command Line
```
usage: rungs [-h] [-e] [-n] [menus ...]

positional arguments:
  menus          zero or more arguments

options:
  -h, --help     show this help message and exit
  -e, --edit     edit config (i.e., runs edit-rungs-config)
  -n, --dry-run  show commands w/o running them
```
Thus, you can:
* run `rungs --edit` to edit the configuration file.
* run `rungs` with no arguments to given a menu of all the "ordinary" menus.
* provide the name specifiers of the menus to run them; each name spec can match:
  * exactly,
  * case independent exactly (if unique and ordinary),
  * or case independent substring match but only at word boundaries (if unique and ordinary); e.g., for the menus, `['edit-rungs-config', 'example', 'eos-update']`:
    * these name specs would find a menu:  'edit', 'ex', 'EOS-', 'EOS-UPDATE'
    * these name specs would NOT: 'date', 'e'.
    
**"Special" (vs "Ordinary")** menu names begin with character other than [_A-Za-z0-9], and are excluded from being run unless given the whole, exact, memory sensitive name. A suggested naming convention for menus:
* beginning `>` for a sub-menu that should not be called independently
* beginning `!` for a deprecated menu (but not ready to remove it)
    
## The Edit Menu and Handling Corrupt .ini Files
On first startup, the .ini file contains a menu for editing that you may customize:
```
[edit-rungs-config]
a: ${EDITOR=-vi} ~/.config/rungs/rungs.ini
x: exit

[example]
a: command-a
b: prompt-b
   command-b
x: exit
```
For example, you might change the default from `vi` to `geany` if installed and desired. Also, note:
* You may remove the `example` which shows a multilined value which must be indented lines after the first.
* Do **NOT** remove the `edit-rungs-config` menu; it is needed for `--edit` option AND recovery.
* The `edit-rungs-config` shows how to pass variables to your commands.
* In case of a corrupt `.ini`, you will see the error and the `edit-rungs-config` menu.
* Each time the `.ini` file is read and valid, `~/.config/rungs/rungs.ini.bak` is written; in the case you just made a terrible change, recover using the `.ini.bak` file manually (w/o running `rungs -e`).

## Practical Examples
The `examples` subdirectory includes more practical examples, including
* A two-level menu for Fedora updates and release upgrades.

These menus many not be current and are not tested; use only after reviewing for correctness and completeness.



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "rungs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "fuzzy,maintenance,menu,procedure",
    "author": "",
    "author_email": "Joe Defen <joedef@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/bd/21/5b66aa84909e300908b547302251239a0fddd43117c78b3e5b9cecf7ac39/rungs-1.0.9.tar.gz",
    "platform": null,
    "description": "# rungs -- A Tool for Fuzzy Procedures\n`rungs` is a tool help navigate \"fuzzy\" procedures on Linux where you might want to:\n* skip certain steps if certain vague criteria are met\n* repeat certain steps if they failed and trying again makes sense\n\nYou very simply specify your procedures within a single `.ini` file.\n\n> **Quick Start**: from the CLI\n> * **If `python3 -V` shows v3.11 or later, install using `pipx`**:\n>   * `python3 -m pip install --user pipx # if pipx not installed`\n>   * `python3 -m pipx ensurepath # if needed (restart terminal)`\n>   * `pipx upgrade rungs || pipx install rungs # to install/upgrade`\n> * **Else for python3.10 and lesser versions, install using `pip`**:\n>   * `python3 -m pip install --user --upgrade rungs`\n> * **To run**:\n>   * `rungs # to run and show all menus`\n>   * `rungs {menu-name} # run the specified menu`\n>   * `rungs --edit # edit your menus`\n\n**Mnemonic**: step through the **rungs** of your laddered procedure ;-)\n\n##  A Practical Example -- Manually Updating EndeavourOS\nHere is an example menu for manually update an EndeavourOS:\n\n![eos-update-menu](https://github.com/joedefen/rungs/blob/main/images/eos-update-menu.png?raw=true)\n\nNotes:\n* Except for the first personal command, all commands are standard on EndeavourOS.\n* All commands are run literally by `bash` except:\n  * `exit` which means exit the menu.\n  * `rungs {menu-name}` runs rungs recursively using `python3`\n* To run a command:\n  * highlight the command by typing the \"key\" before the ':' or move the cursor with the up/down arrow keys.\n  * then press ENTER.\n* After the command runs, the next command is highlighted and runs with just ENTER if desired.\n* To, repeat and skip commands, just select another command rather than the next.\n* **IMPORTANT: If the menu does not fit within your terminal, then resize until it does fit.**\n\n## `rungs` Config: `~/.config/rungs/rungs.ini`\nEdit `~/.config/rungs/rungs.ini` to configure your menu. The \"eos-update-menu\" was configured by adding this section:\n```\n[eos-update]\na: my-snaps               # replace snaps of root, home, etc \nb: sudo reflector -l20 -cus,ca --sort rate --save /etc/pacman.d/mirrorlist\nc: eos-rankmirrors        # update EndeavourOS mirrors\nd: eos-update --yay       # EndeavourOS update script\ne: sudo paccache -rk1; sudo paccache -ruk0 # cleanup cache\nf: sudo pacman -Rns $(pacman -Qdtq)        # cleanup orphans\ng: flatpak update\nh: flatpak uninstall --unused; flatpak repair\ni: sudo journalctl --vacuum-time=2weeks\nj: sudo reboot now\nx: exit\n```\nSo, the config looks nearly the same as the menu, but if you specify a multiline value, then:\n* the first line is shown, and\n* the subsequent lines are given to bash literally.\n\nIn this manner, for very complicated commands, you can provide a summary description of what is to be run.\n\nAdditionally:\n* keys must be a single character and unique\n* if you specify an multicharacter key, only the lead character is used in the menu\n\n## `rungs` Command Line\n```\nusage: rungs [-h] [-e] [-n] [menus ...]\n\npositional arguments:\n  menus          zero or more arguments\n\noptions:\n  -h, --help     show this help message and exit\n  -e, --edit     edit config (i.e., runs edit-rungs-config)\n  -n, --dry-run  show commands w/o running them\n```\nThus, you can:\n* run `rungs --edit` to edit the configuration file.\n* run `rungs` with no arguments to given a menu of all the \"ordinary\" menus.\n* provide the name specifiers of the menus to run them; each name spec can match:\n  * exactly,\n  * case independent exactly (if unique and ordinary),\n  * or case independent substring match but only at word boundaries (if unique and ordinary); e.g., for the menus, `['edit-rungs-config', 'example', 'eos-update']`:\n    * these name specs would find a menu:  'edit', 'ex', 'EOS-', 'EOS-UPDATE'\n    * these name specs would NOT: 'date', 'e'.\n    \n**\"Special\" (vs \"Ordinary\")** menu names begin with character other than [_A-Za-z0-9], and are excluded from being run unless given the whole, exact, memory sensitive name. A suggested naming convention for menus:\n* beginning `>` for a sub-menu that should not be called independently\n* beginning `!` for a deprecated menu (but not ready to remove it)\n    \n## The Edit Menu and Handling Corrupt .ini Files\nOn first startup, the .ini file contains a menu for editing that you may customize:\n```\n[edit-rungs-config]\na: ${EDITOR=-vi} ~/.config/rungs/rungs.ini\nx: exit\n\n[example]\na: command-a\nb: prompt-b\n   command-b\nx: exit\n```\nFor example, you might change the default from `vi` to `geany` if installed and desired. Also, note:\n* You may remove the `example` which shows a multilined value which must be indented lines after the first.\n* Do **NOT** remove the `edit-rungs-config` menu; it is needed for `--edit` option AND recovery.\n* The `edit-rungs-config` shows how to pass variables to your commands.\n* In case of a corrupt `.ini`, you will see the error and the `edit-rungs-config` menu.\n* Each time the `.ini` file is read and valid, `~/.config/rungs/rungs.ini.bak` is written; in the case you just made a terrible change, recover using the `.ini.bak` file manually (w/o running `rungs -e`).\n\n## Practical Examples\nThe `examples` subdirectory includes more practical examples, including\n* A two-level menu for Fedora updates and release upgrades.\n\nThese menus many not be current and are not tested; use only after reviewing for correctness and completeness.\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Menu for Fuzzy Linux Procedures",
    "version": "1.0.9",
    "project_urls": {
        "Bug Tracker": "https://github.com/joedefen/rungs/issues",
        "Homepage": "https://github.com/joedefen/rungs"
    },
    "split_keywords": [
        "fuzzy",
        "maintenance",
        "menu",
        "procedure"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c9279b7af4b6ecfb12e7918f08ec95343686d34a65bdac5fb46939c1abf9ef0",
                "md5": "25b643f9227393cd8759a39dfe7aa6fd",
                "sha256": "db99b51e95d93deda324711f80484cc5df895e045a03e19df213697bc2bae4a1"
            },
            "downloads": -1,
            "filename": "rungs-1.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "25b643f9227393cd8759a39dfe7aa6fd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10886,
            "upload_time": "2024-01-31T18:15:01",
            "upload_time_iso_8601": "2024-01-31T18:15:01.166501Z",
            "url": "https://files.pythonhosted.org/packages/6c/92/79b7af4b6ecfb12e7918f08ec95343686d34a65bdac5fb46939c1abf9ef0/rungs-1.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd215b66aa84909e300908b547302251239a0fddd43117c78b3e5b9cecf7ac39",
                "md5": "dfefe19c72cba5d9577e820fdb3be8e7",
                "sha256": "f6f954834398d8b6d4e05c9ddecce2b953460ebb9bebdcd7e8189a3af606e141"
            },
            "downloads": -1,
            "filename": "rungs-1.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "dfefe19c72cba5d9577e820fdb3be8e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 58206,
            "upload_time": "2024-01-31T18:15:02",
            "upload_time_iso_8601": "2024-01-31T18:15:02.452223Z",
            "url": "https://files.pythonhosted.org/packages/bd/21/5b66aa84909e300908b547302251239a0fddd43117c78b3e5b9cecf7ac39/rungs-1.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 18:15:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "joedefen",
    "github_project": "rungs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "rungs"
}
        
Elapsed time: 0.20380s