Code Update
This commit is contained in:
		@@ -1,6 +1,21 @@
 | 
			
		||||
wx-header(){
 | 
			
		||||
    wx-start
 | 
			
		||||
    if [[ $2 == "h1" ]]
 | 
			
		||||
    then
 | 
			
		||||
        echo "=============================="
 | 
			
		||||
        wx-repeat " " $((30/2-${#1}/2))
 | 
			
		||||
        echo -n "$wxBold"
 | 
			
		||||
        echo -n "$1"
 | 
			
		||||
        echo -n "$wxNormal"
 | 
			
		||||
        echo ""
 | 
			
		||||
        echo "=============================="
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    echo ">> $1 <<"
 | 
			
		||||
    if [[ $2 == "h2" || -z $2 ]]
 | 
			
		||||
    then
 | 
			
		||||
        wx-start
 | 
			
		||||
        wx-repeat " " $((30/2-6/2-${#1}/2))
 | 
			
		||||
        echo -n ">> $1 <<"
 | 
			
		||||
        echo ""
 | 
			
		||||
        echo "------------------------------"
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								src/functions/repeat.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/functions/repeat.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
wx-repeat() {
 | 
			
		||||
    local str=$1 n=$2 spaces
 | 
			
		||||
    printf -v spaces "%*s" $n " "
 | 
			
		||||
    printf "%s" "${spaces// /$str}"
 | 
			
		||||
}
 | 
			
		||||
@@ -2,11 +2,7 @@ wx-start(){
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo "=============================="
 | 
			
		||||
    echo -n "$wxBold"
 | 
			
		||||
    echo "           Warén CLI          "
 | 
			
		||||
    echo -n "$wxNormal"
 | 
			
		||||
    echo "=============================="
 | 
			
		||||
    wx-header "Warén CLI" h1
 | 
			
		||||
 | 
			
		||||
    mkdir -p $HOME/.config/warengroup &> /dev/null
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								wx
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								wx
									
									
									
									
									
								
							@@ -20,10 +20,31 @@ wxNormal=$(tput sgr0)
 | 
			
		||||
declare -Ax config
 | 
			
		||||
 | 
			
		||||
wx-header(){
 | 
			
		||||
    wx-start
 | 
			
		||||
    if [[ $2 == "h1" ]]
 | 
			
		||||
    then
 | 
			
		||||
        echo "=============================="
 | 
			
		||||
        wx-repeat " " $((30/2-${#1}/2))
 | 
			
		||||
        echo -n "$wxBold"
 | 
			
		||||
        echo -n "$1"
 | 
			
		||||
        echo -n "$wxNormal"
 | 
			
		||||
        echo ""
 | 
			
		||||
        echo "=============================="
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    echo ">> $1 <<"
 | 
			
		||||
    if [[ $2 == "h2" || -z $2 ]]
 | 
			
		||||
    then
 | 
			
		||||
        wx-start
 | 
			
		||||
        wx-repeat " " $((30/2-6/2-${#1}/2))
 | 
			
		||||
        echo -n ">> $1 <<"
 | 
			
		||||
        echo ""
 | 
			
		||||
        echo "------------------------------"
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
wx-repeat() {
 | 
			
		||||
    local str=$1 n=$2 spaces
 | 
			
		||||
    printf -v spaces "%*s" $n " "
 | 
			
		||||
    printf "%s" "${spaces// /$str}"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
wx-restricted(){
 | 
			
		||||
@@ -41,11 +62,7 @@ wx-start(){
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo "=============================="
 | 
			
		||||
    echo -n "$wxBold"
 | 
			
		||||
    echo "           Warén CLI          "
 | 
			
		||||
    echo -n "$wxNormal"
 | 
			
		||||
    echo "=============================="
 | 
			
		||||
    wx-header "Warén CLI" h1
 | 
			
		||||
 | 
			
		||||
    mkdir -p $HOME/.config/warengroup &> /dev/null
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user