Properly set up & use XDG dirs

This commit is contained in:
xerus2000 2020-06-26 23:27:38 +02:00
parent 60b247f049
commit ac8927b994
4 changed files with 28 additions and 24 deletions

View File

@ -4,15 +4,11 @@
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported. # absolute path. No other format is supported.
#
XDG_CONFIG_DIR="$HOME/.config"
XDG_CACHE_DIR="$HOME/.cache"
XDG_DATA_DIR="$HOME/.local/share"
XDG_DESKTOP_DIR="$HOME/.local/desktop" XDG_DESKTOP_DIR="$HOME/.local/desktop"
XDG_TEMPLATES_DIR="$HOME/.local/templates" XDG_TEMPLATES_DIR="$HOME/.local/templates"
XDG_DOWNLOAD_DIR="$HOME/daten/downloads" XDG_DOWNLOAD_DIR="$HOME/daten/downloads"
XDG_MUSIC_DIR="$HOME/" XDG_MUSIC_DIR="$HOME/daten/music"
XDG_PICTURES_DIR="$HOME/" XDG_PICTURES_DIR="$HOME/daten/images"
XDG_VIDEOS_DIR="$HOME/daten/videos" XDG_VIDEOS_DIR="$HOME/daten/videos"
XDG_DOCUMENTS_DIR="$HOME/daten/Dropbox/dokumente" XDG_DOCUMENTS_DIR="$HOME/daten/Dropbox/dokumente"
XDG_PUBLICSHARE_DIR="$HOME/daten/share" XDG_PUBLICSHARE_DIR="$HOME/daten/share"

View File

@ -1,6 +1,6 @@
# Commands # Commands
if test "$PWD" = ~ && test "$0" != "$SHELL"; then if test "$PWD" = ~ && test "$0" != "$SHELL"; then
neofetch --config $(xdg-user-dir CONFIG)/neofetch/config-short.conf neofetch --config $XDG_CONFIG_HOME/neofetch/config-short.conf
task next limit:3 task next limit:3
timew | head -3 timew | head -3
fi fi
@ -12,11 +12,11 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi fi
export PATH=$HOME/bin:$HOME/.local/bin:$PATH export PATH=$HOME/.local/bin:$PATH
export CONFIG_ZSH="$HOME/.config/zsh" export CONFIG_ZSH="$XDG_CONFIG_HOME/zsh"
export CONFIG_SHELLS="$HOME/.config/shell" export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"
export ZSH="$HOME/.local/share/oh-my-zsh" export ZSH="$XDG_DATA_HOME/oh-my-zsh"
DEFAULT_USER=$USER DEFAULT_USER=$USER
ZSH_THEME="powerlevel10k/powerlevel10k" ZSH_THEME="powerlevel10k/powerlevel10k"
@ -36,7 +36,6 @@ DISABLE_UNTRACKED_FILES_DIRTY="true" # DOn't mark untracked files as dirty - spe
# Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Custom plugins may be added to $ZSH_CUSTOM/plugins/
plugins=( plugins=(
git git
git-extras
git-auto-fetch git-auto-fetch
z z
fast-syntax-highlighting fast-syntax-highlighting
@ -46,7 +45,8 @@ plugins=(
_comp_options+=(globdots) # Show files starting with dot in autocomplete _comp_options+=(globdots) # Show files starting with dot in autocomplete
fpath=($fpath "$CONFIG_ZSH/zsh_completion") # Custom completions fpath=($fpath "$CONFIG_ZSH/zsh_completion") # Custom completions
ZSH_COMPDUMP="$(xdg-user-dir CACHE)/zsh/zcompdump-$ZSH_VERSION" # Cache completions ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" # Cache completions
DISABLE_UPDATE_PROMPT=true
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh

View File

@ -1,2 +1,2 @@
export XDG_DATA_DIRS="$HOME/.local/xdg:$XDG_DATA_DIRS" export XDG_DATA_DIRS="$HOME/.local/xdg:$XDG_DATA_DIRS"
export KDEHOME="$HOME/.local/share/kdehome" export KDEHOME="$XDG_DATA_HOME/kdehome"

View File

@ -1,16 +1,24 @@
. ~/.profile . ~/.profile
# red stderr # xdg
export LD_PRELOAD="/opt/stderred/build/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
# zsh config # zsh config
export ZDOTDIR="$HOME/.config/zsh" export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export _Z_DATA="$HOME/.local/share/zsh/z" export _Z_DATA="$XDG_DATA_HOME/zsh/z"
export HISTFILE="$HOME/.local/share/zsh/history" export HISTFILE="$XDG_DATA_HOME/zsh/history"
# programs # environment
export EDITOR=/usr/bin/nvim export EDITOR=/usr/bin/nvim
export MANPAGER="sh -c 'col -bx | bat -l man -p'" export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export FZF_DEFAULT_COMMAND="fd --hidden" # software config
export FZF_DEFAULT_OPTS="--select-1 --exit-0 --tiebreak=end,length --history=/var/tmp/fzf-history" export FZF_DEFAULT_OPTS='--select-1 --exit-0 --tiebreak=end,length --history=/var/tmp/fzf-history --ansi --bind="alt-enter:execute(test -O {} && $EDITOR {} || sudoedit {}),del:execute(gio trash {}),change:top"'
export FZF_DEFAULT_COMMAND="fd --hidden --type file --color=always"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# adjust programs to use xdg # adjust programs to use xdg
export PASSWORD_STORE_DIR="$HOME/.local/share/pass" export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
export TIMEWARRIORDB="$HOME/.local/share/timewarrior" export TIMEWARRIORDB="$XDG_DATA_HOME/timewarrior"
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
# red stderr
export LD_PRELOAD="/opt/stderred/build/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"
$HOME/.local/bin/update-keyboard-layout.sh