Class: Launchy::Detect::NixDesktopEnvironment

Inherits:
Object
  • Object
show all
Extended by:
Launchy::DescendantTracker
Defined in:
lib/launchy/detect/nix_desktop_environment.rb

Overview

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 portland.freedesktop.org/

Direct Known Subclasses

Gnome, Kde, NotFound, Xdg, Xfce

Defined Under Namespace

Classes: Gnome, Kde, NotFound, NotFoundError, Xdg, Xfce

Class Method Summary collapse

Methods included from Launchy::DescendantTracker

children, find_child, inherited

Class Method Details

.browsersObject



28
29
30
# File 'lib/launchy/detect/nix_desktop_environment.rb', line 28

def self.browsers
  [browser, fallback_browsers].flatten
end

.detectObject

Detect the current *nix desktop environment

If the current dekstop environment be detected, the return NixDekstopEnvironment::Unknown



18
19
20
21
22
# File 'lib/launchy/detect/nix_desktop_environment.rb', line 18

def self.detect
  found = find_child(:is_current_desktop_environment?)
  Launchy.log("Current Desktop environment not found. #{Launchy.bug_report_message}") unless found
  found
end

.fallback_browsersObject



24
25
26
# File 'lib/launchy/detect/nix_desktop_environment.rb', line 24

def self.fallback_browsers
  %w[firefox iceweasel seamonkey opera mozilla netscape galeon links lynx].map { |x| ::Launchy::Argv.new(x) }
end