Sha256: 9fedb90998d3423978fbb6437106b6bcc84dc4719bb6607c3f37f74480bb5317

Contents?: true

Size: 1.48 KB

Versions: 5

Compression:

Stored size: 1.48 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "optparse"
require_relative "../lib/fusuma/plugin/appmatcher"

option = {}
opt = OptionParser.new

opt.on("-l", "--list-applications",
  "List applications") do |v|
  option[:list] = v
end

opt.on("--version", "Show version") do |v|
  option[:version] = v
end

opt.on("--install-gnome-extension",
  "Install GNOME extension for appmatcher") do |v|
  option[:install_gnome_extension] = v
end

opt.on("--uninstall-gnome-extension",
  "Uninstall GNOME extension for appmatcher") do |v|
  option[:uninstall_gnome_extension] = v
end

opt.parse!(ARGV)

if option[:install_gnome_extension]
  require_relative "../lib/fusuma/plugin/appmatcher/gnome_extensions/installer"
  Fusuma::Plugin::Appmatcher::GnomeExtensions::Installer.new.install
  return
end

if option[:uninstall_gnome_extension]
  require_relative "../lib/fusuma/plugin/appmatcher/gnome_extensions/installer"
  Fusuma::Plugin::Appmatcher::GnomeExtensions::Installer.new.uninstall
  return
end

if option[:list]
  matcher = Fusuma::Plugin::Appmatcher.backend_klass::Matcher.new
  puts matcher.running_applications
  return
end

if option[:version]
  puts Fusuma::Plugin::Appmatcher::VERSION
  puts "XDG_CURRENT_DESKTOP: #{ENV.fetch("XDG_CURRENT_DESKTOP", nil)}"
  puts "XDG_SESSION_TYPE: #{ENV.fetch("XDG_SESSION_TYPE", nil)}"
  puts "Backend: #{Fusuma::Plugin::Appmatcher.backend_klass}"
  return
end

matcher = Fusuma::Plugin::Appmatcher.backend_klass::Matcher.new
puts matcher.active_application

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fusuma-plugin-appmatcher-0.7.1 exe/fusuma-appmatcher
fusuma-plugin-appmatcher-0.7.0 exe/fusuma-appmatcher
fusuma-plugin-appmatcher-0.6.1 exe/fusuma-appmatcher
fusuma-plugin-appmatcher-0.6.0 exe/fusuma-appmatcher
fusuma-plugin-appmatcher-0.5.0 exe/fusuma-appmatcher