Code

Added size magic for browser
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jun 2007 15:35:37 +0000 (15:35 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jun 2007 15:35:37 +0000 (15:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6739 594d385d-05f5-0310-b6e9-bd551577e9d8

contrib/scripts/start-gosa.sh

index 556a0fd9a21599ed0972e1b559cb03ce21dcc7be..c3976ed81862d8d2c8ea0d6a88dde1ff2952e0f4 100755 (executable)
@@ -47,6 +47,20 @@ if [ ! -d $HOME/.mozilla/$dbrowser/*.gosa ]; then
                config=`echo $HOME/.mozilla/$dbrowser/*.gosa/`
        fi
 
+       # Catch resolution
+       width=1024
+       height=768
+       if which xrandr > /dev/null; then
+               if xrandr 1> /dev/null 2> /dev/null; then
+                       resolution=$(xrandr | sed -n '/current/s/^.*current \([0-9]*\)[^0-9]*\([0-9]*\).*$/\1 \2/p')
+                       width=${resolution%% *}
+                       height=${resolution##* }
+
+                       [ $width -gt 1050 ] && width=1050
+                       [ $height -gt 850 ] && height=850
+               fi
+       fi
+
        cat << EOF > $config/prefs.js
 # Mozilla User Preferences
 
@@ -142,8 +156,8 @@ cat << EOF > $config/localstore.rdf
                    screenX="50"
                    screenY="25"
                    sizemode="normal"
-                   width="1000"
-                   height="760" />
+                   width="$width"
+                   height="$height" />
   <RDF:Description RDF:about="chrome://help/content/help.xul">
     <NC:persist RDF:resource="chrome://help/content/help.xul#help"/>
   </RDF:Description>