/psone

A funny utility to manage your PS1 variable.

Primary LanguageGoApache License 2.0Apache-2.0

PSOne

psone_icon

Introduction

Are you a Veteran Unix Admin? If so, you probably know the charm of the PS1 environment variable.

For a deep focus I suggest you to take a look at this: https://en.wikipedia.org/wiki/Command-line_interface#Command_prompt.

Why

The main reason why I decided to implement this utility is my fetishism for PS1. I like to customize this and change it for the right occasion, like to wear an elegant dress for your birthday 😄.

How

The psone utility help you to manage different PS1 storing them to a config file (~/.psone.yaml).

Whenever you want, you can add, remove, set, or get them. Once you set your favourite PS1, to apply your modification, just source ~/.bashrc.

Examples

Fist of all, you need to generate your own ~/.psone.yaml file. Here's an example of it:

psones:
  default:
    value: "[\\u@\\h \\W]\\$ "
  halloween:
    value: "[\\u@\\h] 🎃👻🦇 > \\[$(tput sgr0)\\]"
  christmas:
    value: "[\\u@\\h] 🎅🎄❄️ \\[\\]"

Once you got your config file, you are ready to set your custom PS1.

psone set halloween && source ~/.bashrc

This is going to be your result: [user@laptop] 🎃👻🦇 > .

Then, if you want to add a new one (the easter one):

psone add "easter" "[\\u@\\h] 🐇🥚 \\[\\]"

Here's the new updated PS1s list:

psone get
psones:
  default:
    value: "[\u@\h \W]\$ "
  easter:
    value: "[\u@\h] 🐇🥚 \[\]"
  halloween:
    value: "[\u@\h] 🎃👻🦇 > \[$(tput sgr0)\]"
  christmas:
    value: "[\u@\h] 🎅🎄❄️ \[\]"

That's it.

For more information, just type: psone help.

Installation

Just type the following command:

make

or alternatively download the latest release from here: https://github.com/alegrey91/psone/releases

Contributions

Of course, contributions are very welcome!