Sha256: a6fe4a65f0cef259b3f5cdc2f3f28d3057b21ac701138b55b44ab3f20049b650
Contents?: true
Size: 1.67 KB
Versions: 12
Compression:
Stored size: 1.67 KB
Contents
module Launchy::Detect # # Detect the current desktop environment for *nix machines # Currently this is Linux centric. The detection is based upon the detection # used by xdg-open from http://portland.freedesktop.org/wiki/XdgUtils class NixDesktopEnvironment class NotFoundError < Launchy::Error; end extend ::Launchy::DescendantTracker # Detect the current *nix desktop environment # # If the current dekstop environment be detected, the return # NixDekstopEnvironment::Unknown def self.detect found = find_child( :is_current_desktop_environment? ) Launchy.log("Current Desktop environment not found. #{Launchy.bug_report_message}") unless found return found end def self.fallback_browsers %w[ firefox seamonkey opera mozilla netscape galeon ] end #--------------------------------------- # The list of known desktop environments #--------------------------------------- class Kde < NixDesktopEnvironment def self.is_current_desktop_environment? ENV['KDE_FULL_SESSION'] end def self.browser 'kfmclient' end end class Gnome < NixDesktopEnvironment def self.is_current_desktop_environment? ENV['GNOME_DESKTOP_SESSION_ID'] end def self.browser 'gnome-open' end end class Xfce < NixDesktopEnvironment def self.is_current_desktop_environment? if Launchy::Application.find_executable( 'xprop' ) then %x[ xprop -root _DT_SAVE_MODE | grep ' = \"xfce\"$' ].strip.size > 0 else false end end def self.browser 'exo-open' end end end end
Version data entries
12 entries across 12 versions & 2 rubygems