From ecc5f7524bb46cd9adad37920fa264c50ddd5e27 Mon Sep 17 00:00:00 2001
From: Silvio Rhatto <rhatto@riseup.net>
Date: Mon, 7 Mar 2016 14:12:50 -0300
Subject: TODO: Make sure to finish all background processes started on
 xsessionrc

---
 TODO.md             |  1 +
 bashrc.dot.link     |  6 ++++++
 profile.dot.link    | 27 +++++++++++++++++++--------
 xsessionrc.dot.link |  3 +++
 4 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/TODO.md b/TODO.md
index 70ca064..0864fe7 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,6 +1,7 @@
 TODO
 ====
 
+* Make sure to finish all background processes started on xsessionrc.
 * Font configuration on [st](http://git.suckless.org/st/tree/st.c):
   * http://marc.info/?l=freedesktop-fontconfig&m=135518559526767&w=2
   * http://wiki.gentoo.org/wiki/Fontconfig
diff --git a/bashrc.dot.link b/bashrc.dot.link
index ab85f71..6a0b7f9 100644
--- a/bashrc.dot.link
+++ b/bashrc.dot.link
@@ -2,5 +2,11 @@
 # Bash initialization
 #
 
+# If not running interactively, don't do anything
+case $- in
+    *i*) ;;
+      *) return;;
+esac
+
 # Load the profile
 . $HOME/.profile
diff --git a/profile.dot.link b/profile.dot.link
index b1c8d96..40f41d2 100644
--- a/profile.dot.link
+++ b/profile.dot.link
@@ -98,17 +98,28 @@ export EDITOR="vim"
 export GIT_PS1_SHOWDIRTYSTATE=""
 export GIT_PS1_SHOWUNTRACKEDFILES=""
 
-# Load git completion if needed
-if [ ! -z "$BASH" ]; then
-  if ! type __git_ps1 2> /dev/null | head -1 | grep -q function; then
-    if [ -e "/etc/bash_completion.d/git-prompt" ]; then
-      . /etc/bash_completion.d/git-prompt
-    elif [ -e "/etc/bash_completion.d/git" ]; then
-      . /etc/bash_completion.d/git
-    fi
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if ! shopt -oq posix; then
+  if [ -f /usr/share/bash-completion/bash_completion ]; then
+    . /usr/share/bash-completion/bash_completion
+  elif [ -f /etc/bash_completion ]; then
+    . /etc/bash_completion
   fi
 fi
 
+# Load git completion if needed
+#if [ ! -z "$BASH" ]; then
+#  if ! type __git_ps1 2> /dev/null | head -1 | grep -q function; then
+#    if [ -e "/etc/bash_completion.d/git-prompt" ]; then
+#      . /etc/bash_completion.d/git-prompt
+#    elif [ -e "/etc/bash_completion.d/git" ]; then
+#      . /etc/bash_completion.d/git
+#    fi
+#  fi
+#fi
+
 # Less configuration
 # See http://seclists.org/fulldisclosure/2014/Nov/74
 export LESSSECURE="1"
diff --git a/xsessionrc.dot.link b/xsessionrc.dot.link
index bb6a457..4a1dab2 100755
--- a/xsessionrc.dot.link
+++ b/xsessionrc.dot.link
@@ -97,6 +97,9 @@ if [ "$OSVERSION" != "6" ]; then
   true
 fi
 
+# Make sure to finish all background processes
+#trap 'kill $(jobs -p)' EXIT
+
 # Start window manager
 if [ "$OSVERSION" == "7" ]; then
   $WINDOW_MANAGER
-- 
cgit v1.2.3