mothers-little-helpers

Mothers Little Helpers

Disclaimer

This repository is provided to you in the hope that it will be helpful, but everything comes without any warranty and the owner of this repository is in no way responsible for any kind of harm, even if your cat dies while using one or more or all of these files.

Note to self:
People may clone it, tweak it, and never give aBut hey – at least my code gets to travel the world.

Licence

Some of the scripts may have their own license, if not, the MIT license applies.

Usage

Copy the desired files into a dedicated directory where zsh can find it (e.g. ~/.config/zsh/plugins or ~/zsh/plugins; any directory in your fpath will be fine). Then (re)start zsh and the functions resp. scripts should be available on your system.

If you use any kind of framework, please refer to their documentation to find out the proper directory and possible difficulties.

Tips & Tricks

Functions

More information and how to use shell functions can be found here.

  • allcolors – shows the escape sequences for allmost all colors in the terminal
  • colornames – shows the escape sequences and names for some colors in the terminal
  • command-not-found – ‘command not found’ script for zsh/bash/fish (should be used as a function). Due to the Fish syntax, a parser error occurs when the Fish hook is active. Therefore, it is commented out in the script.
  • chpwd – auto-ls after each directory change (zsh only)
  • temp_conv – Script to convert temperature values (Celsius, Fahrenheit, Kelvin). The output includes joules and electron volts. You will be asked to enter the value you want to convert and will receive all conversions as a result.
Details for temp_conv

You will be prompted for nessecary input and the output is colored. If you want to have background information type `absolute_zero` at the command line and press enter (you don’t have to run the script for this function, but it is available while using the converter).
For conversion type `temp_conv` at the command line, press Enter and use one of the following options (case insensitive):

Command Option Purpose
temp_conv C for Celsius -> Fahrenheit -> Kelvin -> Joule -> Electron Volt conversion
temp_conv F for Fahrenheit -> Celsius -> Kelvin -> Joule -> Electron Volt conversion
temp_conv K for Kelvin -> Celsius -> Fahrenheit -> Joule -> Electron Volt conversion
absolute_zero further information about the Third Law of Thermodynamics and more…

For example, if you have a temperature in Fahrenheit and want to convert it to Kelvin, you need to run the script and enter “f” (or “F”, it doesn’t matter) when prompted and press Enter. The following prompt looks like this:

Please enter a value for Fahrenheit:

Enter a value (e.g. 100) and receive the output presenting the results. It looks like this:

The conversion formula is (100°F − 32) × 5/9 and gives 37.7778°C, which is 310.928 Kelvin, 4.29283e-21 Joules and 3.60816e+06 eV.

  • title – show command in window title bar (zsh only)
  • topcmd – display frequently used commands of the current shell session or the entire command history.
  • checkport – Tiny function for zsh that shows which processes are listening or communicating on which TCP ports. It determines whether the system language is German. If this is the case, the output is in German, otherwise in English.
  • zsh_wifi_signal – Check whether wlan0 is connected (despite the name it should work in Bash)

Scripts

  • zramswap – install a compressed swapfile in RAM
  • shlt – measure loading time of the shell
  • zprofiler – profiling of the Z shell with instructions for configuration, if necessary
  • zrecompile – compile functions and dot-files, if necessary (zsh only)
  • PS4-demo – demonstrate the functionality of the PS4 prompt variable
  • what_shell – show the (sub-)shell that is currently used. usage: source what_shell (the file should live somewhere in your $PATH)
  • progress bar – a progress bar purely written as a shell script

Information tools for command line

  • screenFetch – The Bash Screenshot Information Tool
  • Neofetch – command-line system information tool

Visit original content creator repository

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *