summaryrefslogtreecommitdiffstats
path: root/roles/common/files/bashrc
blob: 3f9f072551453802daea1df90d60bd466b20ceda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -lh'
alias f='find . -iname'
alias up='popd'
alias pop='popd'
alias myip='curl https://manchester.casperlefantom.net:4433/ipclient.php'
alias myip4='curl -4 https://manchester.casperlefantom.net:4433/ipclient.php'
alias torip='torsocks curl https://manchester.casperlefantom.net:4433/ipclient.php'
alias beep='echo -e "\a"'
alias screenoff='xset dpms force off'
alias wifion='nmcli r wifi on'
alias wifioff='nmcli r wifi off'
alias ltx='tmux ls'
alias atx='tmux attach -t'
alias addkey='gpg --keyserver hkp://keys.fedoraproject.org --recv-key'
alias poezio='tmux -2 new-session -s poezio -n "poezio-debug by tor" "proxychains4 poezio --debug ~/.local/share/poezio/debug.log"'
alias tssh='torsocks ssh -F /home/$USER/.ssh/config2'
alias tscp='torsocks scp -F /home/$USER/.ssh/config2'
alias trsync='torsocks rsync -e "ssh -F /home/$USER/.ssh/config2"'
alias mnt='mount | column -t'


# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# Define personal variables
if [ -f $HOME/bin/setvars ]; then
    . $HOME/bin/setvars
fi
# Define personal functions
if [ -f $HOME/bin/setfunctions ]; then
    . $HOME/bin/setfunctions
fi

# Print fedora linux logo in interactive shell
if [ -n "$PS1" ]; then
    if which linux_logo >/dev/null 2>&1; then
        linux_logo -L fedora -F "Bienvenue sur l'hôte #H\n#V, Compilé #C \n#P #X #T, #R, #U"
    fi
fi

HISTSIZE=25000
HISTIGNORE="history:exit:logout:[ ]*"
HISTTIMEFORMAT="%d/%m/%y %T "

RESET='\[$(tput sgr0)\]'
BOLD='\[$(tput bold)\]'
ULINE='\[$(tput smul)\]'

BLUE='\[$(tput setaf 4)\]'
GREEN='\[$(tput setaf 2)\]'
RED='\[$(tput setaf 1)\]'
YELLOW='\[$(tput setaf 3)\]'
CYAN='\[$(tput setaf 6)\]'

if [ $UID -eq 0 ]; then
    PS1="$BOLD$RED\h$BLUE:$YELLOW\w$RED\\$ $RESET$RED"
else
    PS1="$BOLD$GREEN\u$BLUE@$YELLOW\h$BLUE:\w$GREEN\\$ $RESET$GREEN"
fi
PS2='suite-> '