diff --git a/data/glade/preferences_window.glade b/data/glade/preferences_window.glade
index d8884304a..2d1250b61 100644
--- a/data/glade/preferences_window.glade
+++ b/data/glade/preferences_window.glade
@@ -3001,6 +3001,7 @@ Disabled
Autodetect on every Gajim startup
Always use GNOME default applications
Always use KDE default applications
+Always use XFCE4 default applications
Custom
False
True
diff --git a/src/config.py b/src/config.py
index 87574e624..698627b6e 100644
--- a/src/config.py
+++ b/src/config.py
@@ -929,7 +929,7 @@ class PreferencesWindow:
def on_applications_combobox_changed(self, widget):
gajim.config.set('autodetect_browser_mailer', False)
- if widget.get_active() == 3:
+ if widget.get_active() == 4:
self.xml.get_widget('custom_apps_frame').show()
gajim.config.set('openwith', 'custom')
else:
@@ -939,6 +939,8 @@ class PreferencesWindow:
gajim.config.set('openwith', 'gnome-open')
elif widget.get_active() == 2:
gajim.config.set('openwith', 'kfmclient exec')
+ elif widget.get_active() == 3:
+ gajim.config.set('openwith', 'exo-open')
self.xml.get_widget('custom_apps_frame').hide()
gajim.interface.save_config()
diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py
index e8608c511..98a3d6f28 100644
--- a/src/gtkgui_helpers.py
+++ b/src/gtkgui_helpers.py
@@ -188,6 +188,8 @@ def autodetect_browser_mailer():
gajim.config.set('openwith', 'gnome-open')
elif user_runs_kde():
gajim.config.set('openwith', 'kfmclient exec')
+ elif user_runs_xfce():
+ gajim.config.set('openwith', 'exo-open')
else:
gajim.config.set('openwith', 'custom')
@@ -197,6 +199,12 @@ def user_runs_gnome():
def user_runs_kde():
return 'startkde' in get_running_processes()
+der user_runs_xfce():
+ procs = get_running_processes()
+ if 'startxfce4' in procs or 'xfce4-session' in procs:
+ return True
+ return False
+
def get_running_processes():
'''returns running processes or None (if not /proc exists)'''
if os.path.isdir('/proc'):