summaryrefslogtreecommitdiff
path: root/dots/zsh/.config
diff options
context:
space:
mode:
authorHunt <lizhunt@amazon.com>2025-06-03 11:58:25 -0700
committerHunt <lizhunt@amazon.com>2025-06-03 11:58:25 -0700
commitee9ad10b5cc9850c3e2ed1946f70e0cef429fb48 (patch)
treeb6b0411b02127951cc28292425a35a1830c2758d /dots/zsh/.config
parent64d060d2730cd212b2932879036eb33f7336ef38 (diff)
downloaddotfiles-ee9ad10b5cc9850c3e2ed1946f70e0cef429fb48.tar.gz
dotfiles-ee9ad10b5cc9850c3e2ed1946f70e0cef429fb48.zip
Refactor
Diffstat (limited to 'dots/zsh/.config')
-rw-r--r--dots/zsh/.config/zsh/.zshrc18
-rwxr-xr-xdots/zsh/.config/zsh/linux/init.zsh6
-rwxr-xr-xdots/zsh/.config/zsh/linux/linux.init.zsh1
-rwxr-xr-xdots/zsh/.config/zsh/osx/armin.zsh2
-rwxr-xr-xdots/zsh/.config/zsh/osx/osx.init.zsh (renamed from dots/zsh/.config/zsh/osx/init.zsh)4
-rwxr-xr-xdots/zsh/.config/zsh/osx/work.zsh7
-rwxr-xr-xdots/zsh/.config/zsh/setup/device.zsh10
-rw-r--r--dots/zsh/.config/zsh/setup/env.zsh.j217
-rwxr-xr-xdots/zsh/.config/zsh/setup/gpg.zsh.j27
-rwxr-xr-xdots/zsh/.config/zsh/setup/keybinds.zsh (renamed from dots/zsh/.config/zsh/setup/misc.zsh)0
10 files changed, 38 insertions, 34 deletions
diff --git a/dots/zsh/.config/zsh/.zshrc b/dots/zsh/.config/zsh/.zshrc
index bc445ae..e05eddf 100644
--- a/dots/zsh/.config/zsh/.zshrc
+++ b/dots/zsh/.config/zsh/.zshrc
@@ -3,15 +3,23 @@
#-- <startup> --
export XDG_CONFIG_HOME="$HOME/.config"
export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh
-export PATH=$PATH:$HOME/scripts:$HOME/.local/bin
+#-- </startup> --
+
+#-- <env> --
+. "$ZDOTDIR/setup/env.zsh"
+#-- </env> --
+#-- <log> --
source log.sh ".zshrc"
+#-- </log> --
+
+#-- <greet> --
greet.sh
-#-- </startup> --
+#-- </greet> --
-#-- <misc> --
-. "$ZDOTDIR/setup/misc.zsh"
-#-- </misc> --
+#-- <keybinds> --
+. "$ZDOTDIR/setup/keybinds.zsh"
+#-- </keybinds> --
#-- <common_aliases> --
. "$ZDOTDIR/setup/aliases.zsh"
diff --git a/dots/zsh/.config/zsh/linux/init.zsh b/dots/zsh/.config/zsh/linux/init.zsh
deleted file mode 100755
index 49db77e..0000000
--- a/dots/zsh/.config/zsh/linux/init.zsh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/zsh
-
-#-- <gpg> --
-export PINENTRY_USER_DATA="PINENTRY_USE_QT"
-#-- </gpg> --
-
diff --git a/dots/zsh/.config/zsh/linux/linux.init.zsh b/dots/zsh/.config/zsh/linux/linux.init.zsh
new file mode 100755
index 0000000..f7df9c2
--- /dev/null
+++ b/dots/zsh/.config/zsh/linux/linux.init.zsh
@@ -0,0 +1 @@
+#!/bin/zsh
diff --git a/dots/zsh/.config/zsh/osx/armin.zsh b/dots/zsh/.config/zsh/osx/armin.zsh
index cc54a2e..f7df9c2 100755
--- a/dots/zsh/.config/zsh/osx/armin.zsh
+++ b/dots/zsh/.config/zsh/osx/armin.zsh
@@ -1,3 +1 @@
#!/bin/zsh
-
-
diff --git a/dots/zsh/.config/zsh/osx/init.zsh b/dots/zsh/.config/zsh/osx/osx.init.zsh
index 0cb288d..f60c2bc 100755
--- a/dots/zsh/.config/zsh/osx/init.zsh
+++ b/dots/zsh/.config/zsh/osx/osx.init.zsh
@@ -7,7 +7,3 @@ eval "$(/opt/homebrew/bin/brew shellenv)"
# use gnu coreutils
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
#-- </brew> --
-
-#-- <gpg> --
-export PINENTRY_USER_DATA="PINENTRY_USE_MAC"
-#-- </gpg> --
diff --git a/dots/zsh/.config/zsh/osx/work.zsh b/dots/zsh/.config/zsh/osx/work.zsh
index 6fff676..19b9bcd 100755
--- a/dots/zsh/.config/zsh/osx/work.zsh
+++ b/dots/zsh/.config/zsh/osx/work.zsh
@@ -1,13 +1,7 @@
#!/bin/zsh
#-- <amzn> --
-export AWS_REGION=us-west-2
-
-# finch
-export DOCKER_HOST=unix:///Applications/Finch/lima/data/finch/sock/finch.sock
-
# bb ...
-export PATH="$PATH:$HOME/.toolbox/bin"
alias bb='brazil-build'
alias bba='brazil-build apollo-pkg'
alias bre='brazil-runtime-exec'
@@ -26,4 +20,3 @@ alias brazil-recursive-cmd='brazil-recursive-cmd-parallel'
# run java repl with class path of package! :D
alias jshell='jshell --class-path "`brazil-path build.classpath`:`brazil-path run.classpath`"'
#-- </amzn> --
-
diff --git a/dots/zsh/.config/zsh/setup/device.zsh b/dots/zsh/.config/zsh/setup/device.zsh
index d3f8c4b..cd7965e 100755
--- a/dots/zsh/.config/zsh/setup/device.zsh
+++ b/dots/zsh/.config/zsh/setup/device.zsh
@@ -5,23 +5,23 @@ source log.sh "setup/device.zsh"
#-- <os_init> --
platform="$(platform.sh)"
platform_setup="$ZDOTDIR/$platform"
-init_platform="$platform_setup/init.zsh"
+init_platform="$platform_setup/$platform.init.zsh"
if [ ! -d "$platform_setup" ]; then
log ERROR "misconfigured platform $platform: $platform_setup is not a directory"
exit 1
fi
-if [ -e "$init_platform" ]; then
+if [ -e "$init_platform" ]; then
log DEBUG "executing $init_platform"
. "$init_platform"
-else
+else
log DEBUG "no platform-specific init for $platform at $init_platform"
fi
#-- </os_init> --
#-- <machine_init> --
machine="$(system_name.sh)"
-machine_init="$platform_setup/$machine.zsh"
-if [ -e "$machine_init" ]; then
+machine_init="$platform_setup/$machine.zsh"
+if [ -e "$machine_init" ]; then
log DEBUG "executing $platform.$machine $machine_init"
. "$machine_init"
else
diff --git a/dots/zsh/.config/zsh/setup/env.zsh.j2 b/dots/zsh/.config/zsh/setup/env.zsh.j2
new file mode 100644
index 0000000..194e20e
--- /dev/null
+++ b/dots/zsh/.config/zsh/setup/env.zsh.j2
@@ -0,0 +1,17 @@
+#!/bin/zsh
+
+#-- <context.env> --
+{% for key,val in env.items() %}
+export {{ key }}={{ val }}
+{% endfor %}
+#-- </context.env> --
+
+#-- <context.paths.prefix> --
+# {{ paths.prefix.keys() | join(", ") }}
+export PATH="{{ paths.prefix.values() | join(":") }}:$PATH"
+#-- </context.paths.prefix> --
+
+#-- <context.paths.suffix> --
+# {{ paths.suffix.keys() | join(", ") }}
+export PATH="$PATH:{{ paths.suffix.values() | join(":") }}"
+#-- </context.paths.suffix> --
diff --git a/dots/zsh/.config/zsh/setup/gpg.zsh.j2 b/dots/zsh/.config/zsh/setup/gpg.zsh.j2
index 4ffb38f..ea5a418 100755
--- a/dots/zsh/.config/zsh/setup/gpg.zsh.j2
+++ b/dots/zsh/.config/zsh/setup/gpg.zsh.j2
@@ -1,20 +1,17 @@
#!/bin/zsh
-
# -- <gpg> --
KEY_ID="{{ pgp.id }}"
gpg -k "$KEY_ID" >/dev/null 2>&1 || gpg --import "$HOME/.pubkey"
-cp $HOME/scripts/pinentry.sh /tmp/pinentry
-
-
export PINENTRY_USER_DATA="${PINENTRY_USER_DATA:-PINENTRY_USE_TTY}"
if [ "$SSH_CLIENT" ]; then
export PINENTRY_USER_DATA=PINENTRY_USE_CURSES
exit 0
fi
-# yubikey!
+# yubikey ssh, gpg, and the works!
+# https://github.com/drduh/YubiKey-Guide
unset SSH_AGENT_PID
export GPG_TTY=$(tty)
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
diff --git a/dots/zsh/.config/zsh/setup/misc.zsh b/dots/zsh/.config/zsh/setup/keybinds.zsh
index f301dcc..f301dcc 100755
--- a/dots/zsh/.config/zsh/setup/misc.zsh
+++ b/dots/zsh/.config/zsh/setup/keybinds.zsh