Skip to content

Instantly share code, notes, and snippets.

@CompeyDev
Forked from 4x8Matrix/.bashrc
Created August 12, 2023 16:44
Show Gist options
  • Select an option

  • Save CompeyDev/0e21253fecc47e25e991462c2cada4d1 to your computer and use it in GitHub Desktop.

Select an option

Save CompeyDev/0e21253fecc47e25e991462c2cada4d1 to your computer and use it in GitHub Desktop.

Revisions

  1. @4x8Matrix 4x8Matrix revised this gist Nov 25, 2022. 1 changed file with 19 additions and 22 deletions.
    41 changes: 19 additions & 22 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -56,26 +56,22 @@ function _parse_git_branch() {
    fi
    }

    ## TERMINAL
    NOCOLOR="\033[0m"
    INFO_COLOR='\033[1;34m'
    PROMPT_COLOR='\033[1;32m'
    PROMPT_SYMBOL=@

    if [ "$EUID" -eq 0 ]; then
    INFO_COLOR='\033[1;31m'
    PROMPT_COLOR='\033[;94m'
    fi

    PS1="${PROMPT_COLOR}┌──${debian_chroot:+($debian_chroot)──}${VIRTUAL_ENV:+(\[\033[0;1m\]$(basename $VIRTUAL_ENV)${PROMPT_COLOR})}(${INFO_COLOR}\u${PROMPT_SYMBOL}\h${PROMPT_COLOR})$(_parse_git_branch)${PROMPT_COLOR}-[\[\033[0;1m\]\w${PROMPT_COLOR}]\n${PROMPT_COLOR}└─${INFO_COLOR}\$\[\033[0m\] "
    PS2='\[${DARKGRAY}\]>\[${NOCOLOR}\] '
    PS3='Number: '
    PS4='\[${DARKGRAY}\]+\[${NOCOLOR}\] '

    unset NOCOLOR
    unset INFO_COLOR
    unset PROMPT_COLOR
    unset PROMPT_SYMBOL
    function _setprompt {
    local NOCOLOR="\033[0m"
    local INFO_COLOR='\033[1;34m'
    local PROMPT_COLOR='\033[1;32m'
    local PROMPT_SYMBOL=@

    if [ "$EUID" -eq 0 ]; then
    local INFO_COLOR='\033[1;31m'
    local PROMPT_COLOR='\033[;94m'
    fi

    PS1="${PROMPT_COLOR}┌──${debian_chroot:+($debian_chroot)──}${VIRTUAL_ENV:+(\[\033[0;1m\]$(basename $VIRTUAL_ENV)${PROMPT_COLOR})}(${INFO_COLOR}\u${PROMPT_SYMBOL}\h${PROMPT_COLOR})$(_parse_git_branch)${PROMPT_COLOR}-[\[\033[0;1m\]\w${PROMPT_COLOR}]\n${PROMPT_COLOR}└─${INFO_COLOR}\$\[\033[0m\] "
    PS2='\[${DARKGRAY}\]>\[${NOCOLOR}\] '
    PS3='Number: '
    PS4='\[${DARKGRAY}\]+\[${NOCOLOR}\] '
    }

    ## BLE-CONFIG
    bleopt pager=less
    @@ -92,5 +88,6 @@ ble-color-setface auto_complete fg=white,bg=69
    ble-color-setface auto_complete fg=240,underline,itali

    ## INIT
    neofetch
    ble-attach
    export PROMPT_COMMAND='_setprompt'

    neofetch && ble-attach
  2. @4x8Matrix 4x8Matrix created this gist Nov 25, 2022.
    96 changes: 96 additions & 0 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,96 @@
    #!/bin/bash
    [[ $- != *i* ]] && return

    # EXPORTS
    export PATH="$PATH:~/.foreman/bin"
    export PATH="$PATH:~/.cargo/bin"
    export PATH="$PATH:~/.luaU/bin"

    export HISTFILESIZE=10000
    export HISTSIZE=500

    export EDITOR=nano
    export VISUAL=nano

    export LESS_TERMCAP_mb=$'\E[01;31m'
    export LESS_TERMCAP_md=$'\E[01;31m'
    export LESS_TERMCAP_me=$'\E[0m'
    export LESS_TERMCAP_se=$'\E[0m'
    export LESS_TERMCAP_so=$'\E[01;44;33m'
    export LESS_TERMCAP_ue=$'\E[0m'
    export LESS_TERMCAP_us=$'\E[01;32m'

    export VIRTUAL_ENV_DISABLE_PROMPT=1

    export color_prompt=yes

    export CLICOLOR=1
    export LS_COLORS='no=00:fi=00:di=00;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:*.xml=00;31:ow=30;44:'

    ## CALLS
    shopt -s checkwinsize
    shopt -s histappend

    unset GREP_OPTIONS

    source ~/Tools/ble.sh/out/ble.sh --noattach

    ## ALIASES
    alias grep="/usr/bin/grep $GREP_OPTIONS"
    alias ls='ls --color=auto'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    alias diff='diff --color=auto'
    alias ip='ip --color=auto'

    alias gitClean="git branch | grep -v "development" | xargs git branch -D"
    alias spiderfoot="cd ~/Tools/spiderfoot-4.0 && python sf.py -l 127.0.0.1:5001"

    alias neofetch="neofetch | lolcat"

    ## FUNCTIONS
    function _parse_git_branch() {
    if [ -n "$(git rev-parse --git-dir 2> /dev/null)" ]; then
    echo -e "-[\033[1;35m$(git rev-parse --abbrev-ref HEAD)\033[1;32m]"
    fi
    }

    ## TERMINAL
    NOCOLOR="\033[0m"
    INFO_COLOR='\033[1;34m'
    PROMPT_COLOR='\033[1;32m'
    PROMPT_SYMBOL=@

    if [ "$EUID" -eq 0 ]; then
    INFO_COLOR='\033[1;31m'
    PROMPT_COLOR='\033[;94m'
    fi

    PS1="${PROMPT_COLOR}┌──${debian_chroot:+($debian_chroot)──}${VIRTUAL_ENV:+(\[\033[0;1m\]$(basename $VIRTUAL_ENV)${PROMPT_COLOR})}(${INFO_COLOR}\u${PROMPT_SYMBOL}\h${PROMPT_COLOR})$(_parse_git_branch)${PROMPT_COLOR}-[\[\033[0;1m\]\w${PROMPT_COLOR}]\n${PROMPT_COLOR}└─${INFO_COLOR}\$\[\033[0m\] "
    PS2='\[${DARKGRAY}\]>\[${NOCOLOR}\] '
    PS3='Number: '
    PS4='\[${DARKGRAY}\]+\[${NOCOLOR}\] '

    unset NOCOLOR
    unset INFO_COLOR
    unset PROMPT_COLOR
    unset PROMPT_SYMBOL

    ## BLE-CONFIG
    bleopt pager=less
    bleopt editor=nano

    bleopt exec_errexit_mark=$''
    bleopt exec_elapsed_mark=$'\e[94m[elapsed %s (CPU %s%%)]\e[m'
    bleopt prompt_eol_mark=$''

    bleopt canvas_winch_action=redraw-prev

    ble-color-setface auto_complete fg=242,bg=235
    ble-color-setface auto_complete fg=white,bg=69
    ble-color-setface auto_complete fg=240,underline,itali

    ## INIT
    neofetch
    ble-attach