1set -x BAT_THEME "ansi"
2set -x DFT_BACKGROUND "light"
3
4# XDG variables
5set -x XDG_DATA_HOME "$HOME/.local/share"
6set -x XDG_CONFIG_HOME "$HOME/.config"
7set -x XDG_STATE_HOME "$HOME/.local/state"
8set -x XDG_CACHE_HOME "$HOME/.cache"
9set -x XDG_BIN_HOME "$HOME/.local/bin"
10set -x XDG_BIN_DIR $XDG_BIN_HOME
11
12# Moving dotfiles around
13set -x WINEPREFIX "$XDG_DATA_HOME"/wine
14set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
15set -x SQLITE_HISTORY "$XDG_CACHE_HOME"/sqlite_history
16set -x BUNDLE_USER_CONFIG "$XDG_CONFIG_HOME"/bundle
17set -x BUNDLE_USER_CACHE "$XDG_CACHE_HOME"/bundle
18set -x BUNDLE_USER_PLUGIN "$XDG_DATA_HOME"/bundle
19set -x NUGET_PACKAGES "$XDG_CACHE_HOME"/NuGetPackages
20set -x DVDCSS_CACHE "$XDG_DATA_HOME"/dvdcss
21set -x KDEHOME "$XDG_CONFIG_HOME"/kde
22set -x GOPATH "$XDG_DATA_HOME"/go
23set -x ZIM_HOME "$XDG_CONFIG_HOME"/.zim
24set -x GHCUP_USE_XDG_DIRS "ishouldjustbeabletoexportthisnotsetit"
25set -x NODE_PATH "$XDG_DATA_HOME/npm-packages/lib/node_modules"
26set -x CARGO_HOME "$XDG_DATA_HOME"/cargo
27set -x ASDF_DATA_DIR "$XDG_DATA_HOME/asdf"
28
29# Ruby crap
30rbenv init - | source
31fish_add_path "$HOME/.rbenv/versions/3.2.2/bin"
32
33# Android crap
34set -x ANDROID_HOME "$XDG_DATA_HOME/Android"
35set -x ANDROID_SDK_ROOT "$ANDROID_HOME"
36fish_add_path "$ANDROID_HOME/cmdline-tools/latest/bin"
37fish_add_path "$ANDROID_HOME/platform-tools"
38fish_add_path "$ANDROID_HOME/emulator"
39
40# Executable paths
41fish_add_path "$XDG_CONFIG_HOME/emacs/bin"
42fish_add_path "$GOPATH/bin"
43fish_add_path "$XDG_DATA_HOME/cargo/bin"
44fish_add_path "$HOME/.radicle/bin"
45fish_add_path "$HOME/.local/bin"
46fish_add_path "/usr/lib/kf6"
47fish_add_path "/usr/lib/kf5"
48fish_add_path "/usr/local/go/bin"
49fish_add_path "$XDG_CACHE_HOME/.bun/bin"
50
51# Additional preferences
52{{ if eq .chezmoi.hostname "sidhe" }}
53set -x EDITOR "zed --wait"
54{{ else }}
55set -x EDITOR "zeditor --wait"
56{{ end }}
57set -x VISUAL "$EDITOR"
58set -x MANPAGER "nvim +Man!"
59set -x COLUMNS 80
60set -x MANWIDTH 80
61set -x CHARM_HOST "charm.secluded.site"
62set -x RIPGREP_CONFIG_PATH "$HOME/.config/ripgreprc"
63set -x RANGER_LOAD_DEFAULT_RC false
64
65# Disable dumb Python keyring integration
66set -x PYTHON_KEYRING_BACKEND "keyring.backends.null.Keyring"
67
68set -x UV_PUBLISH_TOKEN '{{ onepasswordRead "op://Private/PyPI/uv angmar" }}'
69
70# Authenticate to local Radicle (.xyz) node
71{{ if eq .chezmoi.hostname "angmar" }}
72set -x RAD_PASSWORD '{{ onepasswordRead "op://Private/2ujzijel6ni3np2uj5k5syptzm/angmar" }}'
73{{ end }}
74{{ if eq .chezmoi.hostname "sidhe" }}
75set -x RAD_PASSWORD '{{ onepasswordRead "op://Private/2ujzijel6ni3np2uj5k5syptzm/sidhe" }}'
76{{ end }}
77
78# Auth to SourceHut
79set -x SRHT_TOKEN '{{ onepasswordRead "op://Private/SourceHut/token" }}'
80
81set -x GITHUB_AUTH_TOKEN '{{ onepasswordRead "op://Private/github.com/pac" }}'
82
83set -x JIRA_API_TOKEN '{{ onepasswordRead "op://Private/Atlassian/jira key" }}'
84set -x KAGI_API_KEY '{{ onepasswordRead "op://Shared/Kagi/api_key" }}'
85
86# LLM Crap
87set -x OPENROUTER_API_KEY '{{ onepasswordRead "op://Shared/OpenRouter/keys/shell" }}'
88set -x OPENROUTER_KEY "$OPENROUTER_API_KEY"
89set -x PARALLEL_API_KEY '{{ onepasswordRead "op://Private/Parallel.ai/api key" }}'
90set -x PERPLEXITY_API_KEY '{{ onepasswordRead "op://Private/nkhcb2h2ecfh26hksdgpw5txfu/api keys/CLI" }}'
91set -x PERPLEXITY_LENSES '{{ onepasswordRead "op://Private/nkhcb2h2ecfh26hksdgpw5txfu/lenses/text" }}'
92set -x SYNTHETIC_API_KEY '{{ onepasswordRead "op://Private/Synthetic/keys/main" }}'
93set -x MINIMAX_API_KEY '{{ onepasswordRead "op://Private/MiniMax/api_key" }}'
94set -x OLLAMA_HOST '100.108.156.33:11434'
95
96# PATHs
97fish_add_path "$XDG_DATA_HOME/npm-packages/bin"
98
99# Guix
100set -x GUIX_LOCPATH "$HOME/.guix-profile/lib/locale"
101set -x GUIX_PROFILE "$HOME/.guix-profile"
102fish_add_path "$GUIX_PROFILE/bin"
103
104# ASDF configuration
105if test -z $ASDF_DATA_DIR
106 set _asdf_shims "$HOME/.asdf/shims"
107else
108 set _asdf_shims "$ASDF_DATA_DIR/shims"
109end
110
111set -U fish_greeting
112
113# Fundle plugins
114fundle plugin 'jethrokuan/z'
115fundle plugin 'patrickf1/fzf.fish'
116fundle plugin 'franciscolourenco/done'
117fundle plugin 'agentsh' --url 'git@git.secluded.site:agentsh.git'
118fundle init
119
120if status is-interactive
121 if not functions -q fundle; eval (curl -sfL https://git.io/fundle-install); end
122
123 {{ if ne .chezmoi.hostname "sidhe" }}
124 alias zed="zeditor"
125 {{ end }}
126
127 # Bunch of aliases
128 alias wget="wget --hsts-file=\"$XDG_DATA_HOME/wget-hsts\""
129 alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion"
130 alias ts="tailscale"
131 alias datetime="date +%Y-%m-%d_%H%M%S_%Z"
132 alias clip="xclip -selection clipboard"
133 alias send="rsync -amzzP"
134 alias bat="bat -n --tabs 2"
135 alias erase="shred -vzfun 32"
136 alias dl="yt-dlp --write-sub --write-auto-sub --sub-lang en --sub-format srt/best --convert-subs srt --embed-subs -o '%(upload_date)s %(title)s.%(ext)s'"
137 alias us="unsilence -t 15 -as 1.25"
138 alias sxiv="sxiv -p"
139 alias c="chezmoi"
140 alias t="tea"
141 alias j="just"
142 alias ls="lsd"
143 alias loghtml="llm logs -ceu | mdas -h | grep '\.html\$' | read path_to_response && xdg-open \"LLM Responses/\$path_to_response\" && echo \"Opened \$path_to_response\""
144 alias soft="ssh git.secluded.site"
145 alias g="git"
146
147 # cheat.sh integration
148 function cht
149 curl cheat.sh/$argv
150 end
151
152 # register completions (on-the-fly, non-cached, because the actual command won't be cached anyway
153 complete -c cht -xa '(curl -s cheat.sh/:list)'
154
155 starship init fish | source
156 atuin init --disable-up-arrow fish | source
157 enable_transience
158end
159
160if status is-login
161 set -q SSH_AUTH_SOCK; or set -x SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/ssh-agent.socket"
162 ssh-add -l > /dev/null 2>&1
163 if test $status -ne 0
164 eval (ssh-agent -c -a "$SSH_AUTH_SOCK" > /dev/null)
165 echo "Spawned new ssh-agent. PID: $SSH_AGENT_PID"
166 end
167end
168
169# Do not use fish_add_path (added in Fish 3.2) because it
170# potentially changes the order of items in PATH
171if not contains $_asdf_shims $PATH
172 set -x --prepend PATH $_asdf_shims
173end
174set --erase _asdf_shims