diff --git a/.gitignore b/.gitignore index 98bdfa3..2bad335 100644 --- a/.gitignore +++ b/.gitignore @@ -77,13 +77,8 @@ dist-ssr *.min.js # Log files -logs +..logs/ *.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* # Other Files to ignore **app_stat_v2.db diff --git a/README.md b/README.md index a8d7fd9..3ba099c 100755 --- a/README.md +++ b/README.md @@ -21,4 +21,3 @@ Example: bash ./bootstrap.sh -q --create-links I have multiple Linux installations on my machine. Linking it from one place (this repository) keeps things tidy. Also, changes to dotfiles automatically get applied to all the distros. - diff --git a/bootstrap.sh b/bootstrap.sh index d4f496e..d51184a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,19 +1,19 @@ #!/bin/sh usage() { - if [ -n "$1" ]; then - echo "" - echo -e "${CRED}$1${CEND}\n" - fi + if [ -n "$1" ]; then + echo "" + echo -e "${CRED}$1${CEND}\n" + fi - echo "Applies all settings stored in the script's directory to your home directory" - echo "" - echo "Usage: $0 [-q|--quiet] [-l|--create-links]" - echo " -q, --quiet No screen outputs" - echo " -l, --create-links Creates soft-links to files in the current directory instead of copying them" + echo "Applies all settings stored in the script's directory to your home directory" + echo "" + echo "Usage: $0 [-q|--quiet] [-l|--create-links]" + echo " -q, --quiet No screen outputs" + echo " -l, --create-links Creates soft-links to files in the current directory instead of copying them" - echo "" - echo "Example: $0 -q --create-links" + echo "" + echo "Example: $0 -q --create-links" } ################################## @@ -25,26 +25,26 @@ QUIET="n" CREATE_LINKS="n" while [[ "${#}" -gt 0 ]]; do - case $1 in - -q | --quiet) - QUIET="y" - shift - ;; - -l | --create-links) - CREATE_LINKS="y" - shift - ;; - -h | --help) - echo - usage - echo - exit 0 - ;; - *) - usage "Unknown parameter passed: $1" "h" - exit 1 - ;; - esac + case $1 in + -q | --quiet) + QUIET="y" + shift + ;; + -l | --create-links) + CREATE_LINKS="y" + shift + ;; + -h | --help) + echo + usage + echo + exit 0 + ;; + *) + usage "Unknown parameter passed: $1" "h" + exit 1 + ;; + esac done main() { diff --git a/common/.aliases b/common/.aliases index 3c50a12..95ba060 100644 --- a/common/.aliases +++ b/common/.aliases @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Generic alias sb="source ~/.bashrc" @@ -16,6 +16,7 @@ alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home alias untar='tar -zxvf ' alias v=nvim alias n=nvim +alias vim=nvim url_encode(){ python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1" @@ -58,7 +59,7 @@ alias p1="ping1" alias pubip="curl https://ipinfo.io/ip; echo" alias speedtest="speedtest-cli --secure" # needs speedtest-cli installed geoip () { - curl -s https://ipinfo.io | sed '/readme/d;/loc/d;/postal/d;s/org/ISP/' | tr -d {},\" | awk -F ':' 'NF {printf ("%10s: %.25s \n", $1, $2)}' + curl -s https://ipinfo.io | sed '/readme/d;/loc/d;/postal/d;s/org/ISP/' | tr -d {},\" | awk -F ':' 'NF {printf ("%10s: %.25s \n", $1, $2)}' } @@ -66,7 +67,7 @@ geoip () { # To use this - Ensure all git server SSH are in ~/.ssh alias git_signin='(for i in ~/.ssh/{*github*,*gitea*}; do ssh-add -k $i; done; ) && (echo; echo Identities added successfully)' git_push_all_changes(){ - git add . && git commit -am "${1}" && git push + git add . && git commit -am "${1}" && git push } diff --git a/common/.bashrc b/common/.bashrc index 156092b..6564342 100644 --- a/common/.bashrc +++ b/common/.bashrc @@ -5,7 +5,7 @@ # If not running interactively, don't do anything case $- in *i*) ;; - *) return;; + *) return ;; esac # append to the history file, don't overwrite it @@ -29,7 +29,7 @@ fi # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; + xterm-color|*-256color) color_prompt=yes ;; esac # uncomment for a colored prompt, if the terminal has the capability; turned @@ -39,12 +39,12 @@ esac if [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes else - color_prompt= + color_prompt= fi fi @@ -56,11 +56,11 @@ unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; + xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; + *) + ;; esac # enable color support of ls and also add handy aliases @@ -95,11 +95,11 @@ fi # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi fi ################################################################################ @@ -121,7 +121,7 @@ shopt -s nullglob shopt -s autocd function timer_start { - timer=${timer:-$SECONDS} + timer=${timer:-$SECONDS} } trap 'timer_start' DEBUG @@ -129,62 +129,62 @@ trap 'timer_start' DEBUG PROMPT_COMMAND=jazz_my_prompt jazz_my_prompt() { - # Capture exit code of last command - # Below MUST be the 1st line of the function - local ex=$? + # Capture exit code of last command + # Below MUST be the 1st line of the function + local ex=$? - # Capture the last command's execution time - timer_show=$(($SECONDS - $timer)) - unset timer + # Capture the last command's execution time + timer_show=$(($SECONDS - $timer)) + unset timer - #----------------------------------------------------------------------------# - # Bash text colour specification: \e[;