-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
170 lines (135 loc) · 7.63 KB
/
.zshrc
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Zsh
source ~/zsh-snap/znap.zsh
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(
git
zsh-autosuggestions
docker
docker-compose
)
source $ZSH/oh-my-zsh.sh
export HOMEBREW_NO_ENV_HINTS=yes
alias l='eza'
alias la='eza -a'
alias ll='eza -lah'
alias ls='eza --color=auto'
alias cat='bat --paging=never'
alias cd='z'
alias k=kubectl
complete -F __start_kubectl k
alias speed='npx speed-cloudflare-cli'
sugoi () {
yabai --start-service
# Hide all windows
osascript <<END
activate application "Finder"
tell application "System Events"
set visible of processes where name is not "Finder" to false
end tell
tell application "Finder" to set collapsed of windows to true
END
# Laptop
yabai -m query --windows | jq -e '.[] | select(.app == "Slack")."is-native-fullscreen"' && (yabai -m query --windows | jq '.[] | select(.app == "Slack").id' | xargs -I{} yabai -m window {} --toggle native-fullscreen && sleep 1)
# yabai -m query --windows | jq -e '.[] | select(.app == "Telegram")."is-native-fullscreen"' && (yabai -m query --windows | jq '.[] | select(.app == "Telegram").id' | xargs -I{} yabai -m window {} --toggle native-fullscreen && sleep 1)
# yabai -m query --windows | jq -e '.[] | select(.app == "Messages")."is-native-fullscreen"' && (yabai -m query --windows | jq '.[] | select(.app == "Messages").id' | xargs -I{} yabai -m window {} --toggle native-fullscreen && sleep 1)
yabai -m query --windows | jq -e '.[] | select(.app == "Slack")."is-visible" | not' && open /Applications/Slack.app
# yabai -m query --windows | jq -e '.[] | select(.app == "Telegram")."is-visible" | not' && open /Applications/Telegram.localized/Telegram.app
# yabai -m query --windows | jq -e '.[] | select(.app == "Messages")."is-visible" | not' && open /System/Applications/Messages.app
yabai -m query --windows | jq '.[] | select(.app == "Slack").id' | xargs -I{} yabai -m window {} --display west --warp west
# yabai -m query --windows | jq '.[] | select(.app == "Telegram").id' | xargs -I{} yabai -m window {} --display west --warp east
# yabai -m query --windows | jq '.[] | select(.app == "Messages").id' | xargs -I{} yabai -m window {} --display west --warp east
# yabai -m query --windows | jq '.[] | select(.app == "Telegram").id' | xargs -I{} yabai -m window {} --resize bottom:0:$(yabai -m query --windows | jq '.[] | 562 - select(.app == "Telegram").frame.h')
yabai -m query --windows | jq '.[] | select(.app == "Slack").id' | xargs -I{} yabai -m window {} --resize right:$(yabai -m query --windows | jq '.[] | 1200 - select(.app == "Slack").frame.w'):0
yabai -m query --windows | jq -e '.[] | select(.app == "Slack")."split-type" == "horizontal"' && yabai -m query --windows | jq '.[] | select(.app == "Slack").id' | xargs -I{} yabai -m window {} --toggle split
# Main monitor
yabai -m query --windows | jq -e '.[] | select(.app == "Arc")."is-native-fullscreen"' && (yabai -m query --windows | jq '.[] | select(.app == "Arc").id' | xargs -I{} yabai -m window {} --toggle native-fullscreen && sleep 1)
yabai -m query --windows | jq -e '.[] | select(.app == "Ghostty")."is-native-fullscreen"' && (yabai -m query --windows | jq '.[] | select(.app == "Ghostty").id' | xargs -I{} yabai -m window {} --toggle native-fullscreen && sleep 1)
# yabai -m query --windows | jq -e '.[] | select(.app == "Messages")."split-type" == "vertical"' && yabai -m query --windows | jq '.[] | select(.app == "Messages").id' | xargs -I{} yabai -m window {} --toggle split
yabai -m query --windows | jq -e '.[] | select(.app == "Arc")."is-visible" | not' && open /Applications/Arc.app
yabai -m query --windows | jq -e '.[] | select(.app == "Ghostty")."is-visible" | not' && open /Applications/Ghostty.app
yabai -m query --windows | jq -e '.[] | select(.app == "Ghostty")."split-type" == "horizontal"' && yabai -m query --windows | jq '.[] | select(.app == "Ghostty").id' | xargs -I{} yabai -m window {} --toggle split
yabai -m query --windows | jq '.[] | select(.app == "Ghostty").id' | xargs -I{} yabai -m window {} --display east --warp east
yabai -m query --windows | jq '.[] | select(.app == "Arc").id' | xargs -I{} yabai -m window {} --display east --warp west
yabai -m query --windows | jq '.[] | select(.app == "Ghostty") | .space' | xargs -I{} yabai -m space {} --balance
}
kirei () {
yabai --start-service
# Hide all windows
osascript <<END
activate application "Finder"
tell application "System Events"
set visible of processes where name is not "Finder" to false
end tell
tell application "Finder" to set collapsed of windows to true
END
# Open Arc and Ghostty if they are not visible
yabai -m query --windows | jq -e '.[] | select(.app == "Arc")."is-visible" | not' && open /Applications/Arc.app
yabai -m query --windows | jq -e '.[] | select(.app == "Ghostty")."is-visible" | not' && open /Applications/Ghostty.app
# Make Arc fullscreen first, so it goes further down the list of spaces
yabai -m query --windows | jq '.[] | select(.app == "Arc")."is-native-fullscreen" | not' && (yabai -m query --windows | jq '.[] | select(.app == "Arc").id' | xargs -I{} yabai -m window {} --toggle native-fullscreen && sleep 1)
# Then, make Ghostty fullscreen
yabai -m query --windows | jq '.[] | select(.app == "Ghostty")."is-native-fullscreen" | not' && (yabai -m query --windows | jq '.[] | select(.app == "Ghostty").id' | xargs -I{} yabai -m window {} --toggle native-fullscreen && sleep 1)
yabai --stop-service
}
export GPG_TTY=$(tty)
export GOPATH="$HOME/go"
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
source ~/.env.secrets
export LDFLAGS="-L/opt/homebrew/opt/llvm@13/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm@13/include"
. /opt/homebrew/opt/asdf/libexec/asdf.sh
# bun completions
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
# Bun
export BUN_INSTALL="$HOME/.bun"
export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init -)"
alias get_idf='. $HOME/Projects/esp-idf/export.sh'
export EDITOR=nvim
export BAT_THEME=ansi
# eval "$(atuin init zsh)"
eval "$(zoxide init zsh)"
# ghostty word jumps
bindkey "\e[1;3D" backward-word
bindkey "\e[1;3C" forward-word
# ZVM
export ZVM_INSTALL="$HOME/.zvm/self"
# jj completions
source <(jj util completion zsh)
# Kurtosis
# eval "$(kurtosis completion zsh)"
# PATH
export PATH="$PATH:$HOME/.zvm/bin"
export PATH="$PATH:$ZVM_INSTALL/"
export PATH="$HOME/Library/Python/3.8/bin:$PATH"
export PATH="$GOPATH/bin:$PATH"
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
export PATH="$PATH:$HOME/.foundry/bin"
export PATH="/opt/homebrew/opt/llvm@13/bin:$PATH"
export PATH="$BUN_INSTALL/bin:$PATH"
export PATH="$HOME/zls:$PATH"
export PATH=$PATH:$HOME/.zokrates/bin
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="/Applications/Ghostty.app/Contents/MacOS:$PATH"
export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"
export PATH="/opt/homebrew/opt/llvm@17/bin:$PATH"
export PATH="/opt/homebrew/opt/curl/bin:$PATH"
. "$HOME/.cargo/env"
alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
mptb() {
cast from-rlp "$1" | \
jq '.[0:17] |
to_entries |
map({key: ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","value"][.key], value: .value}) |
from_entries'
}
eval "$(starship init zsh)"
export NARGO_HOME="/Users/shekhirin/.nargo"
export PATH="$PATH:$NARGO_HOME/bin"
export PATH="${HOME}/.bb:${PATH}"
export PATH="/Users/shekhirin/.bb:$PATH"