]> piware.de Git - bin.git/commitdiff
add gsession start script
authorMartin Pitt <martin.pitt@ubuntu.com>
Thu, 18 Sep 2014 04:52:07 +0000 (06:52 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Thu, 18 Sep 2014 04:52:07 +0000 (06:52 +0200)
gsession [new file with mode: 0755]

diff --git a/gsession b/gsession
new file mode 100755 (executable)
index 0000000..bf5334a
--- /dev/null
+++ b/gsession
@@ -0,0 +1,66 @@
+#!/bin/bash
+set -m
+
+xmodmap ~/.xmodmaprc
+
+# https://launchpad.net/bugs/1063617
+#gsettings reset org.gnome.desktop.wm.preferences auto-raise
+#gsettings set org.gnome.desktop.wm.keybindings lower "['<Control>b']"
+#gsettings set org.gnome.desktop.wm.keybindings maximize "['<Super>Up']"
+#gsettings set org.gnome.desktop.wm.keybindings unmaximize "['<Super>Down']"
+#gsettings set org.gnome.desktop.wm.preferences focus-mode sloppy
+
+# determine resolution
+out=`xrandr | egrep -o 'current [0-9]+ x [0-9]+'`
+XRES=`echo "$out" | cut -f2 -d' '`
+YRES=`echo "$out" | cut -f4 -d' '`
+
+if ip route | grep -q ^default; then
+    if [ `date +%u` -lt 6 ] && [ `date +%k` -lt 18 ]; then 
+        true
+        env TERM=xterm gnome-terminal --maximize --zoom=0.85 -t IRC -x weechat
+        #setsid gtimelog
+    fi
+
+    sleep 1
+
+    wmctrl -o $XRES,0
+    setsid firefox 
+    sleep 5
+    wmctrl -o 0,0
+
+    #if xrandr | grep -q 1280x1024; then
+    #    wmctrl -o 0,1024
+    #else
+    #    wmctrl -o 0,800
+    #fi
+    #setsid empathy
+fi
+
+if [ "$YRES" -gt 1000 ]; then
+    xrandr --output LVDS1 --off
+
+    gnome-terminal --geometry=90x34+1060+0
+    gnome-terminal --geometry=90x25+1060+570
+    gnome-terminal --window --geometry=130x52+4+0 --zoom=1.2 --active --tab --zoom=1.2
+
+    sleep .3
+    wmctrl -o 0,$YRES
+    sleep .3
+    gnome-terminal --geometry=130x60+5+30 --zoom=1.2 -t Mutt -x mutt -f =mbox
+    sleep .2
+    wmctrl -o 0,0
+else
+    gnome-terminal --geometry=80x46+880+0 --zoom=0.85
+    gnome-terminal --window --geometry=124x35+0+0  --active --tab
+
+    wmctrl -o 0,$YRES
+    sleep .3
+    gnome-terminal --geometry=129x49+0+30 -t Mutt -x mutt -f =mbox
+    sleep .2
+    wmctrl -o 0,0
+fi
+
+if ip route | grep -q ^default; then
+    gnome-terminal --zoom=0.85 -x offlineimap
+fi