From 65f1d3c25364e4b9574789c48e2a8e2837891359 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Tue, 16 Jan 2024 16:41:19 -0600 Subject: [PATCH] refactor(zsh): improve handling of XDG dirs --- dots/.config/zsh/config/init.zsh | 13 ++++++------- dots/.config/zsh/config/profile/profile/options.zsh | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dots/.config/zsh/config/init.zsh b/dots/.config/zsh/config/init.zsh index 649c490d..3a4eba87 100644 --- a/dots/.config/zsh/config/init.zsh +++ b/dots/.config/zsh/config/init.zsh @@ -1,13 +1,12 @@ #!/usr/bin/env zsh configure() { - export XDG_CONFIG_HOME="${HOME}/.config" - export XDG_CACHE_HOME="${HOME}/.cache" - export XDG_BIN_HOME="${HOME}/.local/bin" - export XDG_DATA_HOME="${HOME}/.local/share" - export XDG_STATE_HOME="${HOME}/.local/state" - export XDG_DATA_DIRS="${XDG_DATA_DIRS}:/usr/local/share:/usr/share" - export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS}:/etc/xdg" + export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" + export XDG_CACHE_HOME="${XDG_CONFIG_HOME:-$HOME/.cache}" + export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" + export XDG_STATE_HOME="${XDG_DATA_HOME:-$HOME/.local/state}" + export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}" } init() { diff --git a/dots/.config/zsh/config/profile/profile/options.zsh b/dots/.config/zsh/config/profile/profile/options.zsh index 964b0148..3b645d68 100644 --- a/dots/.config/zsh/config/profile/profile/options.zsh +++ b/dots/.config/zsh/config/profile/profile/options.zsh @@ -2,7 +2,7 @@ export SAVEHIST=10000 export HISTSIZE=10000 -export HISTFILE="${XDG_CACHE_HOME:-"$HOME"}/zsh_history" +export HISTFILE="${XDG_CACHE_HOME}/zsh_history" setopt INC_APPEND_HISTORY setopt SHARE_HISTORY setopt EXTENDED_HISTORY