2022-10-13 19:55:31 +00:00
|
|
|
export_existing() {
|
|
|
|
local var=$1
|
|
|
|
while test $# -gt 0
|
|
|
|
do test -d "$2" && export $var="$2" && break
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
}
|
|
|
|
export_existing DATA $HOME/daten $HOME/data
|
2022-05-03 09:21:04 +00:00
|
|
|
export MUSIC="$DATA/4-media/music"
|
2021-10-17 10:23:29 +00:00
|
|
|
|
2022-08-28 20:34:44 +00:00
|
|
|
export BORG_REPO='/mnt/backup/borg'
|
2022-08-04 08:57:08 +00:00
|
|
|
export BORG_PASSCOMMAND='pass service/device/borg/backup'
|
2021-11-25 12:18:57 +00:00
|
|
|
|
2020-06-26 21:27:38 +00:00
|
|
|
# xdg
|
|
|
|
export XDG_DATA_HOME="$HOME/.local/share"
|
2021-09-18 20:01:51 +00:00
|
|
|
export XDG_STATE_HOME="$HOME/.local/state"
|
|
|
|
export XDG_CACHE_HOME="$HOME/.local/cache"
|
2020-06-26 21:27:38 +00:00
|
|
|
export XDG_CONFIG_HOME="$HOME/.config"
|
2022-07-10 18:10:31 +00:00
|
|
|
|
2021-11-23 12:02:12 +00:00
|
|
|
export JOURNAL="$(eval "dirname $(grep -1 journals $XDG_CONFIG_HOME/jrnl/jrnl.yaml | tail -1 | cut -d':' -f2-)" ||
|
2022-05-03 09:21:04 +00:00
|
|
|
echo "$DATA/2-box/journal")"
|
2022-10-13 19:55:31 +00:00
|
|
|
export_existing INSTALEE_HOME "$HOME/projects/instalee" "$DATA/1-projects/1-personal/instalee"
|
|
|
|
export_existing VOSK_MODELS "/mnt/data/projects/vosk/models"
|
2020-09-04 10:09:08 +00:00
|
|
|
# adjust programs to use xdg
|
2021-12-02 09:43:35 +00:00
|
|
|
export MNT=/run/media/$USER
|
2021-11-07 02:50:04 +00:00
|
|
|
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
|
2021-04-13 15:20:24 +00:00
|
|
|
|
2022-04-03 20:24:47 +00:00
|
|
|
export LYNX_CFG_PATH="$XDG_CONFIG_HOME"/lynx.cfg
|
2020-12-23 12:45:13 +00:00
|
|
|
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
|
2021-11-07 02:50:04 +00:00
|
|
|
export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
|
2022-02-12 08:35:40 +00:00
|
|
|
export RLWRAP_HOME="$XDG_DATA_HOME"/rlwrap
|
|
|
|
export LESSHISTFILE="$XDG_STATE_HOME"/lesshst
|
2021-09-18 20:01:51 +00:00
|
|
|
|
2022-02-12 08:35:40 +00:00
|
|
|
## Graphical
|
2021-11-07 02:50:04 +00:00
|
|
|
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
|
2021-09-18 20:01:51 +00:00
|
|
|
export KDEHOME="$XDG_STATE_HOME"/kdehome
|
2021-12-02 09:43:35 +00:00
|
|
|
export DOOMLOCALDIR="$XDG_STATE_HOME"/emacs
|
2021-11-07 02:50:04 +00:00
|
|
|
export WINEPREFIX="$XDG_DATA_HOME"/wine
|
|
|
|
|
|
|
|
## Development tools
|
2021-09-18 20:01:51 +00:00
|
|
|
export GOPATH="$XDG_STATE_HOME"/go
|
2022-08-04 08:57:08 +00:00
|
|
|
export KREW_ROOT="$XDG_DATA_HOME"/krew
|
|
|
|
|
2022-09-09 13:56:18 +00:00
|
|
|
export CARGO_HOME="$XDG_STATE_HOME"/cargo
|
|
|
|
export RUSTUP_HOME="$XDG_STATE_HOME"/rustup
|
2022-08-04 08:57:08 +00:00
|
|
|
|
2021-12-14 18:46:28 +00:00
|
|
|
export NVM_DIR="$XDG_DATA_HOME"/nvm
|
2022-08-04 08:57:08 +00:00
|
|
|
export N_PREFIX="$XDG_STATE_HOME"/n
|
2021-04-13 15:20:24 +00:00
|
|
|
|
|
|
|
export CABAL_CONFIG="$XDG_CONFIG_HOME"/cabal/config
|
|
|
|
export CABAL_DIR="$XDG_CACHE_HOME"/cabal
|
2021-06-19 19:25:10 +00:00
|
|
|
|
|
|
|
export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle
|
|
|
|
export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
|
2021-09-18 20:01:51 +00:00
|
|
|
export BUNDLE_USER_PLUGIN="$XDG_STATE_HOME"/bundle
|
|
|
|
|
2022-01-05 16:58:17 +00:00
|
|
|
export PYTHONSTARTUP="$XDG_CONFIG_HOME"/pythonstartup.py
|
2021-09-18 20:01:51 +00:00
|
|
|
export KSCRIPT_CACHE_DIR="$XDG_CACHE_HOME"/kscript
|
2021-06-19 19:25:10 +00:00
|
|
|
|
2022-09-08 20:44:01 +00:00
|
|
|
export RBENV_ROOT="$XDG_STATE_HOME"/rbenv
|
|
|
|
|
2022-10-13 19:55:31 +00:00
|
|
|
export R_LIBS="$XDG_STATE_HOME"/R/lib
|
|
|
|
|
2020-12-23 12:45:13 +00:00
|
|
|
# Java & Android
|
2020-10-13 09:19:09 +00:00
|
|
|
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
|
2021-09-18 20:01:51 +00:00
|
|
|
export GRADLE_USER_HOME="$XDG_STATE_HOME"/gradle
|
2020-12-23 12:45:13 +00:00
|
|
|
export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME"/android
|
2021-09-18 20:01:51 +00:00
|
|
|
export ANDROID_EMULATOR_HOME="$XDG_STATE_HOME"/android/emulator
|
2022-08-04 08:57:08 +00:00
|
|
|
export ANDROID_SDK_ROOT="/opt/android/sdk"
|
2020-12-23 12:45:13 +00:00
|
|
|
# taskwarrior & timewarrior
|
2022-01-05 16:58:17 +00:00
|
|
|
export TIMEWARRIORDB="$XDG_DATA_HOME"/timewarrior
|
|
|
|
export TASKRC="$XDG_CONFIG_HOME"/task/taskrc
|
|
|
|
export TASKDATA="$XDG_DATA_HOME"/task
|
2020-09-04 10:09:08 +00:00
|
|
|
# zsh dirs
|
2022-01-05 16:58:17 +00:00
|
|
|
export ZDOTDIR="$XDG_CONFIG_HOME"/zsh
|
|
|
|
export ZSH="$XDG_DATA_HOME"/zsh/oh-my-zsh
|
|
|
|
export HISTFILE="$XDG_STATE_HOME"/zsh/history
|
|
|
|
export CONFIG_ZSH="$XDG_CONFIG_HOME"/zsh
|
|
|
|
export CONFIG_SHELLS="$XDG_CONFIG_HOME"/shell
|
|
|
|
mkdir -p "$XDG_STATE_HOME/zsh"
|
2020-09-04 10:09:08 +00:00
|
|
|
|
2020-06-26 21:27:38 +00:00
|
|
|
# environment
|
2022-07-06 07:10:13 +00:00
|
|
|
BIN="$HOME/.local/bin"
|
2022-09-15 09:58:07 +00:00
|
|
|
export PATH="$BIN/scripts:$BIN:$RBENV_ROOT/shims:$PATH:$XDG_CONFIG_HOME/emacs/bin:$N_PREFIX:$GOPATH/bin:$ANDROID_SDK_ROOT/platform-tools:$CARGO_HOME/bin:$KREW_ROOT/bin:$XDG_DATA_HOME/gem/ruby/3.0.0/bin:$HOME/.rvm/bin"
|
2022-06-13 20:56:05 +00:00
|
|
|
export ALTERNATE_EDITOR="$(
|
|
|
|
if which nvim >/dev/null
|
|
|
|
then echo nvim
|
|
|
|
else echo vi
|
|
|
|
fi)"
|
|
|
|
export EDITOR="$(
|
|
|
|
if which emacs >/dev/null
|
2022-07-06 07:10:13 +00:00
|
|
|
then echo $BIN/scripts/emacstty
|
2022-06-13 20:56:05 +00:00
|
|
|
else echo $ALTERNATE_EDITOR
|
|
|
|
fi
|
|
|
|
)"
|
2022-11-29 22:32:54 +00:00
|
|
|
|
|
|
|
export LS_OPTIONS='--color=auto --human-readable --si --group-directories-first --file-type --dereference-command-line'
|
2023-06-12 09:08:37 +00:00
|
|
|
export LESS="--raw-control-chars --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)"
|
2022-02-12 08:35:40 +00:00
|
|
|
# TODO put into config file and use --exclude-from
|
2022-11-29 22:32:54 +00:00
|
|
|
# -x 'System Volume Information'
|
|
|
|
export DIRS_GENERATED="-x generated -x .gradle -x cmake_build -x dist-newstyle -x node_modules -x __pycache__"
|
2022-05-10 07:25:01 +00:00
|
|
|
export DIRS_IGNORE_SAFE="-x .cache -x .cpan -x *Cache -x .pyenv -x .local/cache -x share/baloo -x share/cabal -x share/cargo -x share/digikam -x share/gem -x share/JetBrains -x share/tldr -x share/syncthing -x share/Steam/ubuntu* -x share/Steam/package -x share/virtualenv -x share/Zeal -x state/gradle -x state/android -x Ferdi/Partitions -x oh-my-zsh -x wine/drive_c/windows -x vendor/cache $DIRS_GENERATED"
|
2022-05-12 09:32:00 +00:00
|
|
|
export DIRS_IGNORE="-x .sync -x .stfolder -x *build -x .git -x .idea -x env -x out -x cache -x Partitions -x vendor/bundle -x log $DIRS_IGNORE_SAFE"
|
2020-09-04 10:09:08 +00:00
|
|
|
# red stderr
|
2020-10-12 20:23:38 +00:00
|
|
|
test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"
|
2020-06-26 21:27:38 +00:00
|
|
|
# software config
|
2022-08-29 22:06:26 +00:00
|
|
|
export OSFONTDIR="$XDG_DATA_HOME"/fonts:/usr/share/fonts
|
2022-09-27 20:04:13 +00:00
|
|
|
export TEXMF=/usr/share/texmf-dist/texmf-context
|
2021-09-18 20:01:51 +00:00
|
|
|
export KSCRIPT_IDEA_COMMAND=intellij-idea-ultimate-edition
|
2021-07-02 16:32:09 +00:00
|
|
|
## enable pass extensions
|
2020-09-19 07:34:47 +00:00
|
|
|
export PASSWORD_STORE_ENABLE_EXTENSIONS="true"
|
2021-07-02 16:32:09 +00:00
|
|
|
## man
|
|
|
|
export MANPAGER="less --squeeze-blank-lines +Gg"
|
2022-08-28 20:34:44 +00:00
|
|
|
export LESS_TERMCAP_mb=$'\e[1;31m' # begin bold
|
|
|
|
export LESS_TERMCAP_md=$'\e[1;32m' # begin blink
|
2022-09-03 18:07:41 +00:00
|
|
|
export LESS_TERMCAP_so=$'\e[36m' # bottom indication and search highlight
|
2022-08-28 20:34:44 +00:00
|
|
|
export LESS_TERMCAP_us=$'\e[4;33m' # begin underline
|
|
|
|
export LESS_TERMCAP_me=$'\e[0m' # reset bold/blink
|
|
|
|
export LESS_TERMCAP_se=$'\e[0m' # reset reverse video
|
|
|
|
export LESS_TERMCAP_ue=$'\e[0m' # reset underline
|
|
|
|
export GROFF_NO_SGR=1 # for konsole and gnome-terminal
|
2021-07-02 16:32:09 +00:00
|
|
|
## fzf defaults
|
2022-09-07 22:43:28 +00:00
|
|
|
[[ "$(fzf --version 2>/dev/null | grep --only-matching '[0-9]\.[^. ]*')" > 0.31 ]] && _fzf_latest=true || _fzf_latest=false
|
2021-11-04 11:19:43 +00:00
|
|
|
FZF_BINDINGS=$(echo "
|
2021-06-13 13:51:25 +00:00
|
|
|
change:top
|
|
|
|
alt-enter:execute(test -O {} && $EDITOR {} || sudoedit {})
|
|
|
|
alt-bspace:execute(gio trash {})
|
|
|
|
double-click:execute(xdg-open {})
|
|
|
|
ctrl-a:select-all
|
2022-02-12 08:35:40 +00:00
|
|
|
ctrl-l:kill-line
|
2021-06-13 13:51:25 +00:00
|
|
|
alt-a:select-all
|
|
|
|
alt-c:yank
|
|
|
|
alt-w:toggle-preview-wrap
|
2022-02-12 08:35:40 +00:00
|
|
|
ctrl-alt-h:backward-kill-word
|
2022-01-17 19:52:36 +00:00
|
|
|
$($_fzf_latest && echo "shift-down:preview-half-page-down,shift-up:preview-half-page-up
|
2022-01-17 20:00:50 +00:00
|
|
|
alt-j:preview-half-page-down,alt-k:preview-half-page-up
|
2022-01-17 19:52:36 +00:00
|
|
|
alt-shift-down:preview-down,alt-shift-up:preview-up,esc:close")
|
2021-11-04 11:19:43 +00:00
|
|
|
" | xargs -I% echo -n "%," | head -c-1)
|
2021-06-13 13:51:25 +00:00
|
|
|
#alt-r:preview(bat {}),
|
2021-09-18 20:01:51 +00:00
|
|
|
export FZF_HISTDIR="$XDG_STATE_HOME/fzf"
|
|
|
|
mkdir -p "$XDG_STATE_HOME/fzf"
|
2022-11-18 03:20:13 +00:00
|
|
|
export FZF_DEFAULT_OPTS="--exit-0 --ansi
|
2022-09-07 22:43:28 +00:00
|
|
|
--tiebreak=$($_fzf_latest && echo "chunk,")end,length --history=$FZF_HISTDIR/history --bind='$FZF_BINDINGS'
|
2022-01-17 12:56:33 +00:00
|
|
|
$($_fzf_latest && echo '--preview-window=60%,border-left --marker=o')"
|
2020-11-14 01:28:26 +00:00
|
|
|
FD_BASE="fd --hidden --color=always --no-ignore-vcs"
|
|
|
|
export FZF_DEFAULT_COMMAND="$FD_BASE --type file"
|
2020-11-30 21:13:43 +00:00
|
|
|
export FZF_CTRL_T_COMMAND="$FD_BASE -d 7"
|
2021-07-02 16:32:09 +00:00
|
|
|
## ctest
|
2020-09-04 10:09:08 +00:00
|
|
|
export CTEST_PROGRESS_OUTPUT=1
|
|
|
|
export CTEST_OUTPUT_ON_FAILURE=1
|
|
|
|
export CTEST_PARALLEL_LEVEL=3
|
2023-06-12 09:08:37 +00:00
|
|
|
|
|
|
|
autolight
|
|
|
|
#export TZ='Europe/Dublin'
|