From 2a01830fc336042f4125bce34e80c6b6b7807b8f Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Wed, 21 Sep 2016 17:21:42 +0200 Subject: [PATCH] automatic login to x --- zprofile | 27 +++++++++++++++++++++++++++ zshrc | 28 ++++------------------------ 2 files changed, 31 insertions(+), 24 deletions(-) create mode 100755 zprofile diff --git a/zprofile b/zprofile new file mode 100755 index 0000000..22b5dee --- /dev/null +++ b/zprofile @@ -0,0 +1,27 @@ +#!/bin/sh + +# XDG dirs +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_RUNTIME_DIR="/tmp/runtime-$(whoami)" +mkdir -p "$XDG_RUNTIME_DIR" +chmod 0700 "$XDG_RUNTIME_DIR" + +# Local scripts +export PATH="$HOME/.local/bin":"$PATH" +export PATH="$HOME/.cabal/bin":"$PATH" +export PATH="$(ruby -rubygems -e "puts Gem.user_dir")/bin":"$PATH" +export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" + +# For vim +export EDITOR="nvim" +#stty -ixon # turn of for vimshell + +# Start X if we're in tty1 +xsession() { + startx 2>&1 || vlock + sudo poweroff + sleep infinity +} +if tty | grep -q '/dev/tty1'; then xsession; fi diff --git a/zshrc b/zshrc index cefd5cf..13a1ed3 100644 --- a/zshrc +++ b/zshrc @@ -9,7 +9,7 @@ bindkey -v # End of lines configured by zsh-newuser-install # The following lines were added by compinstall -zstyle :compinstall filename '/home/felix/.zshrc' +zstyle :compinstall filename '/home/noctua/.zshrc' autoload -Uz compinit compinit @@ -33,14 +33,6 @@ bindkey "$terminfo[kcuu1]" history-substring-search-up bindkey "$terminfo[kcud1]" history-substring-search-down setopt HIST_FIND_NO_DUPS -# XDG dirs -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_RUNTIME_DIR="/tmp/runtime-$(whoami)" -mkdir -p "$XDG_RUNTIME_DIR" -chmod 0700 "$XDG_RUNTIME_DIR" - # Color ls alias ls="ls --color=auto" @@ -48,28 +40,16 @@ alias ls="ls --color=auto" alias less="LESSHISTFILE=- less" alias more="less" -# Ready for ssh'ing -alias agent='eval "$(ssh-agent)" && ssh-add' - -# Local scripts -export PATH="$HOME/.local/bin":"$PATH" -export PATH="$HOME/.cabal/bin":"$PATH" -export PATH="$(ruby -rubygems -e "puts Gem.user_dir")/bin":"$PATH" -export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" - -# For vim -export EDITOR="nvim" -#stty -ixon # turn of for vimshell +# There is only one vim alias vim="nvim" alias vi="nvim" alias nano="nvim" -# Don't type that config location al the time. -alias ncmpcpp="ncmpcpp -c ~/.config/ncmpcpp/config" +# Ready for ssh'ing +alias agent='eval "$(ssh-agent)" && ssh-add' # Base16 Shell BASE16_SHELL="$HOME/.config/base16-shell/base16-greenscreen.dark.sh" - BASE16_SHELL="$HOME/.config/base16-shell/base16-3024.dark.sh" BASE16_SHELL="$HOME/.config/base16-shell/base16-solarized.dark.sh" BASE16_SHELL="$HOME/.config/base16-shell/base16-shapeshifter.dark.sh"