1
0
mirror of https://github.com/bertptrs/vimconfig.git synced 2025-12-25 20:40:32 +01:00

Improve environment when running from Xorg.

This commit is contained in:
Bert Peters
2017-03-07 12:46:09 +01:00
parent ad77680c25
commit 771ece4345
6 changed files with 114 additions and 108 deletions

View File

@@ -3,3 +3,5 @@ setxkbmap -option compose:caps
xset -b xset -b
compton -b compton -b
source ~/.zshenv

View File

@@ -1,2 +0,0 @@
typeset -g -A key

109
zsh/.config/zsh/.zshenv Normal file
View File

@@ -0,0 +1,109 @@
# Create XDG basedir settings if not set
if [ -z $XDG_CONFIG_HOME ]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi
if [ -z $XDG_CACHE_HOME ]; then
export XDG_CACHE_HOME="$HOME/.cache"
fi
if [ -z $XDG_DATA_HOME ]; then
export XDG_DATA_HOME="$HOME/.local/share"
fi
# Move the remaining zsh installation
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
# Some systems do not set XDG_RUNTIME_DIR, create an alternative.
if [ -z $XDG_RUNTIME_DIR ]; then
if [ -n "$TMPDIR" ]; then
XDG_RUNTIME_DIR="$TMPDIR/$USERNAME"
else
XDG_RUNTIME_DIR="/tmp/$USERNAME"
fi
mkdir -p "$XDG_RUNTIME_DIR" -m 700
export XDG_RUNTIME_DIR
fi
# Make gnome-keyring available
if [ -n "$DESKTOP_SESSION" ] && hash gnome-keyring-daemon &> /dev/null; then
eval $(gnome-keyring-daemon --start)
export SSH_AUTH_SOCK
fi
# Set up less
export LESS='-x4 -SR'
export LESSHISTFILE="$XDG_DATA_HOME/less/history"
test -d $(dirname $LESSHISTFILE) || mkdir -p $(dirname $LESSHISTFILE)
# Set up editor and vim
if hash vim &> /dev/null; then
export EDITOR=vim
fi
# Set up compoer
export COMPOSER_HOME="$XDG_CONFIG_HOME/composer"
export COMPOSER_CACHE_DIR="$XDG_CACHE_HOME/composer"
if [ -d "$COMPOSER_HOME/vendor/bin" ]; then
path+="$COMPOSER_HOME/vendor/bin"
fi
# Set up wine
export WINEPREFIX="$XDG_DATA_HOME/wine"
# Setup tmux
test -f "$XDG_CONFIG_HOME/tmux/tmux.conf" && alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"/tmux
mkdir -p -m 700 "$TMUX_TMPDIR"
# Set up Rubygems
if hash gem &> /dev/null; then
export GEMRC="$XDG_CONFIG_HOME/gem/gemrc"
#TODO: move this to XDG_DATA_HOME
export GEM_HOME=$(ruby -e 'puts Gem.user_dir' 2>/dev/null)
path+="$GEM_HOME/bin"
fi
# Set up Weechat alternative directory
export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
# Set up ipython/jupyter
export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter
# Set up GIMP
export GIMP2_DIRECTORY="$XDG_CONFIG_HOME"/gimp
# Set up atom
export ATOM_HOME="$XDG_DATA_HOME"/atom
# Set up mplayer
export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer
# Set up npm
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
if [[ -d "$XDG_DATA_HOME/npm/bin" ]]; then
path+="$XDG_DATA_HOME/npm/bin"
fi
# Set up Vagrant
export VAGRANT_HOME="$XDG_DATA_HOME/vagrant"
# Set up sqlite3
test -f "$XDG_CONFIG_HOME/sqlite3/sqliterc" && alias sqlite3="sqlite3 -init \"$XDG_CONFIG_HOME/sqlite3/sqliterc\""
# Set up cargo
export CARGO_HOME="$XDG_CACHE_HOME/cargo"
# Add local binaries to path
if [[ -d "$HOME/.local/bin" ]]; then
path+="$HOME/.local/bin"
fi
# Set up GIMP
export GIMP2_DIRECTORY="$XDG_CONFIG_HOME"/gimp
# Set up OpenSSL
export RANDFILE=$XDG_RUNTIME_DIR/rnd

