zprofile: use XDG_STATE_HOME

As per new XDG basedir spec
This commit is contained in:
xeruf 2021-09-18 22:01:51 +02:00
parent 466f820a99
commit cab2cb8452
2 changed files with 20 additions and 13 deletions

View File

@ -1,31 +1,36 @@
# xdg # xdg
export DATA="$HOME/data" export DATA="$HOME/data"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.local/cache"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export PATH="$HOME/.local/bin/scripts:$HOME/.local/bin:$PATH:$XDG_CONFIG_HOME/emacs/bin" export PATH="$HOME/.local/bin/scripts:$HOME/.local/bin:$PATH:$XDG_CONFIG_HOME/emacs/bin"
# adjust programs to use xdg # adjust programs to use xdg
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export KDEHOME="$XDG_DATA_HOME"/kdehome
export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
export GNUPGHOME="$XDG_DATA_HOME"/gnupg export GNUPGHOME="$XDG_DATA_HOME"/gnupg
export GOPATH="$XDG_DATA_HOME"/go
export KDEHOME="$XDG_STATE_HOME"/kdehome
export GOPATH="$XDG_STATE_HOME"/go
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
export RLWRAP_HOME="$XDG_CACHE_HOME"/rlwrap export RLWRAP_HOME="$XDG_STATE_HOME"/rlwrap
export CABAL_CONFIG="$XDG_CONFIG_HOME"/cabal/config export CABAL_CONFIG="$XDG_CONFIG_HOME"/cabal/config
export CABAL_DIR="$XDG_CACHE_HOME"/cabal export CABAL_DIR="$XDG_CACHE_HOME"/cabal
export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle
export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle export BUNDLE_USER_PLUGIN="$XDG_STATE_HOME"/bundle
export KSCRIPT_CACHE_DIR="$XDG_CACHE_HOME"/kscript
# Java & Android # Java & Android
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java" export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle export GRADLE_USER_HOME="$XDG_STATE_HOME"/gradle
export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME"/android export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME"/android
export ANDROID_EMULATOR_HOME="$XDG_DATA_HOME"/android/emulator export ANDROID_EMULATOR_HOME="$XDG_STATE_HOME"/android/emulator
export ANDROID_SDK_ROOT="/opt/android-sdk" export ANDROID_SDK_ROOT="/opt/android-sdk"
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools" export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools"
# taskwarrior & timewarrior # taskwarrior & timewarrior
@ -34,13 +39,10 @@ export TASKRC="$XDG_CONFIG_HOME/task/taskrc"
export TASKDATA="$XDG_DATA_HOME/task" export TASKDATA="$XDG_DATA_HOME/task"
# zsh dirs # zsh dirs
export ZDOTDIR="$XDG_CONFIG_HOME/zsh" export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export HISTFILE="$XDG_DATA_HOME/zsh/history" export HISTFILE="$XDG_STATE_HOME/zsh/history"
export ZSH="$XDG_DATA_HOME/zsh/oh-my-zsh" export ZSH="$XDG_STATE_HOME/zsh/oh-my-zsh"
export CONFIG_ZSH="$XDG_CONFIG_HOME/zsh" export CONFIG_ZSH="$XDG_CONFIG_HOME/zsh"
export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell" export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"
# ccache - can be removed with version 4 - https://github.com/ccache/ccache/issues/191
export CCACHE_CONFIGPATH="$XDG_CONFIG_HOME"/ccache.config
export CCACHE_DIR="$XDG_CACHE_HOME"/ccache
# environment # environment
which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim' which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim'
@ -49,6 +51,7 @@ export IGNOREDIRS="-x dev -x .sync -x .stfolder -x .git -x .gradle -x .idea -x o
# red stderr # red stderr
test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}" test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"
# software config # software config
export KSCRIPT_IDEA_COMMAND=intellij-idea-ultimate-edition
## enable pass extensions ## enable pass extensions
export PASSWORD_STORE_ENABLE_EXTENSIONS="true" export PASSWORD_STORE_ENABLE_EXTENSIONS="true"
## man ## man
@ -77,8 +80,10 @@ alt-shift-down:preview-down,alt-shift-up:preview-up
esc:close esc:close
' | xargs -I% echo -n "%," | head -c-1) ' | xargs -I% echo -n "%," | head -c-1)
#alt-r:preview(bat {}), #alt-r:preview(bat {}),
export FZF_HISTDIR="$XDG_STATE_HOME/fzf"
mkdir -p "$XDG_STATE_HOME/fzf"
export FZF_DEFAULT_OPTS="--select-1 --ansi --marker=o export FZF_DEFAULT_OPTS="--select-1 --ansi --marker=o
--tiebreak=end,length --history=/var/tmp/fzf-history --bind='$FZF_BINDINGS' --tiebreak=end,length --history=$FZF_HISTDIR/history --bind='$FZF_BINDINGS'
--preview-window=60%,border-left" --preview-window=60%,border-left"
FD_BASE="fd --hidden --color=always --no-ignore-vcs" FD_BASE="fd --hidden --color=always --no-ignore-vcs"
export FZF_DEFAULT_COMMAND="$FD_BASE --type file" export FZF_DEFAULT_COMMAND="$FD_BASE --type file"
@ -88,6 +93,8 @@ export CTEST_PROGRESS_OUTPUT=1
export CTEST_OUTPUT_ON_FAILURE=1 export CTEST_OUTPUT_ON_FAILURE=1
export CTEST_PARALLEL_LEVEL=3 export CTEST_PARALLEL_LEVEL=3
export JOURNAL="$DATA/2-standards/notes/journal"
if test -z "${DISPLAY}" && test "${XDG_VTNR}" -eq 1 ; then if test -z "${DISPLAY}" && test "${XDG_VTNR}" -eq 1 ; then
echo "What do you want to do?" echo "What do you want to do?"
while test $(echo "$intention" | wc -c) -lt 6 while test $(echo "$intention" | wc -c) -lt 6