Compare commits
No commits in common. "af4807ed971484b036407a2ce585d31ee72f22e4" and "c2c0a11402f12ee09009447c0530d41c28902ee4" have entirely different histories.
af4807ed97
...
c2c0a11402
@ -1,8 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -f "$HOME"/.nix-profile/etc/profile.d/hm-session-vars.sh ]; then
|
source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||||
source "$HOME"/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$HOME"/.bash/profile ]; then source "$HOME"/.bash/profile; fi
|
if [ -f "$HOME"/.bash/profile ]; then source "$HOME"/.bash/profile; fi
|
||||||
if [ -d "$HOME"/.bash/profile ]; then for file in "$HOME"/.bash/profile/*; do source "$file"; done; fi
|
if [ -d "$HOME"/.bash/profile ]; then for file in "$HOME"/.bash/profile/*; do source "$file"; done; fi
|
||||||
|
142
libs/colors.bash
142
libs/colors.bash
@ -1,80 +1,94 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#ANSI CODES
|
#ANSI CODES
|
||||||
#Code Effect
|
#Code Effect
|
||||||
#0 All attributes off
|
#0 All attributes off
|
||||||
#1 Bold
|
#1 Bold
|
||||||
#2 Faint
|
#2 Faint
|
||||||
#3 Italic
|
#3 Italic
|
||||||
#4 Underline
|
#4 Underline
|
||||||
#5 Blink
|
#5 Blink
|
||||||
#6 Rapid blink
|
#6 Rapid blink
|
||||||
#7 Reverse video
|
#7 Reverse video
|
||||||
#8 Concealed
|
#8 Concealed
|
||||||
#30 Black foreground
|
#30 Black foreground
|
||||||
#31 Red foreground
|
#31 Red foreground
|
||||||
#32 Green foreground
|
#32 Green foreground
|
||||||
#33 Yellow foreground
|
#33 Yellow foreground
|
||||||
#34 Blue foreground
|
#34 Blue foreground
|
||||||
#35 Magenta foreground
|
#35 Magenta foreground
|
||||||
#36 Cyan foreground
|
#36 Cyan foreground
|
||||||
#37 White foreground
|
#37 White foreground
|
||||||
#40 Black background
|
#40 Black background
|
||||||
#41 Red background
|
#41 Red background
|
||||||
#42 Green background
|
#42 Green background
|
||||||
#43 Yellow background
|
#43 Yellow background
|
||||||
#44 Blue background
|
#44 Blue background
|
||||||
#45 Magenta background
|
#45 Magenta background
|
||||||
#46 Cyan background
|
#46 Cyan background
|
||||||
#47 White background
|
#47 White background
|
||||||
#48 Subscript
|
#48 Subscript
|
||||||
#49 Superscript
|
#49 Superscript
|
||||||
|
|
||||||
#bold_on=`escape 1m`
|
#T_ROWS=`tput lines` # Define current terminal dimension
|
||||||
#bold_off=`escape 22m`
|
|
||||||
#blink_on=`escape 5m`
|
|
||||||
#blink_off=`escape 25m`
|
|
||||||
#reset=`escape 0m`
|
|
||||||
|
|
||||||
#T_ROWS=`tput lines` # Define current terminal dimension
|
|
||||||
#T_COLS=`tput cols` #+ in rows and columns.
|
#T_COLS=`tput cols` #+ in rows and columns.
|
||||||
#_UNDERLINE_ON=`tput smul` # turn on underline
|
#_UNDERLINE_ON=`tput smul` # turn on underline
|
||||||
#_UNDERLINE_OFF=`tput rmul` # turn off underline
|
#_UNDERLINE_OFF=`tput rmul` # turn off underline
|
||||||
#tput setf 4 # tput setf {fg color number}
|
#tput setf 4 # tput setf {fg color number}
|
||||||
#tput setb 2 # tput setb {bg color number}
|
#tput setb 2 # tput setb {bg color number}
|
||||||
|
|
||||||
#tput bold - Bold effect
|
#tput bold - Bold effect
|
||||||
#tput tsmi - Italic
|
#tput tsmi - Italic
|
||||||
#tput rev - Display inverse colors
|
#tput rev - Display inverse colors
|
||||||
#tput sgr0 - Reset everything
|
#tput sgr0 - Reset everything
|
||||||
|
|
||||||
# Affiche un message stylisé sur la sortie standard
|
default='\E[39;49;00m'
|
||||||
function echo_bold { echo -e "\e[1m${*}\e[0m"; }
|
bold='\E[1m'
|
||||||
function echo_faint { echo -e "\e[2m${*}\e[0m"; }
|
italic='\E[3m'
|
||||||
function echo_italic { echo -e "\e[3m${*}\e[0m"; }
|
underline='\E[4m'
|
||||||
function echo_underline { echo -e "\e[4m${*}\e[0m"; }
|
blink='\E[5m'
|
||||||
function echo_blink { echo -e "\e[5m${*}\e[0m"; }
|
|
||||||
function echo_reverse { echo -e "\e[7m${*}\e[0m"; }
|
|
||||||
function echo_concealed { echo -e "\e[8m${*}\e[0m"; }
|
|
||||||
|
|
||||||
# Affiche un message informatif stylisé sur la sortie d'erreur
|
blackonwhite='\E[30;47m'
|
||||||
function echo_info { >&2 echo -e "\e[00;34;49m ${*}\e[39;49;00m"; }
|
|
||||||
function echo_warning { >&2 echo -e "\e[00;33;49m ${*}\e[39;49;00m"; }
|
|
||||||
function echo_error { >&2 echo -e "\e[00;01;31;49m ${*}\e[39;49;00m"; }
|
|
||||||
function echo_success { >&2 echo -e "\e[00;01;32;49m ${*}\e[39;49;00m"; }
|
|
||||||
function echo_failed { >&2 echo -e "\e[00;01;31;49m✖ ${*}\e[39;49;00m"; }
|
|
||||||
|
|
||||||
function echo_demo {
|
#reset=`escape 0m`
|
||||||
echo_bold bold
|
#black='\E[30;47m'
|
||||||
echo_faint faint
|
#red='\E[31;47m'
|
||||||
echo_italic italic
|
#green='\E[32;47m'
|
||||||
echo_underline underline
|
#yellow='\E[33;47m'
|
||||||
echo_blink blink
|
#blue='\E[34;47m'
|
||||||
echo_reverse reverse
|
#magenta='\E[35;47m'
|
||||||
echo_concealed concealed
|
#cyan='\E[36;47m'
|
||||||
echo_info info
|
#white='\E[37;47m'
|
||||||
echo_warning warning
|
#bold_on=`escape 1m`
|
||||||
echo_error error
|
#bold_off=`escape 22m`
|
||||||
echo_success success
|
#blink_on=`escape 5m`
|
||||||
echo_failed failed
|
#blink_off=`escape 25m`
|
||||||
|
|
||||||
|
|
||||||
|
function echo_reverse
|
||||||
|
{
|
||||||
|
echo -ne $blackonwhite
|
||||||
|
echo -ne "$*"
|
||||||
|
echo -e $default
|
||||||
|
}
|
||||||
|
|
||||||
|
function echo_italic
|
||||||
|
{
|
||||||
|
echo -ne $italic
|
||||||
|
echo -ne "$*"
|
||||||
|
echo -e $default
|
||||||
|
}
|
||||||
|
|
||||||
|
function echo_bold
|
||||||
|
{
|
||||||
|
echo -ne $bold
|
||||||
|
echo -ne "$*"
|
||||||
|
echo -e $default
|
||||||
|
}
|
||||||
|
|
||||||
|
function echo_underline
|
||||||
|
{
|
||||||
|
echo -ne $underline
|
||||||
|
echo -ne "$*"
|
||||||
|
echo -e $default
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user