1
zsh/.config/zsh/zkbd/screen Symbolic link
View File

@@ -0,0 +1 @@
screen-256color

1
zsh/.config/zsh/zkbd/xterm Symbolic link
View File

@@ -0,0 +1 @@
xterm-256color

View File

@@ -1,106 +0,0 @@
# Create XDG basedir settings if not set
if [ -z $XDG_CONFIG_HOME ]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi
if [ -z $XDG_CACHE_HOME ]; then
export XDG_CACHE_HOME="$HOME/.cache"
fi
if [ -z $XDG_DATA_HOME ]; then
export XDG_DATA_HOME="$HOME/.local/share"
fi
# Move the remaining zsh installation
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
# Some systems do not set XDG_RUNTIME_DIR, create an alternative.
if [ -z $XDG_RUNTIME_DIR ]; then
if [ -n "$TMPDIR" ]; then
XDG_RUNTIME_DIR="$TMPDIR/$USERNAME"
else
XDG_RUNTIME_DIR="/tmp/$USERNAME"
fi
mkdir -p "$XDG_RUNTIME_DIR" -m 700
export XDG_RUNTIME_DIR
fi
# Make gnome-keyring available
if [ -n "$DESKTOP_SESSION" ] && hash gnome-keyring-daemon &> /dev/null; then
eval $(gnome-keyring-daemon --start)
export SSH_AUTH_SOCK
fi
# Set up less
export LESS='-x4 -SR'
export LESSHISTFILE="$XDG_DATA_HOME/less/history"
test -d $(dirname $LESSHISTFILE) || mkdir -p $(dirname $LESSHISTFILE)
# Set up editor and vim
if hash vim &> /dev/null; then
export EDITOR=vim
fi
# Set up compoer
export COMPOSER_HOME="$XDG_CONFIG_HOME/composer"
export COMPOSER_CACHE_DIR="$XDG_CACHE_HOME/composer"
if [ -d "$COMPOSER_HOME/vendor/bin" ]; then
path+="$COMPOSER_HOME/vendor/bin"
fi
# Set up wine
export WINEPREFIX="$XDG_DATA_HOME/wine"
# Setup tmux
test -f "$XDG_CONFIG_HOME/tmux/tmux.conf" && alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"/tmux
mkdir -p -m 700 "$TMUX_TMPDIR"
# Set up Rubygems
if hash gem &> /dev/null; then
export GEMRC="$XDG_CONFIG_HOME/gem/gemrc"
#TODO: move this to XDG_DATA_HOME
export GEM_HOME=$(ruby -e 'puts Gem.user_dir' 2>/dev/null)
path+="$GEM_HOME/bin"
fi
# Set up Weechat alternative directory
export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
# Set up ipython/jupyter
export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter
# Set up GIMP
export GIMP2_DIRECTORY="$XDG_CONFIG_HOME"/gimp
# Set up atom
export ATOM_HOME="$XDG_DATA_HOME"/atom
# Set up mplayer
export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer
# Set up npm
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
if [[ -d "$XDG_DATA_HOME/npm/bin" ]]; then
path+="$XDG_DATA_HOME/npm/bin"
fi
# Set up Vagrant
export VAGRANT_HOME="$XDG_DATA_HOME/vagrant"
# Set up sqlite3
test -f "$XDG_CONFIG_HOME/sqlite3/sqliterc" && alias sqlite3="sqlite3 -init \"$XDG_CONFIG_HOME/sqlite3/sqliterc\""
# Set up cargo
export CARGO_HOME="$XDG_CACHE_HOME/cargo"
# Add local binaries to path
if [[ -d "$HOME/.local/bin" ]]; then
path+="$HOME/.local/bin"
fi
# Set up GIMP
export GIMP2_DIRECTORY="$XDG_CONFIG_HOME"/gimp

1
zsh/.zshenv Symbolic link
View File

@@ -0,0 +1 @@
.config/zsh/.zshenv