diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f06ac67..5f88645 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,7 +37,7 @@ jobs: with: prefix-key: rust-build - name: Build - run: cargo build + run: cargo build --release --all-features - name: Test run: cargo test --all-features diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 2b9764b..32d94cb 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -47,6 +47,10 @@ pub enum Command { /// Specify a path to custom hyprswitch executable, uses current executable if not set #[arg(long)] exe: Option, + + /// Use systemd for starting the daemon + #[arg(long, default_value_t = true)] + systemd: bool, }, /// Initialize and start the Daemon Init { diff --git a/src/daemon/gui/debug.rs b/src/daemon/gui/debug.rs index 440e266..07be8e1 100644 --- a/src/daemon/gui/debug.rs +++ b/src/daemon/gui/debug.rs @@ -7,17 +7,23 @@ pub fn debug_gui(class: String, list: bool, desktop_files: bool) -> anyhow::Resu gtk4::init().context("Failed to init gtk")?; let theme = gtk4::IconTheme::new(); for icon in theme.icon_names() { - println!("Icon: {icon}"); + #[allow(clippy::print_stdout)] + { + println!("Icon: {icon}"); + } } } (false, true) => { let map = get_desktop_files_debug()?; for (name, file) in map { - println!( - "Desktop file: {} [{:?}] -> {:?} from {:?}", - name.0, name.1, file.0, file.1, - ); + #[allow(clippy::print_stdout)] + { + println!( + "Desktop file: {} [{:?}] -> {:?} from {:?}", + name.0, name.1, file.0, file.1, + ); + } } } _ => { @@ -26,18 +32,26 @@ pub fn debug_gui(class: String, list: bool, desktop_files: bool) -> anyhow::Resu return Ok(()); } - println!("Icon for class {class}"); + #[allow(clippy::print_stdout)] + { + println!("Icon for class {class}"); + } gtk4::init().context("Failed to init gtk")?; let theme = gtk4::IconTheme::new(); let name = get_icon_name_debug(&class) .with_context(|| format!("Failed to get icon name for class {class}"))?; - println!( - "Icon: {:?} from desktop file cache: {:?} found by {:?}", - name.0, name.2, name.1 - ); + #[allow(clippy::print_stdout)] + { + println!( + "Icon: {:?} from desktop file cache: {:?} found by {:?}", + name.0, name.2, name.1 + ); + } if theme.has_icon(&class) { - println!("Theme contains icon for class {class}"); + #[allow(clippy::print_stdout)] { + println!("Theme contains icon for class {class}"); + } } } } diff --git a/src/daemon/gui/maps.rs b/src/daemon/gui/maps.rs index 69c7235..fb01d1d 100644 --- a/src/daemon/gui/maps.rs +++ b/src/daemon/gui/maps.rs @@ -284,6 +284,7 @@ pub(in crate::daemon::gui) fn get_icon_name_debug( find_icon_path_by_name(map, icon) } +#[allow(clippy::type_complexity)] pub(in crate::daemon::gui) fn get_desktop_files_debug( ) -> anyhow::Result, Source), (Box, Box)>> { let mut map = HashMap::new(); diff --git a/src/main.rs b/src/main.rs index a9e7e66..eb63ac3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,7 +45,7 @@ fn main() -> anyhow::Result<()> { envvar_dump(); - let _ = check_version().warn("Unable to check Hyprland version, continuing anyway"); + check_version().warn("Unable to check Hyprland version, continuing anyway"); global::DRY .set(cli.global_opts.dry_run) @@ -56,7 +56,7 @@ fn main() -> anyhow::Result<()> { match cli.command { #[cfg(feature = "config")] - cli::Command::Generate { exe } => { + cli::Command::Generate { exe, .. } => { info!("Loading config"); let config = hyprswitch::config::load().context("Failed to load config")?; hyprswitch::config::validate(&config).context("Failed to validate config")?;