-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
143 lines (123 loc) · 3.6 KB
/
Copy pathbashrc
File metadata and controls
143 lines (123 loc) · 3.6 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# turns on bash autocompletion
if [ -f /etc/profile.d/bash_completion.sh ]; then
. /etc/profile.d/bash_completion.sh
fi
user_color=32m
if [ ${UID} -eq 0 ]
then
user_color=31m
fi
bash_prompt() {
local NONE="\[\033[0m\]" # unsets color to term's fg color
# regular colors
local K="\[\033[0;30m\]" # black
local R="\[\033[0;31m\]" # red
local G="\[\033[0;32m\]" # green
local Y="\[\033[0;33m\]" # yellow
local B="\[\033[0;34m\]" # blue
local M="\[\033[0;35m\]" # magenta
local C="\[\033[0;36m\]" # cyan
local W="\[\033[0;37m\]" # white
# emphasized (bolded) colors
local EMK="\[\033[1;30m\]"
local EMR="\[\033[1;31m\]"
local EMG="\[\033[1;32m\]"
local EMY="\[\033[1;33m\]"
local EMB="\[\033[1;34m\]"
local EMM="\[\033[1;35m\]"
local EMC="\[\033[1;36m\]"
local EMW="\[\033[1;37m\]"
# background colors
local BGK="\[\033[40m\]"
local BGR="\[\033[41m\]"
local BGG="\[\033[42m\]"
local BGY="\[\033[43m\]"
local BGB="\[\033[44m\]"
local BGM="\[\033[45m\]"
local BGC="\[\033[46m\]"
local BGW="\[\033[47m\]"
local UC=$EMG
[ $UID -eq "0" ] && UC=$EMR
PS1="${UC}\u ${NONE}@ ${EMB}\h ${NONE}{ ${M}\d ${NONE}} ${W}${BGY}${EMK}[ \w ]${NONE}\n\#$(__git_ps1) ${UC}\\$> ${NONE}"
}
export PROMPT_COMMAND=bash_prompt
printf "\033]0;%s@%s\007" "${LOGNAME}" "${HOSTNAME%%.*}"
# turns on git prompt
if [ -f /home/danix/.git-prompt.sh ]; then
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_HIDE_IF_PWD_IGNORED=true
GIT_PS1_SHOWCOLORHINTS=true
. /home/danix/.git-prompt.sh
fi
alias su="su -"
alias ls="ls --color -lh"
alias cp="cp -v"
alias rm="rm -v"
alias mv="mv -v"
alias chmod="chmod -v"
alias chown="chown -v"
alias apropos="wtf is"
alias free="free -m"
alias df="df -h"
alias du="du -sh"
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias path='(IFS=:;ls -1d $PATH | nl)'
alias hf='history|grep'
# history as big as possible!!
HISTSIZE=1000000
HISTFILESIZE=2000000
HISTIGNORE='hf *'
# unix.stackexchange.com/a/18443
# history: erase duplicates...
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
#export PATH=~/.platformio/penv/bin:~/.config/composer/vendor/bin:~/.local/bin:~/bin:$PATH
export PATH=~/.config/composer/vendor/bin:~/.local/bin:~/bin:$PATH
export INTEL_BATCH=1
export QT_QPA_PLATFORMTHEME="lxqt"
export QT_STYLE_OVERRIDE="kvantum-dark"
export XDG_DATA_DIRS="/usr/local/share/:/usr/share/"
# Tailoring LESS
alias more='less'
export LESS='-R'
export LESSOPEN='|~/.lessfilter %s'
export PAGER=less
export SVN_EDITOR=vim
export LESSCHARSET='latin1'
man() {
LESS_TERMCAP_md=$'\e[01;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[01;44;33m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[01;32m' \
command man "$@"
}
# sudo password helper
export SUDO_ASKPASS=/usr/bin/lxsudo
# password store directory
export PASSWORD_STORE_DIR=/home/danix/Programming/GIT/password_store/
# logdate appends a date to a script output
logdate() {
while IFS= read -r line; do
echo "$(date +"%F_%R.%S") $line"
done
}
unset GPG_AGENT_INFO
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
if [ -x "$(which gpg-connect-agent)" ]; then
gpg-connect-agent updatestartuptty /bye > /dev/null
fi
mount-fs () {
( echo Filesystem Mountpoint Fstype;
mount | \grep -E '^[^[:lower:]_-]+' | awk '{print $1,$3,$5}'
) | column -t
}