From 89b0bf196d73a8ee53a4d608d95c470fcdae2ca8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 3 Apr 2014 22:51:16 -0400 Subject: Add changes from the Purdue branch --- .config/login.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to '.config/login.sh') diff --git a/.config/login.sh b/.config/login.sh index 2687a8e..1fd9505 100644 --- a/.config/login.sh +++ b/.config/login.sh @@ -1,6 +1,7 @@ #!/bin/bash # ~/.profile: executed by the command interpreter for login shells. -# Should be whether logging in graphically or not. +# I like that graphical login scripts be configured to load this, so +# it always runs, graphical or not. # # This file should be executable by /bin/sh, but I'm going to assume bash(1) # @@ -27,6 +28,7 @@ export TMPDIR="$HOME/tmp" # XDG ################################################################ . "$HOME/.local/lib/xdg.sh" +mkdir -p -- "$XDG_RUNTIME_DIR/sessions" ln -sf -- "$XDG_RUNTIME_DIR/sessions" ~/.sessions # Settings ########################################################### @@ -50,15 +52,14 @@ if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then echo 'login: Setting GPGKEY' export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` fi -if [[ -z "$(pgrep -u `whoami` gpg-agent)" ]] && [[ -n $XDG_RUNTIME_DIR ]] && type gpg-agent &>/dev/null; then +if [[ -z "$(pgrep -u `whoami` gpg-agent)" ]] && type gpg-agent &>/dev/null; then echo 'login: Starting gpg-agent' - mkdir -p "${XDG_RUNTIME_DIR}/sessions" - gpg-agent --daemon --write-env-file "${XDG_RUNTIME_DIR}/sessions/gpg" >/dev/null + gpg-agent --daemon --write-env-file ~/.sessions/gpg >/dev/null fi -if [[ -f "${XDG_RUNTIME_DIR}/sessions/gpg" ]]; then +if [[ -f ~/.sessions/gpg ]]; then echo 'login: Setting gpg-agent info:' - cat "${XDG_RUNTIME_DIR}/sessions/gpg" - . "${XDG_RUNTIME_DIR}/sessions/gpg" + cat ~/.sessions/gpg + . ~/.sessions/gpg export GPG_AGENT_INFO #export SSH_AUTH_SOCK fi @@ -76,8 +77,7 @@ export _JAVA_OPTIONS # X11 if [[ -z $XAUTHORITY ]]; then #export XAUTHORITY="$HOME/.Xauthority" - mkdir -p "${XDG_RUNTIME_DIR}/sessions" - export XAUTHORITY="${XDG_RUNTIME_DIR}/sessions/Xauthority" + export XAUTHORITY=$HOME/.sessions/Xauthority fi # D-Bus -- cgit v1.2.3-2-g168b From c3a6b5911e6d7b5a0e7520d6961fb106a628001d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 4 Apr 2014 13:12:14 -0400 Subject: move the daemon stuff to use a systemd user instance --- .config/login.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to '.config/login.sh') diff --git a/.config/login.sh b/.config/login.sh index 1fd9505..3c29c99 100644 --- a/.config/login.sh +++ b/.config/login.sh @@ -29,7 +29,7 @@ export TMPDIR="$HOME/tmp" . "$HOME/.local/lib/xdg.sh" mkdir -p -- "$XDG_RUNTIME_DIR/sessions" -ln -sf -- "$XDG_RUNTIME_DIR/sessions" ~/.sessions +ln -sfT -- "$XDG_RUNTIME_DIR/sessions" ~/.sessions # Settings ########################################################### @@ -52,10 +52,6 @@ if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then echo 'login: Setting GPGKEY' export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` fi -if [[ -z "$(pgrep -u `whoami` gpg-agent)" ]] && type gpg-agent &>/dev/null; then - echo 'login: Starting gpg-agent' - gpg-agent --daemon --write-env-file ~/.sessions/gpg >/dev/null -fi if [[ -f ~/.sessions/gpg ]]; then echo 'login: Setting gpg-agent info:' cat ~/.sessions/gpg -- cgit v1.2.3-2-g168b