-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bashrc
109 lines (81 loc) · 2.8 KB
/
.bashrc
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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#####################################################################
alias vim=nvim
alias ls='ls --color=auto'
alias r=ranger
alias kicat="kitty +kitten icat"
alias kdiff="kitty +kitten diff"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export TERMINAL="kitty"
export EDITOR="nvim"
export LC_ALL=en_US.UTF-8
export LANG="$LC_ALL"
export PATH=$PATH:~/bin
export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin
export HISTCONTROL=ignoreboth:erasedups
# junit
#JUNIT_HOME=/usr/share/java
#export CLASSPATH=.:./target/classes:$JUNIT_HOME/junit.jar:$JUNIT_HOME/hamcrest-core.jar:/home/atmoz/workspace/study/INF102/algs4.jar
#####################################################################
## GPG
#####################################################################
export ATMOZ_GPG_ID=0xB9FB68F98F88BA47
# Set GPG TTY
export GPG_TTY=$(tty)
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
fi
# Start the gpg-agent if not already running
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
gpg-connect-agent /bye >/dev/null 2>&1
fi
# Refresh gpg-agent tty in case user switches into an X session
gpg-connect-agent updatestartuptty /bye >/dev/null
#####################################################################
## Prompt command
#####################################################################
export GIT_PS1_SHOWCOLORHINTS=true
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWUPSTREAM="auto"
export GIT_PS1_SHOWSTASHSTATE=true
source /usr/share/git/completion/git-prompt.sh
function __terminalTitle() {
echo -ne "\033]0;$PWD\007"
}
BLUE='\[\033[1;34m\]'
WHITE='\[\033[1;37m\]'
RESET='\[\033[0m\]'
ps1pc_start="\n"
ps1pc_end="$BLUE\w$WHITE"'$(if [ ! \j == 0 ]; then echo " (\j)"; fi) \$'"$RESET "
PROMPT_COMMAND='__git_ps1 "$ps1pc_start" "$ps1pc_end" "%s\n" && __terminalTitle'
#####################################################################
## Helper functions
#####################################################################
function cal() {
if [ $# == 0 ]; then
/usr/bin/cal -my --week
else
/usr/bin/cal "$@"
fi
}
function dup() {
($TERMINAL &) 2> /dev/null
}
#####################################################################
## Version controlled configurations
#####################################################################
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
# Remind me of uncommitted changes
if [ "$PWD" == "$HOME" ]; then
dotfiles status --short -uno
git -C ~/bin status --short -uno
git -C /srv/formulas/workstation-formula status --short -uno
fi
source <(kitty + complete setup bash)