]> git.donarmstrong.com Git - x_base.git/blobdiff - .xsession
simplify the window manager fallback code
[x_base.git] / .xsession
index c39b9fbe9418adfffc5584f19d9f5167d0157477..b402817caebf2ff4dec895fd30c4a219d5843894 100755 (executable)
--- a/.xsession
+++ b/.xsession
@@ -51,22 +51,30 @@ elif [ -x /usr/bin/xautolock ]; then
 fi;
 
 if which redshift >/dev/null 2>&1; then
-    (redshift -l 33.9533:-117.3953 >/dev/null 2>&1 &)
+    (redshift >/dev/null 2>&1 &)
 fi;
 
-if [ -x /usr/bin/awesome ]; then 
-    exec /usr/bin/awesome;
-elif [ -x /usr/bin/ion3 ]; then
-    exec /usr/bin/ion3;
-elif [ -x /usr/bin/openbox ]; then
-        exec /usr/bin/openbox;
-elif [ -x /usr/bin/rxvt ]; then
-        exec /usr/bin/rxvt;
-elif [ -x /usr/bin/rxvt-unicode ]; then
-        exec /usr/bin/rxvt-unicode;
-elif [ -x /usr/bin/xterm ]; then
-        exec /usr/bin/xterm;
+if which mopidy >/dev/null 2>&1 && [ -e ~/.config/mopidy/mopidy.conf ]; then
+    (mopidy > /dev/null 2>&1 & );
+elif which mpd >/dev/null 2>&1 && [ -e ~/.mpdconf ]; then
+    (mpd >/dev/null 2>&1 &);
+    MPD_HOST=$(awk '/^bind_to_address/{print $2}' ~/.mpdconf|sed "s|~|$HOME|; s/^\"//; s/\"$//; ");
+    export MPD_HOST;
+fi;
+
+if [ -x /sbin/iw ] && which nm-applet >/dev/null 2>&1 && /sbin/iw list|grep -q '^Wiphy'; then
+    ( nm-applet > /dev/null 2>&1 & );
+fi;
+
+if [ -x /usr/bin/i3 ]; then
+    if [ -x ~/.config/i3/build_config.sh ]; then
+        ~/.config/i3/build_config.sh;
+    fi;
+    exec /usr/bin/i3;
 else
-     # we're screwed.
-     sleep 2s;
+    for prog in awesome ion3 openbox stterm st rxvt rxvt-unicode xterm; do
+        if which $prog >/dev/null 2>&1; then
+            exec $(which $prog)
+        fi
+    done;
 fi;