cleaning qolop

This commit is contained in:
ville rantanen
2018-10-23 13:58:40 +03:00
parent 5267e9ba2a
commit 608aac1871

View File

@@ -1,5 +1,5 @@
#!/bin/bash
_qColVersion() { echo Version 2017.08.20.0; }
_qColVersion() { echo Version 2018.10.23.0; }
_qColHelp() {
_qColVersion
@@ -19,7 +19,7 @@ Examples:
- As functions:
_title(){ _qClr; _qCol z G; echo "$@"; _qCol z; }
_text(){ _qCol z; _qCode 1 34; echo "$@"; _qCol z; }
_title Title; _text Colored;
_title Title; _text Colored;
- As variables
TITLE=$( _qCol z G; )
@@ -45,14 +45,14 @@ _qCol() {
local C="\033[1;36m"
local W="\033[1;37m"
local k="\033[0;30m"
local r="\033[0;31m"
local g="\033[0;32m"
local b="\033[0;34m"
local y="\033[0;33m"
local m="\033[0;35m"
local c="\033[0;36m"
local w="\033[0;37m"
local k="\033[2;30m"
local r="\033[2;31m"
local g="\033[2;32m"
local b="\033[2;34m"
local y="\033[2;33m"
local m="\033[2;35m"
local c="\033[2;36m"
local w="\033[2;37m"
local bk="\033[40m"
local br="\033[41m"
@@ -152,7 +152,7 @@ if [[ "$0" = "${BASH_SOURCE[0]}" ]]; then
if [[ -f "$MYDIR/../rc" ]]; then if grep -q QTOOLS "$MYDIR/../rc"; then
QTOOLS=1
fi;fi;
if [[ "$QTOOLS" -eq 1 ]]; then
if [[ "$QTOOLS" -eq 1 ]]; then
echo "Update qolop with _q-tools-update"
exit 1
fi
@@ -176,31 +176,31 @@ if [[ "$0" = "${BASH_SOURCE[0]}" ]]; then
_qCol export "_"
printf "${_S}ANSI CODES AND QOLOP VARIABLES
==============================${_Z}
${_R}Co${_G}lo${_B}rs${_W} and ${_S}Mo${_U}di${_st}fi${_u}er${_ic}s${_Z} ESC[Xm or ESC[X;Y;Zm
${_R}Co${_G}lo${_B}rs${_W} and ${_S}Mo${_U}di${_st}fi${_u}er${_ic}s${_Z} \\\033[Xm or \\\033[X;Y;Zm
${_S}====================${_Z}
0 z Z Clear format
1 S ${_S}Strong/Bold ${_Z} 30 k ${_k}Black ${_Z}1 K ${_K}Black ${_Z}40 bk ${_w}${_bk}Black ${_Z}
2 s ${_s}Weak/Bold off ${_Z} 31 r ${_r}Red ${_Z}1 R ${_R}Red ${_Z}41 br ${_k}${_br}Red ${_Z}
4 U ${_U}Underline ${_Z} 32 g ${_g}Green ${_Z}1 G ${_G}Green ${_Z}42 bg ${_k}${_bg}Green ${_Z}
24 u ${_u}Underline off ${_Z} 33 y ${_y}Yellow ${_Z}1 Y ${_Y}Yellow ${_Z}43 by ${_k}${_by}Yellow ${_Z}
7 ic ${_ic}Inverse color ${_Z} 34 b ${_b}Blue ${_Z}1 B ${_B}Blue ${_Z}44 bb ${_k}${_bb}Blue ${_Z}
27 of ${_io}Inverse off ${_Z} 35 m ${_m}Magenta ${_Z}1 M ${_M}Magenta ${_Z}45 bm ${_k}${_bm}Magenta ${_Z}
9 st ${_st}Strike ${_Z} 36 c ${_c}Cyan ${_Z}1 C ${_C}Cyan ${_Z}46 bc ${_k}${_bc}Cyan ${_Z}
29 so ${_so}Strike off ${_Z} 37 w ${_w}White ${_Z}1 W ${_W}White ${_Z}47 bw ${_k}${_bw}White ${_Z}
0 z Z Clear format
1 S ${_S}Strong/Bold ${_Z} 30 k ${_k}Black ${_Z}30;1 K ${_K}Black ${_Z}40 bk ${_w}${_bk}Black ${_Z}
2 s ${_s}Weak/Bold off ${_Z} 31 r ${_r}Red ${_Z}31;1 R ${_R}Red ${_Z}41 br ${_k}${_br}Red ${_Z}
4 U ${_U}Underline ${_Z} 32 g ${_g}Green ${_Z}32;1 G ${_G}Green ${_Z}42 bg ${_k}${_bg}Green ${_Z}
24 u ${_u}Underline off ${_Z} 33 y ${_y}Yellow ${_Z}33;1 Y ${_Y}Yellow ${_Z}43 by ${_k}${_by}Yellow ${_Z}
7 ic ${_ic}Inverse color ${_Z} 34 b ${_b}Blue ${_Z}34;1 B ${_B}Blue ${_Z}44 bb ${_k}${_bb}Blue ${_Z}
27 of ${_io}Inverse off ${_Z} 35 m ${_m}Magenta ${_Z}35;1 M ${_M}Magenta ${_Z}45 bm ${_k}${_bm}Magenta ${_Z}
9 st ${_st}Strike ${_Z} 36 c ${_c}Cyan ${_Z}36;1 C ${_C}Cyan ${_Z}46 bc ${_k}${_bc}Cyan ${_Z}
29 so ${_so}Strike off ${_Z} 37 w ${_w}White ${_Z}37;1 W ${_W}White ${_Z}47 bw ${_k}${_bw}White ${_Z}
Enter raw color code sequence with _qCode function
${_S}Clearing and movement${_Z} ESC[X or ESC[1X
${_S}=====================${_Z}
2J CLR Clear screen
2J CLR Clear screen
2J ;H CLRSCR _qClr() Clear screen, move cursor to origo
K CLREND Clear to end of line
1K CLRBEG Clear to beginning of line
_qReset() Reset terminal
s _qPos save Save location u _qPos restore Restore location
A _qPos up Up E _qPos lineup Up line
B _qPos down Down F _qPos linedown Down line
C _qPos left Left y;xH _qPos abs y x Absolute Position
D _qPos right Right
A _qPos up Up E _qPos lineup Up line
B _qPos down Down F _qPos linedown Down line
C _qPos left Left y;xH _qPos abs y x Absolute Position
D _qPos right Right
"
fi