Sawfish + xdg-open



Hi all,

I've been spending some time on the issue that xdg-open can't be used
properly when not using KDE/GNOME/XFCE. And I've found the issue:

xdg-open doesn't find one of the above three and tries to use an
internal function which does not work for me, as it for example gets
the mimetype application/octet-stream, though it is x-directory/normal
or inode/directory. 

So I've thought about letting sawfish add a WINDOW_MANAGER property to
the root window. If gnome-int is loaded it would be set to
sawfish-gnome, if kde-int is loaded to sawfish-kde else to sawfish.

(a similar thing is done by XFCE)

Next setup xdg-open to use gnome-open when sawfish is beeing run
standalone. (if you want to use xfce-open or kfmclient, simply the DE=
value)

Patches attached.

/me now happily using FolderView Screenlet which now opens
GNOME-Commander instead of nothing :)

Regards,
Chris
diff --git a/lisp/sawfish/wm/integration/gnome.jl b/lisp/sawfish/wm/integration/gnome.jl
index 606e557..4140bc3 100644
--- a/lisp/sawfish/wm/integration/gnome.jl
+++ b/lisp/sawfish/wm/integration/gnome.jl
@@ -30,6 +30,9 @@
 
   (define-structure-alias gnome-int sawfish.wm.integration.gnome)
 
+  ;; set root windows WINDOW_MANAGER property to sawfish-gnome
+  (set-x-text-property 'root 'WINDOW_MANAGER (vector "sawfish-gnome"))
+
   ;; invoke the GNOME terminal instead of xterm
   (unless (variable-customized-p 'xterm-program)
     (setq xterm-program "gnome-terminal.wrapper"))
diff --git a/lisp/sawfish/wm/integration/kde.jl b/lisp/sawfish/wm/integration/kde.jl
index 1af6bb6..a0b391c 100644
--- a/lisp/sawfish/wm/integration/kde.jl
+++ b/lisp/sawfish/wm/integration/kde.jl
@@ -30,6 +30,9 @@
 
   (define-structure-alias kde-int sawfish.wm.integration.kde)
 
+  ;; set root windows WINDOW_MANAGER property to sawfish-kde
+  (set-x-text-property 'root 'WINDOW_MANAGER (vector sawfish-kde))
+
   ;; invoke the KDE terminal instead of xterm
   (unless (variable-customized-p 'xterm-program)
     (setq xterm-program "konsole"))
diff --git a/lisp/sawfish/wm/session/init.jl b/lisp/sawfish/wm/session/init.jl
index 4d124ae..c04624e 100644
--- a/lisp/sawfish/wm/session/init.jl
+++ b/lisp/sawfish/wm/session/init.jl
@@ -191,6 +191,9 @@ that feature off, allowing some broken clients to be session managed.")
       ;; we need to start before gmc, otherwise it won't hint its icons
       (sm-set-property "_GSM_Priority" sm-gsm-priority)
 
+      ;; set WINDOW_MANAGER to sawfish (...)
+      (set-x-text-property 'root 'WINDOW_MANAGER (vector "sawfish"))
+
       ;; 2. load the session if it exists
       (let ((file (sm-find-file sm-client-id sm-prefix)))
 	(when (file-exists-p file)
--- a/usr/bin/xdg-open	2009-11-01 13:44:18.968439032 +0100
+++ b/usr/bin/xdg-open	2009-11-01 13:43:59.698682789 +0100
@@ -304,6 +304,7 @@
     if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
     elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
     elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
+    elif xprop -root WINDOW_MANAGER | grep ' = \"sawfish\"' >/dev/null 2>&1; then DE=gnome;
     fi
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]