Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-02 13:41:28 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-02 13:41:28 (GMT)
commit90b4dc1e1d73582df0071ea996f9cad6ab957115 (patch)
tree53f9142dcec4d8d06efeb7e0e5888990e827b130 /scripts
parent14dd545314bbeaced5d11364dd4fa79f8cc34e2c (diff)
Use Xephyr when running under X
Only the display manager can authenticate a new X session with systemd. In a non authenticated session pulseaudio doesn't work and probably other stuff.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get-screen-dpi6
-rwxr-xr-xscripts/shell/start-sugar10
2 files changed, 14 insertions, 2 deletions
diff --git a/scripts/get-screen-dpi b/scripts/get-screen-dpi
new file mode 100755
index 0000000..8165920
--- /dev/null
+++ b/scripts/get-screen-dpi
@@ -0,0 +1,6 @@
+#!/usr/bin/python
+
+from gi.repository import Gtk
+
+settings = Gtk.Settings.get_default()
+print settings.get_property('gtk-xft-dpi') / 1024
diff --git a/scripts/shell/start-sugar b/scripts/shell/start-sugar
index 3ac2f09..a345eef 100755
--- a/scripts/shell/start-sugar
+++ b/scripts/shell/start-sugar
@@ -4,6 +4,8 @@ shelldir=`dirname "$0"`
scriptsdir=`dirname "$shelldir"`
rootdir=`dirname "$scriptsdir"`
display=`$scriptsdir/find-free-display`
+screen_dpi=`$scriptsdir/get-screen-dpi`
+xephyr_options="-dpi $screen_dpi"
if [ -f $rootdir/config ]; then
source $rootdir/config
@@ -23,8 +25,12 @@ if [ ! -z $SUGAR_PROFILE ]; then
fi
fi
-if [ -z $RUN_IN_WINDOW ]; then
+if [ -z $DISPLAY ]; then
xinit $scriptsdir/xinitrc -- $display
else
- xinit $scriptsdir/xinitrc -- /usr/bin/Xephyr $display
+ if [ -z $RUN_IN_WINDOW ]; then
+ xephyr_options="$xephyr_options -fullscreen"
+ fi
+
+ xinit $scriptsdir/xinitrc -- /usr/bin/Xephyr $display $xephyr_options
fi