-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
146 lines (117 loc) · 4.93 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
138
139
140
141
142
143
144
145
146
#!/bin/bash
# mcgillij ~/.bashrc
set -o vi # vi mode
export CHROOT=$HOME/chroot # Where I build my arch packages
export MESA_WHICH_LLVM=1 # used to build mesa-git
export GTK_THEME=Dracula
export EDITOR=nvim
export FONTCONFIG_PATH=/etc/fonts
if [ -n "${GHOSTTY_RESOURCES_DIR}" ]; then
builtin source "${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash"
fi
# PATH Shenanigans for my tooling
# add path to my own scripts
if [ -d "$HOME/bin" ] && (! echo "$PATH" | grep -q "$HOME/bin"); then
export PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ] && (! echo "$PATH" | grep -q "$HOME/.local/bin"); then
export PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "$HOME/.cargo/bin" ] && (! echo "$PATH" | grep -q "$HOME/.cargo/bin"); then
export PATH="$HOME/.cargo/bin:$PATH"
fi
if [ -d "$HOME/.pyenv/bin" ] && (! echo "$PATH" | grep -q "$HOME/.pyenv/bin"); then
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
if command -v pyenv >/dev/null; then eval "$(pyenv init -)"; fi
fi
# History Settings to make fzf more useful
export HISTCONTROL=ignoredups
export HISTSIZE=-1 # unlimited
export HISTFILESIZE=-1 # unlimited
# Custom commands for setting CPU Governor
alias performance_mode='echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'
alias powersave_mode='echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'
alias schedutil_mode='echo schedutil | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'
alias cpu_frequency_watch='watch -n.5 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""'
# Regular aliases
alias more='less -r'
alias cat='bat'
alias tls='tmux ls'
alias grep='grep --color=auto'
alias diff='difft --color=auto'
alias dmesg='dmesg --color=always'
alias virsh='virsh -c qemu:///system'
alias ag='batgrep' # just muscle memory
alias ls='eza --icons'
alias ll='eza --long --git --header --icons'
alias lt='eza --tree --icons'
alias tmux="tmux -2"
alias discord='discord-canary'
# To make my tmux behave with colors
export TERM="xterm-256color"
# fzf settings
export FZF_TMUX=1
# Arch make
nprocs=$(nproc)
export MAKEFLAGS="-j$nprocs"
export PAGER='less -r'
# setup ssh agent
eval $(ssh-agent -s) > /dev/null 2>&1
ssh-add ~/.ssh/id_ed25519 > /dev/null 2>&1
# Dracula man page theme
man() {
env LESS_TERMCAP_mb=$'[01;31m' \
LESS_TERMCAP_md=$'[01;33;5;74m' \
LESS_TERMCAP_me=$'[0m' \
LESS_TERMCAP_se=$'[0m' \
LESS_TERMCAP_so=$'[38;5;246m' \
LESS_TERMCAP_ue=$'[0m' \
LESS_TERMCAP_us=$'[04;39;5;146m' \
man "$@"
}
##-----------------------------------------------------
## synth-shell-greeter.sh
if [ -f /home/j/.config/synth-shell/synth-shell-greeter.sh ] && [ -n "$( echo $- | grep i )" ]; then
source /home/j/.config/synth-shell/synth-shell-greeter.sh
fi
##-----------------------------------------------------
## synth-shell-prompt.sh
if [ -f /home/j/.config/synth-shell/synth-shell-prompt.sh ] && [ -n "$( echo $- | grep i )" ]; then
source /home/j/.config/synth-shell/synth-shell-prompt.sh
fi
# Dracula in my fzf
#
export FZF_DEFAULT_OPTS='--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4'
export FZF_CTRL_T_OPTS="--preview '[[ \$(file --mime {}) =~ binary ]] &&
echo {} is a binary file ||
(bat --style=numbers --color=always {} ||
highlight -O ansi -l {} ||
cat {}) 2> /dev/null | head -500' --preview-window=right:60%"
export FZF_CTRL_R_OPTS="--preview 'bat --style=numbers --color=always --line-range :500 {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
# FZF to replace CTRL-R and add Alt-C and Ctrl-T
[ -r /usr/share/fzf/key-bindings.bash ] && source /usr/share/fzf/key-bindings.bash
[ -r /usr/share/fzf/completion.bash ] && source /usr/share/fzf/completion.bash
[ -r /home/j/gits/fzf-tab-completion/bash/fzf-bash-completion.sh ] && source /home/j/gits/fzf-tab-completion/bash/fzf-bash-completion.sh
bind -x '"\t": fzf_bash_completion'
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
# load all the bash completions
[ -r /usr/share/bash-completion/bash_completion ] && source /usr/share/bash-completion/bash_completion
# git completion
[ -r /usr/share/git/completion/git-completion.bash ] && source /usr/share/git/completion/git-completion.bash
export PATH="/home/j/.local/bin:$PATH"
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring
# from mitch
alias syay='yay -Slq | fzf --multi --preview "yay -Si {1}" | xargs -ro yay -S'
eval "$(github-copilot-cli alias -- "$0")"
export GPG_TTY=$(tty)
# Added by LM Studio CLI (lms)
export PATH="$PATH:/home/j/.cache/lm-studio/bin"