mirror of
https://github.com/GRFreire/dotfiles.git
synced 2026-01-09 20:19:37 +00:00
Debian packages bat (ls replacement) as `batcat`, while other distros, like archlinux, does not. This commits selects which binary to use depending if the current distro is debian. Also, debian's package for fzf places the zsh completitions file in other directory of what arch linux does, this commit also fixes this.
76 lines
1.9 KiB
Bash
76 lines
1.9 KiB
Bash
#!/bin/sh
|
|
|
|
export OS_RELEASE="$(cat /etc/os-release | grep '^ID=' | sed 's|ID=||')"
|
|
|
|
### SET PATHS ###
|
|
|
|
# XDG Defaults
|
|
export XDG_DATA_HOME="$HOME/.local/share"
|
|
export XDG_CONFIG_HOME="$HOME/.config"
|
|
export XDG_STATE_HOME="$HOME/.local/state"
|
|
export XDG_CACHE_HOME="$HOME/.cache"
|
|
|
|
# Other applications
|
|
export CARGO_HOME="$XDG_DATA_HOME"/cargo
|
|
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
|
|
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
|
|
export DVDCSS_CACHE="$XDG_DATA_HOME"/dvdcss
|
|
export MYPY_CACHE_DIR="$XDG_CACHE_HOME"/mypy
|
|
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history
|
|
export NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages
|
|
export NVM_DIR="$XDG_DATA_HOME"/nvm
|
|
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
|
|
export SQLITE_HISTORY="$XDG_DATA_HOME"/sqlite_history
|
|
export ZDOTDIR="$HOME"/.config/zsh
|
|
|
|
### Start ssh-agent ###
|
|
eval `ssh-agent -s` > /dev/null
|
|
|
|
### Default programs ###
|
|
[ $OS_RELEASE = "debian" ] && bat_cmd="batcat" || bat_cmd="bat"
|
|
|
|
export EDITOR="nvim"
|
|
export READER="zathura"
|
|
export MANPAGER="sh -c \"col -bx | $bat_cmd -l man --paging always -p\""
|
|
export TERMINAL="alacritty"
|
|
export BROWSER="firefox"
|
|
export VIDEO="mpv"
|
|
export IMAGE="nsxiv"
|
|
|
|
### PATH exports ###
|
|
# $1 = path to export
|
|
try_export_path() {
|
|
if [ -d "$1" ] ;
|
|
then export PATH="$1:$PATH"
|
|
fi
|
|
}
|
|
|
|
try_export_path "$HOME/.scripts/bin"
|
|
|
|
try_export_path "$HOME/.bin"
|
|
|
|
try_export_path "$HOME/.opt/bin"
|
|
|
|
try_export_path "$HOME/.local/bin"
|
|
|
|
try_export_path "$HOME/.yarn/bin"
|
|
|
|
try_export_path "$CARGO_HOME/bin"
|
|
|
|
# Fzf options
|
|
export FZF_DEFAULT_OPTS="--reverse --cycle --margin 0,1"
|
|
|
|
export GOPATH="$HOME/.go"
|
|
export GOPATH="$GOPATH:$HOME/Projects/thirdparty/go"
|
|
export GOPATH="$GOPATH:$HOME/Projects/go"
|
|
|
|
# Use custom mono path (C#)
|
|
export FrameworkPathOverride=/etc/mono/4.5
|
|
|
|
# Path for cuda
|
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/cuda/lib64"
|
|
|
|
# Solve some issue with man pages rendering
|
|
export GROFF_NO_SGR=1
|
|
|