Skip to content

Commit

Permalink
Set environment variables in /etc
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz committed Jul 21, 2018
1 parent 2421e46 commit a3b8419
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 37 deletions.
4 changes: 1 addition & 3 deletions .xsession
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Load environment variables for GUI apps

source "$HOME/.zsh/environment.zsh"
#!/bin/sh

# Initial X configuration

Expand Down
11 changes: 11 additions & 0 deletions .zsh/sandboxd.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ function sandbox_hook() {

eval "$hook(){ sandbox $cmd; $hook \$@ }"
}


# RVM configuration
sandbox_init_rvm() {
if [ -f /usr/share/rvm/scripts/rvm ]; then
source /usr/share/rvm/scripts/rvm
fi
}
sandbox_hook rvm rvm
sandbox_hook rvm eyaml
sandbox_hook rvm ruby
3 changes: 1 addition & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ if [[ "$HOST" =~ "crmdevvm-" ]]; then
source ~/.zsh/autorun-same-tmux.zsh
fi

# Lazy-loading functionality
# Lazy-loading
source ~/.zsh/sandboxd.zsh

# Load environment variables
source ~/.zsh/environment.zsh
source ~/.dircolors.zsh

# Load terminal configuration
Expand Down
3 changes: 0 additions & 3 deletions INSTALL_ARCH.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@
# echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
# echo "en_DK.UTF-8 UTF-8" >> /etc/locale.gen
# locale-gen
# echo LANG=en_US.UTF-8 >> /etc/locale.conf
# echo LANGUAGE=en_US >> /etc/locale.conf
# echo LC_ALL=en_US.UTF-8 >> /etc/locale.conf
```

1. Configure hostname:
Expand Down
8 changes: 8 additions & 0 deletions etc/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Locale
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANGUAGE=en_US

# Scale all GTK3 apps for HiDPI screen
GDK_SCALE=2
GDK_DPI_SCALE=0.5
3 changes: 3 additions & 0 deletions etc/profile.d/maven.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

export MAVEN_OPTS="-Xms1g -Xmx12g -XX:PermSize=1g"
42 changes: 13 additions & 29 deletions .zsh/environment.zsh → etc/profile.d/zz_custom.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
export TERMINAL='kitty'
#!/bin/sh

export EDITOR='kak'
export VISUAL='kak'
export DIFFPROG='nvim -d'
export MANPAGER='kak-man-pager'
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export WORDCHARS='*?_.[]~&!#$%^(){}<>'

# Used by bash-language-server
export EXPLAINSHELL_ENDPOINT="http://localhost:5000"

# Scale all GTK3 apps for HiDPI screen
export GDK_SCALE=2
export GDK_DPI_SCALE=0.5

# Keep py3status 'do_not_disturb' module in sync with i3 lock and restart
export PY3STATUS_DND_LOCK="$HOME/.cache/py3status_do_not_disturb.lock"

# My own binaries
export PATH="$HOME/bin:$PATH"

# Use gpg-agent as ssh-agent
if [[ "$HOST" =~ "desktop-" ]]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh"
fi

# FZ configuration
export FZ_CMD=j
export FZ_SUBDIR_CMD=jj
case "$(hostname)" in
desktop-*) export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" ;;
esac

# Pass configuration
export PASSWORD_STORE_CHARACTER_SET='a-zA-Z0-9~!@#$%^&*()-_=+[]{};:,.<>?'
export PASSWORD_STORE_GENERATED_LENGTH=40

# Java configuration
export JAVA_HOME="/usr/lib/jvm/java-8-jdk"
export PATH="$JAVA_HOME/bin:$PATH"

# Maven configuration
export MAVEN_OPTS="-Xms1g -Xmx12g -XX:PermSize=1g"
export M3_HOME="/usr/share/maven3"
export PATH="$M3_HOME/bin:$PATH"
# FZ configuration
export FZ_CMD=j
export FZ_SUBDIR_CMD=jj

# Java configuration
export PATH="$JAVA_HOME/bin:$PATH"

# Android configuration
export ANDROID_SDK_ROOT="$HOME/.android/sdk"
Expand All @@ -53,17 +46,8 @@ if hash ruby 2>/dev/null; then
export PATH="$GEM_HOME/bin:$PATH"
fi

# RVM configuration
sandbox_init_rvm() {
if [ -f /usr/share/rvm/scripts/rvm ]; then
source /usr/share/rvm/scripts/rvm
fi
}
sandbox_hook rvm rvm
sandbox_hook rvm eyaml

# Go configuration
export GOPATH=/home/maximbaz/.go
export GOPATH="$HOME/.go"
export PATH="$GOPATH/bin:$PATH"

# NPM configuration
Expand Down
3 changes: 3 additions & 0 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ if [[ "$(whoami)" == "root" ]]; then
echo "=========================="

copy "etc/conf.d/snapper"
copy "etc/environment"
copy "etc/profile.d/maven.sh"
copy "etc/profile.d/zz_custom.sh"
copy "etc/snap-pac.conf"
copy "etc/snapper/configs/root"
copy "etc/ssh/ssh_config"
Expand Down

0 comments on commit a3b8419

Please sign in to comment.