(self)
| 150 | self.settings_update() |
| 151 | |
| 152 | def _gnome_extension_path(self): |
| 153 | data_home = os.environ.get("XDG_DATA_HOME", os.path.expanduser("~/.local/share")) |
| 154 | return os.path.join(data_home, "gnome-shell", "extensions", "nyarchpet@nyarchlinux.moe") |
| 155 | |
| 156 | def _gnome_extension_installed(self): |
| 157 | return os.path.isdir(self._gnome_extension_path()) |
| 158 | |
| 159 | def install_gnome_extension(self, button): |
| 160 | uuid = "nyarchpet@nyarchlinux.moe" |
| 161 | extension_path = self._gnome_extension_path() |
| 162 | if not os.path.isdir(extension_path): |
| 163 | os.makedirs(os.path.dirname(extension_path), exist_ok=True) |
| 164 | subprocess.check_output([ |
| 165 | "git", "clone", |
| 166 | "https://github.com/NyarchLinux/NyarchPetGnomeExtension/", |
| 167 | extension_path, |
| 168 | ]) |
| 169 | else: |
| 170 | subprocess.check_output(["git", "-C", extension_path, "pull"]) |
| 171 | subprocess.run(["gnome-extensions", "enable", uuid], check=False) |
| 172 | self.settings_update() |
nothing calls this directly
no outgoing calls
no test coverage detected