-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
137 lines (113 loc) · 3.67 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
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
#
# ~/.bashrc
#
# Vim key-binding in bash
set -o vi
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Global alias
alias ls='ls --color=auto'
alias yt='newsboat -u $HOME/.newsboat/yt.urls -c $HOME/.newsboat/yt-cache.db'
alias manga='newsboat -u $HOME/.newsboat/manga.urls -c $HOME/.newsboat/manga-cache.db'
# Alias for tty only
if [ -z $DISPLAY ]; then
alias mpv='mplayer -vo fbdev2'
alias scrot='fbgrab -i'
else # Unset alias outside tty
unalias mplayer 2>/dev/null
unalias scrot 2>/dev/null
fi
# PS1 mod
get_branch_name() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
PS1='\[\033[1;34m\] \W \[\033[1;31m\]$(get_branch_name)\[\033[1;34m\]‣ \[\033[0m\]'
# Nifty function
fzf_tmux() {
fzf --border double --tmux "$@"
}
fzf_dir() {
fzf_tmux --preview "ls -lh {}"
}
fzf_file() {
fzf_tmux --preview "head -n 100 {}"
}
ac() {
# Change into specified dir
[ -z $1 ] && cd $(find $PROF $DOCS -type d -not -path "*/.git/*" | fzf_dir) || \
cd $(find $1 -type d -not -path "*/.git/*" | fzf_dir)
}
conf() {
# Open config file using vim
vim -c "cd $HOME/.config" "$(find $HOME/.config/* -type f | fzf_file -m)"
}
blog() {
# Edit blog content
vim -c "cd $BLOG" "$(find $BLOG -iregex '.*R?md' | fzf_file -m)"
}
book () {
# Read book in terminal
BOOKPATH=$(find $BOOK -iregex '.*\(pdf\|epub\)' | fzf_dir -m)
BASE=$(basename $BOOKPATH)
EXT=$(echo $BASE | cut -d "." -f 2)
echo $BASE with an extension of $EXT
case $EXT in
pdf)
fbpdf $BOOKPATH
;;
epub)
bk $BOOKPATH
;;
esac
}
force_color_prompt=yes
export DATA=$HOME/data
export DOCS=$DATA/personal/Documents
export BLOG=$DOCS/blog
export BOOK=$DOCS/ebook
export PROF=$DATA/professional
export WC=$PROF/jobs/writing-center
export MT=$PROF/jobs/medtech
export ACDM=$PROF/Documents/academy
export PHD=$PROF/Documents/academy/_postgrad/PhD-course
export PYENV=$DATA/personal/programs/pyenv # PyEnv root folder
export FLUTTER=$DATA/personal/programs/flutter # Flutter root folder
export SDK=$DATA/personal/programs/android-sdk # Android ANDROID_SDK_ROOT root folder
export PATH=$PATH:/shims:/home/lam/.local/bin:/home/lam/bin:$PYENV/bin:$FLUTTER/bin:$SDK/cmdline-tools/latest/bin:$SDK/emulator:$SDK/platform-tools:$SDK/tools:$SDK/tools/bin:$HOME/.cargo/bin
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export BROWSER=qutebrowser
export CHROME_EXECUTABLE=/bin/chromium
export EDITOR=vim
export SYSTEMD_EDITOR=vim
export XDG_DATA_HOME=$DATA/lamuri
export XDG_DATA_DIRS=$XDG_DATA_DIRS:$DATA/lamuri/flatpak/share
export XDG_CACHE_HOME=$DATA/.cache/
export XDG_CONFIG_HOME=$HOME/.config
# Use Kvantum style
export QT_STYLE_OVERRIDE=kvantum
# Runtime dir and pulse server for flatpak env
export XDG_RUNTIME_DIR=$DATA/lamuri/runtime
#export PULSE_SERVER=unix:/tmp/pulse-socket
# Integrate FZF to bash
eval "$(fzf --bash)"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/lam/data/personal/programs/miniconda/v3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/lam/data/personal/programs/miniconda/v3/etc/profile.d/conda.sh" ]; then
. "/home/lam/data/personal/programs/miniconda/v3/etc/profile.d/conda.sh"
else
export PATH="/home/lam/data/personal/programs/miniconda/v3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
export PATH="$PATH:/home/lam/data/personal/programs/miniconda/v3/bin"
# Add `pyenv` path
eval "$(pyenv init -)"
# Created by `pipx` on 2023-01-19 08:18:24
export PATH="$PATH:/home/lam/.local/bin"