open_uri: try exo-open too, for xfce

master
Yevgen Muntyan 2007-02-04 11:38:34 -06:00
parent e507901593
commit 6252c5f601
2 changed files with 14 additions and 5 deletions

View File

@ -38,7 +38,7 @@
</configure> </configure>
</optimized> </optimized>
</configurations> </configurations>
<file_selector_dir>/usr/share/aclocal-1.4/</file_selector_dir> <file_selector_dir>/home/muntyan/projects/moo/build/optimized/</file_selector_dir>
<run> <run>
<args>--g-fatal-warnings --new-app --mode=project</args> <args>--g-fatal-warnings --new-app --mode=project</args>
<exe>medit/medit</exe> <exe>medit/medit</exe>

View File

@ -61,6 +61,7 @@ typedef enum {
KDE, KDE,
GNOME, GNOME,
DEBIAN, DEBIAN,
XFCE,
UNKNOWN UNKNOWN
} Desktop; } Desktop;
@ -75,10 +76,7 @@ static gboolean open_uri (const char *uri,
char *kfmclient = g_find_program_in_path ("kfmclient"); char *kfmclient = g_find_program_in_path ("kfmclient");
char *gnome_open = g_find_program_in_path ("gnome-open"); char *gnome_open = g_find_program_in_path ("gnome-open");
char *x_www_browser = g_find_program_in_path ("x-www-browser"); char *x_www_browser = g_find_program_in_path ("x-www-browser");
char *exo_open = g_find_program_in_path ("exo-open");
if (want_browser && x_www_browser &&
g_file_test ("/etc/debian_version", G_FILE_TEST_EXISTS))
desktop = DEBIAN;
if (desktop == UNKNOWN) if (desktop == UNKNOWN)
{ {
@ -100,6 +98,8 @@ static gboolean open_uri (const char *uri,
desktop = KDE; desktop = KDE;
else if (!g_ascii_strcasecmp (wm, "metacity") && gnome_open) else if (!g_ascii_strcasecmp (wm, "metacity") && gnome_open)
desktop = GNOME; desktop = GNOME;
else if (!g_ascii_strcasecmp (wm, "xfwm4") && exo_open)
desktop = XFCE;
} }
} }
#endif /* GDK_WINDOWING_X11 */ #endif /* GDK_WINDOWING_X11 */
@ -112,6 +112,8 @@ static gboolean open_uri (const char *uri,
desktop = KDE; desktop = KDE;
else if (gnome_open) else if (gnome_open)
desktop = GNOME; desktop = GNOME;
else if (exo_open)
desktop = XFCE;
} }
switch (desktop) switch (desktop)
@ -129,6 +131,12 @@ static gboolean open_uri (const char *uri,
argv[1] = g_strdup (uri); argv[1] = g_strdup (uri);
break; break;
case XFCE:
argv = g_new0 (char*, 3);
argv[0] = g_strdup (exo_open);
argv[1] = g_strdup (uri);
break;
case DEBIAN: case DEBIAN:
argv = g_new0 (char*, 3); argv = g_new0 (char*, 3);
argv[0] = g_strdup (x_www_browser); argv[0] = g_strdup (x_www_browser);
@ -167,6 +175,7 @@ static gboolean open_uri (const char *uri,
g_free (gnome_open); g_free (gnome_open);
g_free (kfmclient); g_free (kfmclient);
g_free (x_www_browser); g_free (x_www_browser);
g_free (exo_open);
return result; return result;
} }