Upgrade gnome shell extensions (fix #755) (#768)

This commit is contained in:
Roey Darwish Dror
2021-10-25 21:31:13 +03:00
committed by GitHub
parent fab8f1a9f1
commit b6c468c6fb
3 changed files with 24 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ pub enum Step {
Gcloud, Gcloud,
Gem, Gem,
GitRepos, GitRepos,
GnomeShellExtensions,
HomeManager, HomeManager,
Jetpack, Jetpack,
Krew, Krew,

View File

@@ -269,6 +269,9 @@ fn run() -> Result<()> {
runner.execute(Step::Tmux, "tmux", || tmux::run_tpm(&base_dirs, run_type))?; runner.execute(Step::Tmux, "tmux", || tmux::run_tpm(&base_dirs, run_type))?;
runner.execute(Step::Tldr, "TLDR", || unix::run_tldr(run_type))?; runner.execute(Step::Tldr, "TLDR", || unix::run_tldr(run_type))?;
runner.execute(Step::Pearl, "pearl", || unix::run_pearl(run_type))?; runner.execute(Step::Pearl, "pearl", || unix::run_pearl(run_type))?;
runner.execute(Step::GnomeShellExtensions, "Gnome Shell Extensions", || {
unix::upgrade_gnome_extensions(&ctx)
})?;
runner.execute(Step::Sdkman, "SDKMAN!", || { runner.execute(Step::Sdkman, "SDKMAN!", || {
unix::run_sdkman(&base_dirs, config.cleanup(), run_type) unix::run_sdkman(&base_dirs, config.cleanup(), run_type)
})?; })?;

View File

@@ -18,6 +18,7 @@ use std::{env, path::Path};
const INTEL_BREW: &str = "/usr/local/bin/brew"; const INTEL_BREW: &str = "/usr/local/bin/brew";
const ARM_BREW: &str = "/opt/homebrew/bin/brew"; const ARM_BREW: &str = "/opt/homebrew/bin/brew";
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
#[allow(dead_code)] #[allow(dead_code)]
pub enum BrewVariant { pub enum BrewVariant {
@@ -130,6 +131,25 @@ pub fn run_fish_plug(ctx: &ExecutionContext) -> Result<()> {
ctx.run_type().execute(&fish).args(["-c", "plug update"]).check_run() ctx.run_type().execute(&fish).args(["-c", "plug update"]).check_run()
} }
pub fn upgrade_gnome_extensions(ctx: &ExecutionContext) -> Result<()> {
let gdbus = require("gdbus")?;
print_separator("Gnome Shell extensions");
ctx.run_type()
.execute(gdbus)
.args(&[
"call",
"--session",
"--dest",
"rg.gnome.Shell.Extensions",
"--object-path",
"org/gnome/Shell/Extensions",
"-method",
"org.gnome.Shell.Extensions.CheckForUpdates",
])
.check_run()
}
pub fn run_brew_formula(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()> { pub fn run_brew_formula(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()> {
require(variant.binary_name())?; require(variant.binary_name())?;
print_separator(variant.step_title()); print_separator(variant.step_title());