Module: Fusuma::Plugin::Appmatcher

Defined in:
lib/fusuma/plugin/appmatcher.rb,
lib/fusuma/plugin/appmatcher/x11.rb,
lib/fusuma/plugin/appmatcher/gnome.rb,
lib/fusuma/plugin/appmatcher/version.rb,
lib/fusuma/plugin/appmatcher/user_switcher.rb,
lib/fusuma/plugin/appmatcher/gnome_extension.rb,
lib/fusuma/plugin/appmatcher/unsupported_backend.rb,
lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb

Overview

Detect focused applications.

Defined Under Namespace

Modules: GnomeExtensions, UserSwitcher Classes: Gnome, GnomeExtension, UnsupportedBackend, X11

Constant Summary collapse

VERSION =
"0.7.1"

Class Method Summary collapse

Class Method Details

.backend_klassClass

Returns:

  • (Class)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fusuma/plugin/appmatcher.rb', line 18

def backend_klass
  case xdg_session_type
  when /x11/
    return X11
  when /wayland/
    case xdg_current_desktop
    when /GNOME/
      return GnomeExtension if GnomeExtensions::Installer.new.installed?

      return Gnome
    end
  end

  UnsupportedBackend
end

.xdg_current_desktopObject



38
39
40
# File 'lib/fusuma/plugin/appmatcher.rb', line 38

def xdg_current_desktop
  ENV.fetch("XDG_CURRENT_DESKTOP", "")
end

.xdg_session_typeObject



34
35
36
# File 'lib/fusuma/plugin/appmatcher.rb', line 34

def xdg_session_type
  ENV.fetch("XDG_SESSION_TYPE", "")
end