Class: Fusuma::Plugin::Appmatcher::GnomeExtensions::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb

Overview

Install Gnome Extension

Constant Summary collapse

EXTENSION =
"./[email protected]"

Instance Method Summary collapse

Instance Method Details

#installObject



14
15
16
17
18
19
20
21
# File 'lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb', line 14

def install
  pid = UserSwitcher.new.as_user(proctitle: self.class.name.underscore) do |user|
    FileUtils.cp_r(source_path, user_extension_dir(user.username))
    puts "Installed Appmatcher Gnome Shell Extension to #{user_extension_dir(user.username)}"
    puts "Restart your session, then activate Appmatcher on gnome-extensions-app"
  end
  Process.waitpid(pid)
end

#installed?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb', line 33

def installed?
  File.exist?(install_path)
end

#uninstallObject



23
24
25
26
27
28
29
30
31
# File 'lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb', line 23

def uninstall
  return puts "Appmatcher Gnome Shell Extension is not installed in #{user_extension_dir}/" unless installed?

  pid = UserSwitcher.new.as_user(proctitle: self.class.name.underscore) do |user|
    FileUtils.rm_r(install_path(user.username))
    puts "Uninstalled Appmatcher Gnome Shell Extension from #{install_path(user.username)}"
  end
  Process.waitpid(pid)
end