From 34a6c23f99988a75729b04880824b8d79d1391a2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Oct 2012 01:20:24 -0400 Subject: Use XDG for bash, remove alsa, clean up bash & profile, add CACHEDIR.TAG .profile: fix up --- .profile | 74 +++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 34 deletions(-) (limited to '.profile') diff --git a/.profile b/.profile index 2e2e1d0..a6c4d91 100644 --- a/.profile +++ b/.profile @@ -1,4 +1,8 @@ # ~/.profile: executed by the command interpreter for login shells. +# Should be whether logging in graphically or not. +# +# This file should be executable by /bin/sh, but I'm going to assume bash(1) +# # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. @@ -9,33 +13,44 @@ umask 022 ## Paths ############################################################# # Unix -bins=$(echo $HOME/bin $HOME/.local.`uname -m`/bin $HOME/.local/bin $HOME/.prefix.`uname -m`/bin $HOME/.prefix/bin $HOME/.gem/ruby/*/bin) -for dir in $bins; do - if [ -d "$dir" ]; then - export PATH="$dir:$PATH" - fi +bins=($HOME/bin $HOME/.local.`uname -m`/bin $HOME/.local/bin $HOME/.prefix.`uname -m`/bin $HOME/.prefix/bin $HOME/.gem/ruby/*/bin) +for dir in "${bins[@]}"; do + if [ -d "$dir" ]; then + export PATH="$dir:$PATH" + fi done # Ruby for dir in $HOME/.prefix/lib; do - if [ -d "$dir" ]; then - export RUBYLIB="$dir" - fi + if [ -d "$dir" ]; then + export RUBYLIB="$dir" + fi done # Settings ########################################################### # Text editor if [ -f "$HOME/.selected_editor" ]; then - . "$HOME/.selected_editor" - export SELECTED_EDITOR - export ALTERNATE_EDITOR - export EDITOR="${EDITOR:-$SELECTED_EDITOR}" - export VISUAL="${VISUAL:-$SELECTED_EDITOR}" + . "$HOME/.selected_editor" + export SELECTED_EDITOR + export ALTERNATE_EDITOR + export EDITOR="${EDITOR:-$SELECTED_EDITOR}" + export VISUAL="${VISUAL:-$SELECTED_EDITOR}" fi # GPG -export GPGKEY=D4FFBFC9 +if [ -z "$GPGKEY" ] && [ -f "${HOME}/.gnupg/gpg.conf" ]; then + export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` +fi +if [ -z "$(pgrep -u `whoami` gpg-agent)" ]; then + mkdir -p ${XDG_RUNTIME_DIR}/sessions/gpg + gpg-agent --daemon --write-env-file "${XDG_RUNTIME_DIR}/sessions/gpg" +fi +if [ -f "${XDG_RUNTIME_DIR}/sessions/gpg" ]; then + . "${XDG_RUNTIME_DIR}/sessions/gpg" + export GPG_AGENT_INFO + #export SSH_AUTH_SOCK +fi # Java _JAVA_OPTIONS='' @@ -43,36 +58,27 @@ _JAVA_OPTIONS+=' -Dawt.useSystemAAFontSettings=on' _JAVA_OPTIONS+=' -Dswing.aatext=true' _JAVA_OPTIONS+=' -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' if [ -n "$TMPDIR" ]; then - _JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" + _JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" fi export _JAVA_OPTIONS -# ALSA -if [ -x "`which alsactl 2>/dev/null`" ]; then - alsactl restore "$HOME/.current.asound" &> /dev/null || true -fi - # X11 if [ -z "$XAUTHORITY" ]; then - export XAUTHORITY=$HOME/.Xauthority + export XAUTHORITY=$HOME/.Xauthority fi # D-Bus if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then - eval `dbus-launch` - export DBUS_SESSION_BUS_ADDRESS - export DBUS_SESSION_BUS_PID -fi + # I want a separate instance for each login + #dbus-launch > "${HOME}/.cache/sessions/dbus" + #. "${HOME}/.cache/sessions/dbus" + eval `dbus-launch` -# Start background programs ########################################## -if [ -f "$HOME/.login-daemons" ]; then - . "$HOME/.login-daemons" + export DBUS_SESSION_BUS_ADDRESS + export DBUS_SESSION_BUS_PID fi -# BASH ############################################################### -if [ -n "$BASH_VERSION" ]; then - # include .bashrc if it exists - if [ -f "$HOME/.bashrc" ]; then - . "$HOME/.bashrc" - fi +# Load any box-specific stuff +if [ -f "$HOME/.profile.local" ]; then + . "$HOME/.profile.local" fi -- cgit v1.2.3-2-g168b