Skip to content

Commit

Permalink
Avoid use of GNOME when gnome-open isn't present
Browse files Browse the repository at this point in the history
It's possible for some GNOME components to be in use and
GNOME_DESKTOP_SESSION_ID to be set even though gnome-open is not
installed.

Modern Ubuntu installations are like this (reproduced on Trusty).

The result is that Launchy will incorrectly determine the current
environment is GNOME-like, only to find "gnome-open" missing and then
fall back on "fallback_browsers" instead of using a reasonable
alternative like "Xdg", and that means the user's preferred default
browser (or whatever) won't be used.
  • Loading branch information
Daniel Farina committed Sep 29, 2014
1 parent 4fe99f9 commit e560c17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/launchy/detect/nix_desktop_environment.rb
Expand Up @@ -42,7 +42,8 @@ def self.browser

class Gnome < NixDesktopEnvironment
def self.is_current_desktop_environment?
ENV['GNOME_DESKTOP_SESSION_ID']
ENV['GNOME_DESKTOP_SESSION_ID'] &&
Launchy::Application.find_executable( 'gnome-open' )
end

def self.browser
Expand Down

0 comments on commit e560c17

Please sign in to comment.