···
8
-
programs.oh-my-posh = {
10
-
enableZshIntegration = true;
19
-
console_title_template = "{{ .Shell }} in {{ .Folder }}";
29
-
background = "transparent";
30
-
foreground = "blue";
31
-
template = "{{ .Path }} ";
39
-
foreground = "p:grey";
40
-
background = "transparent";
41
-
template = "{{if not .Detached}}{{ .HEAD }}{{else}}@{{ printf \"%.7s\" .Commit.Sha }}{{end}}{{ if .Staging.Changed }} ({{ .Staging.String }}){{ end }}{{ if .Working.Changed }}*{{ end }} <cyan>{{ if .BranchStatus }}{{ .BranchStatus }}{{ end }}</>";
44
-
branch_identical_icon = "";
45
-
branch_gone_icon = "";
46
-
branch_ahead_icon = "⇡";
47
-
branch_behind_icon = "⇣";
49
-
fetch_status = true;
9
+
programs.oh-my-posh = {
11
+
enableZshIntegration = true;
20
+
console_title_template = "{{ .Shell }} in {{ .Folder }}";
29
+
background = "transparent";
30
+
foreground = "yellow";
31
+
template = "{{ if .SSHSession }}{{.HostName}} {{ end }}";
36
+
background = "transparent";
37
+
foreground = "blue";
38
+
template = "{{ .Path }} ";
46
+
foreground = "p:grey";
47
+
background = "transparent";
48
+
template = "{{if not .Detached}}{{ .HEAD }}{{else}}@{{ printf \"%.7s\" .Commit.Sha }}{{end}}{{ if .Staging.Changed }} ({{ .Staging.String }}){{ end }}{{ if .Working.Changed }}*{{ end }} <cyan>{{ if .BranchStatus }}{{ .BranchStatus }}{{ end }}</>";
51
+
branch_identical_icon = "";
52
+
branch_gone_icon = "";
53
+
branch_ahead_icon = "⇡";
54
+
branch_behind_icon = "⇣";
56
+
fetch_status = true;
63
+
overflow = "hidden";
66
+
type = "executiontime";
68
+
foreground = "yellow";
69
+
background = "transparent";
70
+
template = "{{ .FormattedMs }}";
79
+
background = "transparent";
80
+
template = ''{{if ne .Type "unknown" }} {{ .Type }}{{ end }}'';
92
+
foreground_templates = [
93
+
"{{if gt .Code 0}}red{{end}}"
94
+
"{{if eq .Code 0}}magenta{{end}}"
96
+
background = "transparent";
102
+
transient_prompt = {
103
+
foreground_templates = [
104
+
"{{if gt .Code 0}}red{{end}}"
105
+
"{{if eq .Code 0}}magenta{{end}}"
56
-
overflow = "hidden";
59
-
type = "executiontime";
61
-
foreground = "yellow";
62
-
background = "transparent";
63
-
template = "{{ .FormattedMs }}";
72
-
background = "transparent";
73
-
template = ''{{if ne .Type "unknown" }} {{ .Type }}{{ end }}'';
85
-
foreground_templates = [
86
-
"{{if gt .Code 0}}red{{end}}"
87
-
"{{if eq .Code 0}}magenta{{end}}"
89
-
background = "transparent";
95
-
transient_prompt = {
96
-
foreground_templates = [
97
-
"{{if gt .Code 0}}red{{end}}"
98
-
"{{if eq .Code 0}}magenta{{end}}"
100
-
background = "transparent";
103
-
secondary_prompt = {
104
-
foreground = "p:gray";
105
-
background = "transparent";
107
+
background = "transparent";
110
+
secondary_prompt = {
111
+
foreground = "p:gray";
112
+
background = "transparent";
116
-
enableCompletion = true;
117
-
syntaxHighlighting.enable = true;
123
+
enableCompletion = true;
124
+
syntaxHighlighting.enable = true;
128
-
ghrpc = "gh repo create -c";
129
-
goops = "git commit --amend --no-edit && git push --force-with-lease";
130
-
chngwall = "~/.config/hypr/randomize.sh";
135
-
#ssh auto reconnect
140
-
ssh -p $port -o "BatchMode yes" $host || sleep 1
143
-
# hackatime summary
147
-
"https://waka.hackclub.com/api/summary?user=''${user_id}&interval=month" \
148
-
-H 'accept: application/json' \
149
-
-H 'Authorization: Bearer 2ce9e698-8a16-46f0-b49a-ac121bcfd608' | jq '. + {
150
-
"total_categories_sum": (.categories | map(.total) | add),
151
-
"total_categories_human_readable": (
152
-
(.categories | map(.total) | add) as $total_seconds |
153
-
"\($total_seconds / 3600 | floor)h \(($total_seconds % 3600) / 60 | floor)m \($total_seconds % 60)s"
156
-
.projects | sort_by(-.total) | map(.key)
135
+
ghrpc = "gh repo create -c";
136
+
goops = "git commit --amend --no-edit && git push --force-with-lease";
137
+
chngwall = "~/.config/hypr/randomize.sh";
142
+
#ssh auto reconnect
147
+
ssh -p $port -o "BatchMode yes" $host || sleep 1
150
+
# hackatime summary
154
+
"https://waka.hackclub.com/api/summary?user=''${user_id}&interval=month" \
155
+
-H 'accept: application/json' \
156
+
-H 'Authorization: Bearer 2ce9e698-8a16-46f0-b49a-ac121bcfd608' | jq '. + {
157
+
"total_categories_sum": (.categories | map(.total) | add),
158
+
"total_categories_human_readable": (
159
+
(.categories | map(.total) | add) as $total_seconds |
160
+
"\($total_seconds / 3600 | floor)h \(($total_seconds % 3600) / 60 | floor)m \($total_seconds % 60)s"
163
+
.projects | sort_by(-.total) | map(.key)
169
+
# Configuration variables - set these to your defaults
170
+
local default_plc_id="did:plc:krxbvxvis5skq7jj6eot23ul"
171
+
local default_github_username="taciturnaxolotl"
172
+
local extracted_github_username=""
162
-
# Configuration variables - set these to your defaults
163
-
local default_plc_id="did:plc:krxbvxvis5skq7jj6eot23ul"
164
-
local default_github_username="taciturnaxolotl"
165
-
local extracted_github_username=""
174
+
# Check if current directory is a git repository
175
+
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
176
+
echo "Not a git repository"
167
-
# Check if current directory is a git repository
168
-
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
169
-
echo "Not a git repository"
180
+
# Get the repository name from the current directory
181
+
local repo_name=$(basename "$(git rev-parse --show-toplevel)")
173
-
# Get the repository name from the current directory
174
-
local repo_name=$(basename "$(git rev-parse --show-toplevel)")
183
+
# Check if origin remote exists and points to ember
184
+
local origin_url=$(git remote get-url origin 2>/dev/null)
185
+
local origin_ember=false
176
-
# Check if origin remote exists and points to ember
177
-
local origin_url=$(git remote get-url origin 2>/dev/null)
178
-
local origin_ember=false
187
+
if [[ -n "$origin_url" ]]; then
188
+
# Try to extract GitHub username if origin is a GitHub URL
189
+
if [[ "$origin_url" == *"github.com"* ]]; then
190
+
extracted_github_username=$(echo "$origin_url" | sed -E 's/.*github\.com[:/]([^/]+)\/.*$/\1/')
191
+
# Override the default username with the extracted one
192
+
default_github_username=$extracted_github_username
180
-
if [[ -n "$origin_url" ]]; then
181
-
# Try to extract GitHub username if origin is a GitHub URL
182
-
if [[ "$origin_url" == *"github.com"* ]]; then
183
-
extracted_github_username=$(echo "$origin_url" | sed -E 's/.*github\.com[:/]([^/]+)\/.*$/\1/')
184
-
# Override the default username with the extracted one
185
-
default_github_username=$extracted_github_username
195
+
if [[ "$origin_url" == *"ember"* ]]; then
197
+
echo "✅ Origin remote exists and points to ember"
199
+
echo "⚠️ Origin remote exists but doesn't point to ember"
202
+
echo "⚠️ Origin remote doesn't exist"
188
-
if [[ "$origin_url" == *"ember"* ]]; then
190
-
echo "✅ Origin remote exists and points to ember"
205
+
# Check if github remote exists
206
+
local github_exists=false
207
+
if git remote get-url github &>/dev/null; then
209
+
echo "✅ GitHub remote exists"
192
-
echo "⚠️ Origin remote exists but doesn't point to ember"
211
+
echo "⚠️ GitHub remote doesn't exist"
195
-
echo "⚠️ Origin remote doesn't exist"
198
-
# Check if github remote exists
199
-
local github_exists=false
200
-
if git remote get-url github &>/dev/null; then
202
-
echo "✅ GitHub remote exists"
204
-
echo "⚠️ GitHub remote doesn't exist"
214
+
# Fix remotes if needed
215
+
if [[ "$origin_ember" = false || "$github_exists" = false ]]; then
216
+
echo "Setting up remotes..."
207
-
# Fix remotes if needed
208
-
if [[ "$origin_ember" = false || "$github_exists" = false ]]; then
209
-
echo "Setting up remotes..."
218
+
# Prompt for PLC identifier if needed
220
+
if [[ "$origin_ember" = false ]]; then
221
+
echo -n "Enter your PLC identifier [default: $default_plc_id]: "
223
+
plc_id=''${plc_input:-$default_plc_id}
211
-
# Prompt for PLC identifier if needed
213
-
if [[ "$origin_ember" = false ]]; then
214
-
echo -n "Enter your PLC identifier [default: $default_plc_id]: "
216
-
plc_id=''${plc_input:-$default_plc_id}
226
+
# Prompt for GitHub username with default from origin if available
227
+
local github_username=""
228
+
if [[ "$github_exists" = false ]]; then
229
+
echo -n "Enter your GitHub username [default: $default_github_username]: "
231
+
github_username=''${github_input:-$default_github_username}
219
-
# Prompt for GitHub username with default from origin if available
220
-
local github_username=""
221
-
if [[ "$github_exists" = false ]]; then
222
-
echo -n "Enter your GitHub username [default: $default_github_username]: "
224
-
github_username=''${github_input:-$default_github_username}
234
+
# Set up origin remote if needed
235
+
if [[ "$origin_ember" = false && -n "$plc_id" ]]; then
236
+
if git remote get-url origin &>/dev/null; then
237
+
git remote remove origin
239
+
git remote add origin "git@ember:''${plc_id}/''${repo_name}"
240
+
echo "✅ Set up origin remote: git@ember:''${plc_id}/''${repo_name}"
227
-
# Set up origin remote if needed
228
-
if [[ "$origin_ember" = false && -n "$plc_id" ]]; then
229
-
if git remote get-url origin &>/dev/null; then
230
-
git remote remove origin
243
+
# Set up GitHub remote if needed
244
+
if [[ "$github_exists" = false && -n "$github_username" ]]; then
245
+
git remote add github "git@github.com:''${github_username}/''${repo_name}.git"
246
+
echo "✅ Set up GitHub remote: git@github.com:''${github_username}/''${repo_name}.git"
232
-
git remote add origin "git@ember:''${plc_id}/''${repo_name}"
233
-
echo "✅ Set up origin remote: git@ember:''${plc_id}/''${repo_name}"
249
+
echo "Remotes are correctly configured"
236
-
# Set up GitHub remote if needed
237
-
if [[ "$github_exists" = false && -n "$github_username" ]]; then
238
-
git remote add github "git@github.com:''${github_username}/''${repo_name}.git"
239
-
echo "✅ Set up GitHub remote: git@github.com:''${github_username}/''${repo_name}.git"
253
+
# Post AtProto status updates
256
+
local prompt_message=true
257
+
local account1_name=""
258
+
local account2_name=""
259
+
local account1_jwt=""
260
+
local account2_jwt=""
262
+
# Load account information from agenix secrets
263
+
if [[ -f "/run/agenix/bluesky" ]]; then
264
+
source "/run/agenix/bluesky"
266
+
echo "Error: Bluesky credentials file not found at /run/agenix/bluesky"
242
-
echo "Remotes are correctly configured"
246
-
# Post AtProto status updates
249
-
local prompt_message=true
250
-
local account1_name=""
251
-
local account2_name=""
252
-
local account1_jwt=""
253
-
local account2_jwt=""
271
+
while [[ $# -gt 0 ]]; do
275
+
prompt_message=false
279
+
echo "Usage: now [-m|--message \"your message\"]"
255
-
# Load account information from agenix secrets
256
-
if [[ -f "/run/agenix/bluesky" ]]; then
257
-
source "/run/agenix/bluesky"
259
-
echo "Error: Bluesky credentials file not found at /run/agenix/bluesky"
285
+
# Prompt for message if none provided
286
+
if [[ "$prompt_message" = true ]]; then
287
+
echo -n "$ACCOUNT1 is: "
264
-
while [[ $# -gt 0 ]]; do
268
-
prompt_message=false
272
-
echo "Usage: now [-m|--message \"your message\"]"
290
+
if [[ -z "$message" ]]; then
291
+
echo "No message provided. Aborting."
296
+
# Generate JWT for ACCOUNT1
297
+
local account1_response=$(curl -s -X POST \
298
+
-H "Content-Type: application/json" \
300
+
"identifier": "'$ACCOUNT1'",
301
+
"password": "'$ACCOUNT1_PASSWORD'"
303
+
"https://bsky.social/xrpc/com.atproto.server.createSession")
278
-
# Prompt for message if none provided
279
-
if [[ "$prompt_message" = true ]]; then
280
-
echo -n "$ACCOUNT1 is: "
305
+
account1_jwt=$(echo "$account1_response" | jq -r '.accessJwt')
283
-
if [[ -z "$message" ]]; then
284
-
echo "No message provided. Aborting."
307
+
if [[ -z "$account1_jwt" || "$account1_jwt" == "null" ]]; then
308
+
echo "Failed to authenticate account $ACCOUNT1"
309
+
echo "Response: $account1_response"
289
-
# Generate JWT for ACCOUNT1
290
-
local account1_response=$(curl -s -X POST \
291
-
-H "Content-Type: application/json" \
293
-
"identifier": "'$ACCOUNT1'",
294
-
"password": "'$ACCOUNT1_PASSWORD'"
296
-
"https://bsky.social/xrpc/com.atproto.server.createSession")
313
+
# Generate JWT for ACCOUNT2
314
+
local account2_response=$(curl -s -X POST \
315
+
-H "Content-Type: application/json" \
317
+
"identifier": "'$ACCOUNT2'",
318
+
"password": "'$ACCOUNT2_PASSWORD'"
320
+
"https://bsky.social/xrpc/com.atproto.server.createSession")
298
-
account1_jwt=$(echo "$account1_response" | jq -r '.accessJwt')
322
+
account2_jwt=$(echo "$account2_response" | jq -r '.accessJwt')
300
-
if [[ -z "$account1_jwt" || "$account1_jwt" == "null" ]]; then
301
-
echo "Failed to authenticate account $ACCOUNT1"
302
-
echo "Response: $account1_response"
324
+
if [[ -z "$account2_jwt" || "$account2_jwt" == "null" ]]; then
325
+
echo "Failed to authenticate account $ACCOUNT2"
326
+
echo "Response: $account2_response"
306
-
# Generate JWT for ACCOUNT2
307
-
local account2_response=$(curl -s -X POST \
308
-
-H "Content-Type: application/json" \
310
-
"identifier": "'$ACCOUNT2'",
311
-
"password": "'$ACCOUNT2_PASSWORD'"
313
-
"https://bsky.social/xrpc/com.atproto.server.createSession")
330
+
# Post to ACCOUNT1 as a.status.updates
331
+
local account1_post_response=$(curl -s -X POST \
332
+
-H "Content-Type: application/json" \
333
+
-H "Authorization: Bearer $account1_jwt" \
335
+
"collection": "a.status.update",
336
+
"repo": "'$ACCOUNT1'",
338
+
"$type": "a.status.update",
339
+
"text": "'"$message"'",
340
+
"createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
343
+
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
315
-
account2_jwt=$(echo "$account2_response" | jq -r '.accessJwt')
317
-
if [[ -z "$account2_jwt" || "$account2_jwt" == "null" ]]; then
318
-
echo "Failed to authenticate account $ACCOUNT2"
319
-
echo "Response: $account2_response"
323
-
# Post to ACCOUNT1 as a.status.updates
324
-
local account1_post_response=$(curl -s -X POST \
325
-
-H "Content-Type: application/json" \
326
-
-H "Authorization: Bearer $account1_jwt" \
328
-
"collection": "a.status.update",
329
-
"repo": "'$ACCOUNT1'",
331
-
"$type": "a.status.update",
332
-
"text": "'"$message"'",
333
-
"createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
336
-
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
345
+
if [[ $(echo "$account1_post_response" | jq -r 'has("error")') == "true" ]]; then
346
+
echo "Error posting to $ACCOUNT1:"
347
+
echo "$account1_post_response" | jq
338
-
if [[ $(echo "$account1_post_response" | jq -r 'has("error")') == "true" ]]; then
339
-
echo "Error posting to $ACCOUNT1:"
340
-
echo "$account1_post_response" | jq
351
+
# Post to ACCOUNT2 as normal post
352
+
local account2_post_response=$(curl -s -X POST \
353
+
-H "Content-Type: application/json" \
354
+
-H "Authorization: Bearer $account2_jwt" \
356
+
"collection": "app.bsky.feed.post",
357
+
"repo": "'$ACCOUNT2'",
359
+
"$type": "app.bsky.feed.post",
360
+
"text": "'"$message"'",
361
+
"createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
364
+
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
344
-
# Post to ACCOUNT2 as normal post
345
-
local account2_post_response=$(curl -s -X POST \
346
-
-H "Content-Type: application/json" \
347
-
-H "Authorization: Bearer $account2_jwt" \
349
-
"collection": "app.bsky.feed.post",
350
-
"repo": "'$ACCOUNT2'",
352
-
"$type": "app.bsky.feed.post",
353
-
"text": "'"$message"'",
354
-
"createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
357
-
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
366
+
if [[ $(echo "$account2_post_response" | jq -r 'has("error")') == "true" ]]; then
367
+
echo "Error posting to $ACCOUNT2:"
368
+
echo "$account2_post_response" | jq
359
-
if [[ $(echo "$account2_post_response" | jq -r 'has("error")') == "true" ]]; then
360
-
echo "Error posting to $ACCOUNT2:"
361
-
echo "$account2_post_response" | jq
375
+
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
376
+
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
377
+
zstyle ':completion:*' menu no
378
+
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
379
+
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
368
-
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
369
-
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
370
-
zstyle ':completion:*' menu no
371
-
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
372
-
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
381
+
eval "$(terminal-wakatime init)"
385
+
path = "${config.xdg.dataHome}/zsh/history";
387
+
ignoreAllDups = true;
388
+
ignoreSpace = true;
389
+
expireDuplicatesFirst = true;
374
-
eval "$(terminal-wakatime init)"
378
-
path = "${config.xdg.dataHome}/zsh/history";
380
-
ignoreAllDups = true;
381
-
ignoreSpace = true;
382
-
expireDuplicatesFirst = true;
402
+
"command-not-found"
403
+
"colored-man-pages"
395
-
"command-not-found"
396
-
"colored-man-pages"
409
+
# will source zsh-autosuggestions.plugin.zsh
410
+
name = "zsh-autosuggestions";
411
+
src = pkgs.fetchFromGitHub {
412
+
owner = "zsh-users";
413
+
repo = "zsh-autosuggestions";
415
+
sha256 = "sha256-KLUYpUu4DHRumQZ3w59m9aTW6TBKMCXl2UcKi4uMd7w=";
419
+
# will source zsh-sytax-highlighting
420
+
name = "zsh-sytax-highlighting";
421
+
src = pkgs.fetchFromGitHub {
422
+
owner = "zsh-users";
423
+
repo = "zsh-syntax-highlighting";
425
+
sha256 = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo=";
429
+
# fzf tab completion
431
+
src = pkgs.fetchFromGitHub {
435
+
sha256 = "sha256-Qv8zAiMtrr67CbLRrFjGaPzFZcOiMVEFLg1Z+N6VMhg=";
402
-
# will source zsh-autosuggestions.plugin.zsh
403
-
name = "zsh-autosuggestions";
404
-
src = pkgs.fetchFromGitHub {
405
-
owner = "zsh-users";
406
-
repo = "zsh-autosuggestions";
408
-
sha256 = "sha256-KLUYpUu4DHRumQZ3w59m9aTW6TBKMCXl2UcKi4uMd7w=";
412
-
# will source zsh-sytax-highlighting
413
-
name = "zsh-sytax-highlighting";
414
-
src = pkgs.fetchFromGitHub {
415
-
owner = "zsh-users";
416
-
repo = "zsh-syntax-highlighting";
418
-
sha256 = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo=";
422
-
# fzf tab completion
424
-
src = pkgs.fetchFromGitHub {
428
-
sha256 = "sha256-Qv8zAiMtrr67CbLRrFjGaPzFZcOiMVEFLg1Z+N6VMhg=";
441
+
programs.zoxide = {
443
+
enableZshIntegration = true;
434
-
programs.zoxide = {
436
-
enableZshIntegration = true;
441
-
enableZshIntegration = true;
443
-
bg = lib.mkForce "";
448
+
enableZshIntegration = true;
450
+
bg = lib.mkForce "";
451
-
sync_frequency = "5m";
452
-
sync_address = "https://api.atuin.sh";
453
-
search_mode = "fuzzy";
454
-
#session_path = config.age.secrets."atuin-session".path;
455
-
#key_path = config.age.secrets."atuin-key".path;
456
-
update_check = false;
458
-
sync.records = true;
459
-
dotfiles.enabled = false;
458
+
sync_frequency = "5m";
459
+
sync_address = "https://api.atuin.sh";
460
+
search_mode = "fuzzy";
461
+
#session_path = config.age.secrets."atuin-session".path;
462
+
#key_path = config.age.secrets."atuin-key".path;
463
+
update_check = false;
465
+
sync.records = true;
466
+
dotfiles.enabled = false;