From 1173269824585d0b938f0b894b4b2a09fb3554ab Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Sat, 14 May 2022 09:48:14 -0400 Subject: [PATCH] Adding XDG settings and moving ZSH --- {dot_zsh => dot_config/zsh}/README.md | 0 {dot_zsh => dot_config/zsh}/configs/aliases.zsh | 0 {dot_zsh => dot_config/zsh}/configs/colors.zsh | 0 {dot_zsh => dot_config/zsh}/configs/editor.zsh | 0 {dot_zsh => dot_config/zsh}/configs/exports.zsh.tmpl | 0 {dot_zsh => dot_config/zsh}/configs/history.zsh | 1 - {dot_zsh => dot_config/zsh}/configs/keybindings.zsh | 0 {dot_zsh => dot_config/zsh}/configs/options.zsh | 0 {dot_zsh => dot_config/zsh}/configs/post/path.zsh | 0 dot_zshrc.tmpl => dot_config/zsh/dot_zshrc.tmpl | 6 +++--- {dot_zsh => dot_config/zsh}/functions/calc.zsh | 0 {dot_zsh => dot_config/zsh}/functions/curl_json.zsh | 0 {dot_zsh => dot_config/zsh}/functions/extract.zsh | 0 {dot_zsh => dot_config/zsh}/functions/fix.zsh | 0 {dot_zsh => dot_config/zsh}/functions/man.zsh | 0 {dot_zsh => dot_config/zsh}/functions/mktmpdir.zsh | 0 {dot_zsh => dot_config/zsh}/functions/prettyjson.zsh | 0 {dot_zsh => dot_config/zsh}/functions/server.zsh | 0 {dot_zsh => dot_config/zsh}/functions/systemload.zsh | 0 {dot_zsh => dot_config/zsh}/functions/yubikey.zsh | 0 dot_local/state/zsh/.keep | 0 dot_zshenv | 11 +++++++++++ 22 files changed, 14 insertions(+), 4 deletions(-) rename {dot_zsh => dot_config/zsh}/README.md (100%) rename {dot_zsh => dot_config/zsh}/configs/aliases.zsh (100%) rename {dot_zsh => dot_config/zsh}/configs/colors.zsh (100%) rename {dot_zsh => dot_config/zsh}/configs/editor.zsh (100%) rename {dot_zsh => dot_config/zsh}/configs/exports.zsh.tmpl (100%) rename {dot_zsh => dot_config/zsh}/configs/history.zsh (95%) rename {dot_zsh => dot_config/zsh}/configs/keybindings.zsh (100%) rename {dot_zsh => dot_config/zsh}/configs/options.zsh (100%) rename {dot_zsh => dot_config/zsh}/configs/post/path.zsh (100%) rename dot_zshrc.tmpl => dot_config/zsh/dot_zshrc.tmpl (89%) rename {dot_zsh => dot_config/zsh}/functions/calc.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/curl_json.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/extract.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/fix.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/man.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/mktmpdir.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/prettyjson.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/server.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/systemload.zsh (100%) rename {dot_zsh => dot_config/zsh}/functions/yubikey.zsh (100%) create mode 100644 dot_local/state/zsh/.keep diff --git a/dot_zsh/README.md b/dot_config/zsh/README.md similarity index 100% rename from dot_zsh/README.md rename to dot_config/zsh/README.md diff --git a/dot_zsh/configs/aliases.zsh b/dot_config/zsh/configs/aliases.zsh similarity index 100% rename from dot_zsh/configs/aliases.zsh rename to dot_config/zsh/configs/aliases.zsh diff --git a/dot_zsh/configs/colors.zsh b/dot_config/zsh/configs/colors.zsh similarity index 100% rename from dot_zsh/configs/colors.zsh rename to dot_config/zsh/configs/colors.zsh diff --git a/dot_zsh/configs/editor.zsh b/dot_config/zsh/configs/editor.zsh similarity index 100% rename from dot_zsh/configs/editor.zsh rename to dot_config/zsh/configs/editor.zsh diff --git a/dot_zsh/configs/exports.zsh.tmpl b/dot_config/zsh/configs/exports.zsh.tmpl similarity index 100% rename from dot_zsh/configs/exports.zsh.tmpl rename to dot_config/zsh/configs/exports.zsh.tmpl diff --git a/dot_zsh/configs/history.zsh b/dot_config/zsh/configs/history.zsh similarity index 95% rename from dot_zsh/configs/history.zsh rename to dot_config/zsh/configs/history.zsh index 74d0b02..af874b5 100644 --- a/dot_zsh/configs/history.zsh +++ b/dot_config/zsh/configs/history.zsh @@ -11,4 +11,3 @@ setopt hist_verify # Do not submit history searches before allowing f #HISTCONTRO=ignoreboth:erasedups # Ignore duplicates in the history and commands starting with space HISTSIZE=10000 SAVEHIST=10000 -HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history diff --git a/dot_zsh/configs/keybindings.zsh b/dot_config/zsh/configs/keybindings.zsh similarity index 100% rename from dot_zsh/configs/keybindings.zsh rename to dot_config/zsh/configs/keybindings.zsh diff --git a/dot_zsh/configs/options.zsh b/dot_config/zsh/configs/options.zsh similarity index 100% rename from dot_zsh/configs/options.zsh rename to dot_config/zsh/configs/options.zsh diff --git a/dot_zsh/configs/post/path.zsh b/dot_config/zsh/configs/post/path.zsh similarity index 100% rename from dot_zsh/configs/post/path.zsh rename to dot_config/zsh/configs/post/path.zsh diff --git a/dot_zshrc.tmpl b/dot_config/zsh/dot_zshrc.tmpl similarity index 89% rename from dot_zshrc.tmpl rename to dot_config/zsh/dot_zshrc.tmpl index 02eb546..c70089d 100644 --- a/dot_zshrc.tmpl +++ b/dot_config/zsh/dot_zshrc.tmpl @@ -1,9 +1,9 @@ # load custom executable functions -for function in ~/.zsh/functions/*; do +for function in "$ZDOTDIR"/functions/*; do source $function done -# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post +# extra files in $ZDOTDIR/configs/pre , $ZDOTDIR/configs , and $ZDOTDIR/configs/post # these are loaded first, second, and third, respectively. _load_settings() { _dir="$1" @@ -32,7 +32,7 @@ _load_settings() { fi fi } -_load_settings "$HOME/.zsh/configs" +_load_settings "$ZDOTDIR/configs" declare -A hostname_colors diff --git a/dot_zsh/functions/calc.zsh b/dot_config/zsh/functions/calc.zsh similarity index 100% rename from dot_zsh/functions/calc.zsh rename to dot_config/zsh/functions/calc.zsh diff --git a/dot_zsh/functions/curl_json.zsh b/dot_config/zsh/functions/curl_json.zsh similarity index 100% rename from dot_zsh/functions/curl_json.zsh rename to dot_config/zsh/functions/curl_json.zsh diff --git a/dot_zsh/functions/extract.zsh b/dot_config/zsh/functions/extract.zsh similarity index 100% rename from dot_zsh/functions/extract.zsh rename to dot_config/zsh/functions/extract.zsh diff --git a/dot_zsh/functions/fix.zsh b/dot_config/zsh/functions/fix.zsh similarity index 100% rename from dot_zsh/functions/fix.zsh rename to dot_config/zsh/functions/fix.zsh diff --git a/dot_zsh/functions/man.zsh b/dot_config/zsh/functions/man.zsh similarity index 100% rename from dot_zsh/functions/man.zsh rename to dot_config/zsh/functions/man.zsh diff --git a/dot_zsh/functions/mktmpdir.zsh b/dot_config/zsh/functions/mktmpdir.zsh similarity index 100% rename from dot_zsh/functions/mktmpdir.zsh rename to dot_config/zsh/functions/mktmpdir.zsh diff --git a/dot_zsh/functions/prettyjson.zsh b/dot_config/zsh/functions/prettyjson.zsh similarity index 100% rename from dot_zsh/functions/prettyjson.zsh rename to dot_config/zsh/functions/prettyjson.zsh diff --git a/dot_zsh/functions/server.zsh b/dot_config/zsh/functions/server.zsh similarity index 100% rename from dot_zsh/functions/server.zsh rename to dot_config/zsh/functions/server.zsh diff --git a/dot_zsh/functions/systemload.zsh b/dot_config/zsh/functions/systemload.zsh similarity index 100% rename from dot_zsh/functions/systemload.zsh rename to dot_config/zsh/functions/systemload.zsh diff --git a/dot_zsh/functions/yubikey.zsh b/dot_config/zsh/functions/yubikey.zsh similarity index 100% rename from dot_zsh/functions/yubikey.zsh rename to dot_config/zsh/functions/yubikey.zsh diff --git a/dot_local/state/zsh/.keep b/dot_local/state/zsh/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_zshenv b/dot_zshenv index cf63b19..56b3647 100644 --- a/dot_zshenv +++ b/dot_zshenv @@ -1,3 +1,14 @@ +# Ensure XDG locations are defined +export XDG_CONFIG_HOME="$HOME"/.config +export XDG_CACHE_HOME="$HOME"/.cache +export XDG_DATA_HOME="$HOME"/.local/share +export XDG_STATE_HOME="$HOME"/.local/state + +# Move most of ZSH into XDG locations +export ZDOTDIR="$XDG_CONFIG_HOME"/zsh +export HISTFILE="$XDG_STATE_HOME"/zsh/history + + # Taken from https://github.com/thoughtbot/dotfiles/blob/master/zshenv local _old_path="$PATH"