From 383c52e3d5bad9a5c6653f5e22e530c54b47b27d Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 18 Sep 2014 06:52:07 +0200 Subject: [PATCH] add gsession start script --- gsession | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 gsession diff --git a/gsession b/gsession new file mode 100755 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 "['b']" +#gsettings set org.gnome.desktop.wm.keybindings maximize "['Up']" +#gsettings set org.gnome.desktop.wm.keybindings unmaximize "['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 -- 2.39.5