Skip to content

Instantly share code, notes, and snippets.

@xgouchet
Last active June 1, 2017 14:03
Show Gist options
  • Select an option

  • Save xgouchet/f311b437057feeadf41f to your computer and use it in GitHub Desktop.

Select an option

Save xgouchet/f311b437057feeadf41f to your computer and use it in GitHub Desktop.

Revisions

  1. xgouchet revised this gist Jun 1, 2017. 1 changed file with 4 additions and 22 deletions.
    26 changes: 4 additions & 22 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ GIT_PS1_SHOWSTASHSTATE=true
    GIT_PS1_SHOWCOLORHINTS=true
    GIT_PS1_HIDE_IF_PWD_IGNORED=true
    GIT_PS1_SHOWUPSTREAM='legacy'
    #GIT_PS1_STATESEPARATOR=' '

    pretty_git_ps1() {
    __git_ps1 |
    @@ -17,33 +18,14 @@ pretty_git_ps1() {
    sed 's/%/¿/' # untracked files
    }

    # error message (requires fortune-mod fortunes-bofh-excuses and cowsay (with dalek variant)
    shamefull_error() {
    fortune bofh-excuses | cowsay -f dalek
    }


    # Prompt
    if [ "$color_prompt" = yes ]; then
    PS1='`
    if [ 0 -ne $? -a 127 -ne $? ]; then
    shamefull_error
    fi
    echo "${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pretty_git_ps1)\[\033[00m\]\n\[\033[1;36m\]→ \[\033[00m\]" `'
    PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pretty_git_ps1) \[\033[37m\](\D{%H:%M})\[\033[00m\]\n\[\033[1;36m\]→ \[\033[00m\]'
    else
    PS1='`
    if [ 0 -ne $? -a 127 -ne $? ]; then
    shamefull_error
    fi
    echo "${debian_chroot:+($debian_chroot)}\u@\h:\w $(pretty_git_ps1)\n→ " `'
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi

    # Command not found handle
    # (requires command-not-found fortunes-bofh-excuses and cowsay packages)
    function command_not_found_handle {
    # echo "Sorry, smotchkiss, try again."
    fortune bofh-excuses | cowsay -f dalek
    }



    ########################################################################
  2. xgouchet revised this gist Sep 28, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bashrc
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ if [ "$color_prompt" = yes ]; then
    if [ 0 -ne $? -a 127 -ne $? ]; then
    shamefull_error
    fi
    echo "${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pr$
    echo "${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pretty_git_ps1)\[\033[00m\]\n\[\033[1;36m\]→ \[\033[00m\]" `'
    else
    PS1='`
    if [ 0 -ne $? -a 127 -ne $? ]; then
  3. xgouchet revised this gist Sep 28, 2016. 1 changed file with 18 additions and 2 deletions.
    20 changes: 18 additions & 2 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -17,11 +17,25 @@ pretty_git_ps1() {
    sed 's/%/¿/' # untracked files
    }

    # error message (requires fortune-mod fortunes-bofh-excuses and cowsay (with dalek variant)
    shamefull_error() {
    fortune bofh-excuses | cowsay -f dalek
    }


    # Prompt
    if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pretty_git_ps1)\[\033[00m\]\n\[\033[1;36m\]→ \[\033[00m\]'
    PS1='`
    if [ 0 -ne $? -a 127 -ne $? ]; then
    shamefull_error
    fi
    echo "${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pr$
    else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    PS1='`
    if [ 0 -ne $? -a 127 -ne $? ]; then
    shamefull_error
    fi
    echo "${debian_chroot:+($debian_chroot)}\u@\h:\w $(pretty_git_ps1)\n→ " `'
    fi
    # Command not found handle
    @@ -40,3 +54,5 @@ export EDITOR="nano"
    # handle non breaking space in shell
    setxkbmap -option "nbsp:none"
    # Fortune greeting
    fortune -s | cowsay
  4. xgouchet revised this gist Sep 27, 2016. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,13 @@ else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi

    # Command not found handle
    # (requires command-not-found fortunes-bofh-excuses and cowsay packages)
    function command_not_found_handle {
    # echo "Sorry, smotchkiss, try again."
    fortune bofh-excuses | cowsay -f dalek
    }


    ########################################################################
    # make sure the default console editor is nano
  5. xgouchet revised this gist May 11, 2016. 1 changed file with 27 additions and 21 deletions.
    48 changes: 27 additions & 21 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,30 @@

    # Configure Git PS1
    GIT_PS1_DESCRIBE_STYLE='describe'
    GIT_PS1_SHOWDIRTYSTATE=true
    GIT_PS1_SHOWUNTRACKEDFILES=true
    GIT_PS1_SHOWSTASHSTATE=true
    GIT_PS1_SHOWCOLORHINTS=true
    GIT_PS1_HIDE_IF_PWD_IGNORED=true
    GIT_PS1_SHOWUPSTREAM='legacy'

    pretty_git_ps1() {
    __git_ps1 |
    sed 's/</∇/' | # upstream ahead
    sed 's/>/∆/' | # upstream behind
    sed 's/[$]/Σ/' | # sigma = stash available
    sed 's/*/δ/' | # delta = dirty files
    sed 's/%/¿/' # untracked files
    }

    # Prompt
    if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pretty_git_ps1)\[\033[00m\]\n\[\033[1;36m\]→ \[\033[00m\]'
    else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi


    ########################################################################
    # make sure the default console editor is nano
    export EDITOR="nano"
    @@ -6,24 +33,3 @@ export EDITOR="nano"
    # handle non breaking space in shell
    setxkbmap -option "nbsp:none"

    ########################################################################
    # Android path variables
    # export STUDIO_JDK=/opt/jdk/jdk1.7.0_79
    #
    # export ANDROID_SDK=/home/share/android/sdk
    # export ANDROID_NDK=/home/share/android/ndk
    #
    # export PATH=${PATH}:$ANDROID_SDK/tools
    # export PATH=${PATH}:$ANDROID_SDK/platform-tools
    # export PATH=${PATH}:$ANDROID_NDK/tools

    ########################################################################
    # variables for my devices in ADB
    # device usb:1-1.4 product:yakju model:Galaxy_Nexus device:maguro
    export SERIAL_GNEXUS=0A3BDAD913017009
    # device usb:1-1.3 product:falcon_vffrsl model:XT1032 device:falcon_umts
    export SERIAL_MOTOG=TA8900AKC2

    ########################################################################
    # Load the git_bash_prompt
    # source ~/git_bash_prompt
  6. xgouchet revised this gist May 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bashrc
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,4 @@ export SERIAL_MOTOG=TA8900AKC2

    ########################################################################
    # Load the git_bash_prompt
    source /home/share/scripts/git_bash_prompt
    # source ~/git_bash_prompt
  7. xgouchet revised this gist May 12, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion .bashrc
    Original file line number Diff line number Diff line change
    @@ -22,4 +22,8 @@ setxkbmap -option "nbsp:none"
    # device usb:1-1.4 product:yakju model:Galaxy_Nexus device:maguro
    export SERIAL_GNEXUS=0A3BDAD913017009
    # device usb:1-1.3 product:falcon_vffrsl model:XT1032 device:falcon_umts
    export SERIAL_MOTOG=TA8900AKC2
    export SERIAL_MOTOG=TA8900AKC2

    ########################################################################
    # Load the git_bash_prompt
    source /home/share/scripts/git_bash_prompt
  8. xgouchet created this gist May 12, 2015.
    25 changes: 25 additions & 0 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    ########################################################################
    # make sure the default console editor is nano
    export EDITOR="nano"

    ########################################################################
    # handle non breaking space in shell
    setxkbmap -option "nbsp:none"

    ########################################################################
    # Android path variables
    # export STUDIO_JDK=/opt/jdk/jdk1.7.0_79
    #
    # export ANDROID_SDK=/home/share/android/sdk
    # export ANDROID_NDK=/home/share/android/ndk
    #
    # export PATH=${PATH}:$ANDROID_SDK/tools
    # export PATH=${PATH}:$ANDROID_SDK/platform-tools
    # export PATH=${PATH}:$ANDROID_NDK/tools

    ########################################################################
    # variables for my devices in ADB
    # device usb:1-1.4 product:yakju model:Galaxy_Nexus device:maguro
    export SERIAL_GNEXUS=0A3BDAD913017009
    # device usb:1-1.3 product:falcon_vffrsl model:XT1032 device:falcon_umts
    export SERIAL_MOTOG=TA8900AKC2