Library file | Function | Sections | Content | help file |
---|---|---|---|---|
bmtMisc | bmtMiscFunc | 801-806 | Miscellaneous | bmtMisc.md |
Section Eight , misc
- 801 Password generator
- 802 Get laptop battery level
- 803 Create a multi-line box with text inside it
- 804 Create a single line box with variable box character.
- 805 Centered text with variable banner character
- 806 Display gauge
Sub-Sections
- Password generator Generates a random password in passwordBMT.txt, returns 0 for success. Prompts user for length of password. Optional path can be added, if no path added file passed in /tmp/.
bmtMiscFunc password "/home/foo"
- Return laptop battery level
- Return 0-100 , % of battery remaining , 127 and 128 file errors
- Param 1 Battery name, BAT0 or BAT1 at /sys/class/power_supply
- Param 2 "MES" or blank , if exist print message
bmtMiscFunc getbatlevel "BAT0" "MES"
echo "$?"
- Create a multi-line box with text inside it
- Param1 color of box , tput setaf , 1 = red
- Param2 color of text , tput setaf , 2 = green
- The Rest of Params are the lines of text
bmtMiscFunc drawbox 1 2 'first line' 'second line' 'third line'
- Create a single line box with variable box character.
- Param 1 color of box, tput setaf 2=green
- Param 2 color of text , tput setaf 6=cyan
- Param 3 symbol to make the box lines out of.
- Param 4 text
bmtMiscFunc title 2 6 '#' 'hello'
- Centered text with option banner filler
- Param1 Text to center
- Param2 Banner symbol
bmtMiscFunc centertext "Hello World" =
- Display Gauge, display a gauge bar showing variable value
- Param1 Text label
- Param2 Value to display
- Param3 Minimum value of gauge
- Param4 Maximum value of gauge
- Param5 Gauge full symbol
- Param6 Gauge empty symbol
bmtMiscFunc gauge "Volts" 25 1 50 "#" "."