Class: Fusuma::Plugin::Appmatcher::GnomeExtensions::Installer
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Appmatcher::GnomeExtensions::Installer
show all
- Includes:
- UserSwitcher
- Defined in:
- lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb
Overview
Instance Method Summary
collapse
#as_user, #drop_priv, login_user
Instance Method Details
#enabled? ⇒ Boolean
38
39
40
41
|
# File 'lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb', line 38
def enabled?
enabled_extensions = YAML.load(`gsettings get org.gnome.shell enabled-extensions`)
enabled_extensions&.include?(EXTENSION)
end
|
#install ⇒ Object
15
16
17
18
19
20
21
22
|
# File 'lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb', line 15
def install
pid = as_user(proctitle: self.class.name.underscore) do |user|
FileUtils.cp_r(source_path, install_path(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
34
35
36
|
# File 'lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb', line 34
def installed?
File.exist?(install_path)
end
|
#uninstall ⇒ Object
24
25
26
27
28
29
30
31
32
|
# File 'lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb', line 24
def uninstall
return puts "Appmatcher Gnome Shell Extension is not installed in #{user_extension_dir}/" unless installed?
pid = 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
|