From d83c96c9be81f185db621dca6cbdc014a1d873d4 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 14 Mar 2013 01:21:30 +0000 Subject: [PATCH] dot/xinitrc: Overhaul to support XFCE desktop. Gnome 3 is just so bad I'm forced to abandon it. XFCE seems approximately tolerable, so let's go with that for now. I hope that this doesn't break anything else too badly, but maybe it will. --- dot/xinitrc | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/dot/xinitrc b/dot/xinitrc index 9875cad..210a76d 100755 --- a/dot/xinitrc +++ b/dot/xinitrc @@ -156,13 +156,17 @@ start-clients-local () { :; } start-clients () { ## Gnome session. - case "$vnc,$(gnome-session --version 2>&1)" in - no,gnome-session\ 2.3[2-9].* | \ - no,gnome-session\ 2.4[0-9].* | \ - no,gnome-session\ 2.[1-9][0-9][0-9]*) + case "$vnc,$(xfce4-session --version 2>&1),$(gnome-session --version 2>&1)" + in + no,xfce4-session*) + run bginit xfce4-session + ;; + no,*,gnome-session\ 2.3[2-9].* | \ + no,*,gnome-session\ 2.4[0-9].* | \ + no,*,gnome-session\ 2.[1-9][0-9][0-9]*) run bginit gnome-session --session mdw ;; - no,*) + no,*,gnome-session*) run bginit gnome-session ;; esac @@ -348,17 +352,27 @@ session-running-p () { >/dev/null 2>&1 } +dbus-service-running-p () { + dbus-send >/dev/null 2>&1 --session --print-reply \ + --dest=org.freedesktop.DBus / \ + org.freedesktop.DBus.GetNameOwner string:$1 +} + kill-gnome-session () { - if session-running-p; then - info "killing Gnome session manager" - dbus-send --session \ - --dest=org.gnome.SessionManager /org/gnome/SessionManager \ - org.gnome.SessionManager.Logout uint32:2 - for i in 1 2 3 4 5; do - sleep 1 - if ! session-running-p; then break; fi - done - fi + win=nil + while read service object logout; do + if dbus-service-running-p $service; then win=t; break; fi + done <