diff options
Diffstat (limited to '.config/login.sh')
-rw-r--r-- | .config/login.sh | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/.config/login.sh b/.config/login.sh index 3c29c99..4634685 100644 --- a/.config/login.sh +++ b/.config/login.sh @@ -1,4 +1,3 @@ -#!/bin/bash # ~/.profile: executed by the command interpreter for login shells. # I like that graphical login scripts be configured to load this, so # it always runs, graphical or not. @@ -18,12 +17,29 @@ umask 022 # TMPDIR ############################################################# -if [[ ! -d "$HOME/tmp" ]]; then - tmp="$(mktemp --tmpdir -d "$USER-tmpdir.XXXXXXXXXXXXXXXXXXX")" - ln -sf "$tmp" "$HOME/tmp" +if [[ ! -d "$HOME/tmp/$HOSTNAME" ]]; then + tmp="$(mktemp --tmpdir -d "$USER@$HOSTNAME-tmpdir.XXXXXXXXXXXXXXXXXXX")" + mkdir -p -- "$HOME/tmp" + ln -sf "$tmp" "$HOME/tmp/$HOSTNAME" unset tmp fi -export TMPDIR="$HOME/tmp" +export TMPDIR="$HOME/tmp/$HOSTNAME" +if type flock &>/dev/null; then + if [[ "$(readlink -f /dev/fd/7)" != "$(readlink -f "$TMPDIR/.uselock")" ]]; then + exec 7>"$TMPDIR/.uselock" + fi + if flock -sn 7; then + _logout_tmpdir_cleanup() { + if flock -xn 7; then + rm -rf -- "$(readlink -f "$TMPDIR")" + rm -- "$TMPDIR" + fi + } + trap _logout_tmpdir_cleanup EXIT + fi +fi + + # XDG ################################################################ @@ -31,6 +47,13 @@ export TMPDIR="$HOME/tmp" mkdir -p -- "$XDG_RUNTIME_DIR/sessions" ln -sfT -- "$XDG_RUNTIME_DIR/sessions" ~/.sessions + +# Box-specific stuff ################################################# + +if [[ -f "$XDG_CONFIG_HOME/login.local.sh" ]]; then + . "$XDG_CONFIG_HOME/login.local.sh" +fi + # Settings ########################################################### # Spell check @@ -72,8 +95,8 @@ export _JAVA_OPTIONS # X11 if [[ -z $XAUTHORITY ]]; then - #export XAUTHORITY="$HOME/.Xauthority" - export XAUTHORITY=$HOME/.sessions/Xauthority + export XAUTHORITY=$HOME/.Xauthority + #export XAUTHORITY=$HOME/.sessions/Xauthority fi # D-Bus @@ -87,7 +110,10 @@ fi # export DBUS_SESSION_BUS_PID # fi -# Load any box-specific stuff -if [[ -f "$XDG_CONFIG_HOME/login.local.sh" ]]; then - . "$XDG_CONFIG_HOME/login.local.sh" -fi +export GOROOT=/homes/shumakl/.prefix.x86_64/go +export PATH="/home/luke/perl5/bin:$PATH"; +export PERL5LIB="/home/luke/perl5/lib/perl5/i686-linux-thread-multi:/home/luke/perl5/lib/perl5"; +export PERL5LIB=/homes/shumakl/.prefix.x86_64/lib64/perl5:$PERL5LIB +export PERL_LOCAL_LIB_ROOT="/home/luke/perl5"; +export PERL_MB_OPT="--install_base /home/luke/perl5"; +export PERL_MM_OPT="INSTALL_BASE=/home/luke/perl5"; |