Changeset 1acf9a9 in dotfiles for guix/.bashrc


Ignore:
Timestamp:
Oct 12, 2021, 11:22:54 PM (3 years ago)
Author:
Михаил Кириллов <w96k.ru@…>
Branches:
master
Children:
1129de2
Parents:
d7cc80a
Message:

Update configuration for debian machine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guix/.bashrc

    rd7cc80a r1acf9a9  
    1 # Bash initialization for interactive non-login shells and
    2 # for remote shells (info "(bash) Bash Startup Files").
    3 
    4 # Export 'SHELL' to child processes.  Programs such as 'screen'
    5 # honor it and otherwise use /bin/sh.
    61export SHELL
    72
    8 # if [[ $- != *i* ]]
     3DISTRO="$(lsb_release -d | awk -F"\t" '{print $2}' | awk -F" " '{print $1}')"
    94
    10 #    # We are being invoked from a non-interactive shell.  If this
    11 #    # is an SSH session (as in "ssh host command"), source
    12 #    # /etc/profile so we get PATH and other essential variables.
    13 #    [[ -n "$SSH_CLIENT" ]] && source /etc/profile
    14 
    15 #    # Don't do anything else.
    16 #    return
    17 # fi
    18 
    19 # bind 'set show-all-if-ambiguous on'
    20 # bind 'TAB:menu-complete'
    21 
    22 # Source the system-wide file.
    23 source /etc/bashrc
     5if [ "$DISTRO" == "Debian" ]; then
     6    source /etc/bash.bashrc
     7else
     8    # Source the system-wide file.
     9    source /etc/bashrc   
     10fi
    2411
    2512# Adjust the prompt depending on whether we're in 'guix environment'.
     
    3623alias grep='grep --color=auto'
    3724
     25# set a fancy prompt (non-color, unless we know we "want" color)
     26case "$TERM" in
     27    xterm-color|*-256color) color_prompt=yes;;
     28esac
     29
     30# colored GCC warnings and errors
     31export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
     32
     33export PYTHONSTARTUP="${HOME}/.pyrc"
     34export PYTHONIOENCODING="UTF-8"
     35
     36if [ "$DISTRO" == "Debian" ]; then
     37    if [ -f ~/.bash_aliases ]; then
     38        . ~/.bash_aliases
     39    fi
     40
     41    if ! shopt -oq posix; then
     42        if [ -f /usr/share/bash-completion/bash_completion ]; then
     43            . /usr/share/bash-completion/bash_completion
     44        elif [ -f /etc/bash_completion ]; then
     45            . /etc/bash_completion
     46        fi
     47    fi
     48fi
     49
    3850# Welcome message
    3951printf "Welcome to bash shell\n\n"
     52
Note: See TracChangeset for help on using the changeset viewer.