d4432eba11d2abadba9115c01018c192b9bfaf04

Author
TheEdgeOfRage <git@theedgeofrage.com>
Committer
TheEdgeOfRage <git@theedgeofrage.com>
Date

Message

Improve zshrc config

Diff

 1diff --git a/.chezmoiignore b/.chezmoiignore
 2index c51a4eb65b89a883f6ea83fa02067461bd844880..4da1f04209ed2ed4beceed84e45c6d87a596a5a7 100644
 3--- a/.chezmoiignore
 4+++ b/.chezmoiignore
 5@@ -6,14 +6,14 @@ us_colemak.patch
 6 config_template.yaml
 7 .config/nvim/lazy-lock.json
 8 
 9-{{- if not .gui }}
10-# GUI-related configurations - ignored when gui=false
11+{{ if not (index . "gui" | default false) }}
12+.config/fontconfig
13+.config/ghostty
14+.config/gtk-2.0
15 .config/hypr
16-.config/waybar
17-.config/rofi
18 .config/mako
19-.config/ghostty
20+.config/rofi
21 .config/uwsm
22-.config/gtk-2.0
23+.config/waybar
24 .icons
25 {{- end }}
26diff --git a/config_template.yaml b/config_template.yaml
27index 14467668f20ec720550b71e5c234ac311083fcaa..6394e73c848b47d62364fd00c0973c56485c89c8 100644
28--- a/config_template.yaml
29+++ b/config_template.yaml
30@@ -14,12 +14,6 @@ data:
31     bottom:
32       cpu_temp_path: pci0000:00/0000:00:14.0/i2c-20/20-0050
33       cpu_temp_filename: temp1_input
34-  alacritty:
35-    font:
36-      size: '7.5'
37-      offset:
38-        x: 0
39-        y: 3
40   ghostty:
41     font:
42       size: '14'
43diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl
44index 1ca6fbdfdbf1adc04ea6fd8e99ad94f8f2510937..c92b130aa89b0a3dd32719c4e7255fbf5ae813e5 100644
45--- a/dot_zshrc.tmpl
46+++ b/dot_zshrc.tmpl
47@@ -43,8 +43,10 @@ export XDG_CONFIG_HOME="$HOME/.config"
48 export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
49 
50 # Additional env vars
51+{{- if and (hasKey . "zshrc") (kindIs "map" .zshrc) (hasKey .zshrc "env_vars") }}
52 {{ range $_, $env := .zshrc.env_vars }}export {{ $env.name }}="{{ $env.value }}"
53 {{ end }}
54+{{- end }}
55 
56 # oh-my-zsh
57 export ZSH="$HOME/.config/zsh/oh-my-zsh"
58@@ -93,11 +95,13 @@ TRAPWINCH() {
59 }
60 
61 # Load fzf
62-[[ $- == *i* ]] && source "/usr/share/fzf/completion.zsh" NO
63-source "/usr/share/fzf/key-bindings.zsh" NO
64+if [[ $- == *i* ]] && [[ -d /usr/share/fzf/ ]]; then
65+    source "/usr/share/fzf/completion.zsh" NO
66+    source "/usr/share/fzf/key-bindings.zsh" NO
67+fi
68 
69 # Pyenv settings
70-if which pyenv &> /dev/null; then
71+if type pyenv &> /dev/null; then
72 	export PYENV_ROOT="$HOME/.pyenv"
73 	export PATH="$PYENV_ROOT/bin:$PATH"
74 	eval "$(pyenv init --path)"
75@@ -107,10 +111,10 @@ fi
76 # NVM setup
77 [[ -f /usr/share/nvm/init-nvm.sh ]] && source /usr/share/nvm/init-nvm.sh
78 
79-# zoxide setup
80-eval "$(zoxide init zsh)"
81-autopair-init
82+type zoxide &> /dev/null && eval "$(zoxide init zsh)"
83+type autopair-init &> /dev/null && autopair-init
84 
85+{{ if (index . "gui" | default false) }}
86 if [ -z "${WAYLAND_DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ] && [[ $(tty) = /dev/tty1 ]]; then
87 	# hyprland on tty1
88 	exec uwsm start hyprland.desktop
89@@ -118,3 +122,4 @@ elif [[ $(tty) =~ "/dev/tty[0-9]" ]]; then
90 	# Enable unicode characters in the tty
91 	unicode_start
92 fi
93+{{- end }}