new file: Makefile
new file: TODO.md modified: src/config.rs modified: src/detect.rs modified: src/diagnose.rs new file: src/gui.rs modified: src/main.rs modified: src/service.rs modified: src/setup.rs modified: src/tray.rs new file: src/util.rs new file: umutray.desktop
This commit is contained in:
+29
-11
@@ -1,11 +1,13 @@
|
||||
mod config;
|
||||
mod detect;
|
||||
mod diagnose;
|
||||
mod gui;
|
||||
mod launcher;
|
||||
mod proton;
|
||||
mod service;
|
||||
mod setup;
|
||||
mod tray;
|
||||
mod util;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::{Parser, Subcommand};
|
||||
@@ -62,12 +64,15 @@ enum Commands {
|
||||
launcher: Option<String>,
|
||||
},
|
||||
|
||||
/// Open the graphical setup wizard for a launcher
|
||||
/// Open the graphical setup wizard. Omit NAME to pick from the launcher list.
|
||||
Setup {
|
||||
/// Launcher name
|
||||
name: String,
|
||||
/// Launcher name (e.g. battlenet). Omit to open the launcher picker.
|
||||
name: Option<String>,
|
||||
},
|
||||
|
||||
/// Open the graphical dashboard (default when launched from app menu)
|
||||
Gui,
|
||||
|
||||
/// Scan common Wine prefix locations for installed launchers
|
||||
Detect {
|
||||
/// Additional directory to scan (repeatable)
|
||||
@@ -214,12 +219,16 @@ enum ConfigAction {
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum ServiceAction {
|
||||
/// Write the unit, daemon-reload, and enable+start the service
|
||||
/// Write the unit, daemon-reload, and enable+start the service (includes app menu entry)
|
||||
Install,
|
||||
/// Stop, disable, and remove the unit file
|
||||
/// Stop, disable, and remove the unit file (includes app menu entry)
|
||||
Uninstall,
|
||||
/// Show `systemctl --user status` for the service
|
||||
Status,
|
||||
/// Install only the app menu entry — no systemd service required
|
||||
InstallDesktop,
|
||||
/// Remove the app menu entry
|
||||
UninstallDesktop,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
@@ -305,12 +314,19 @@ fn main() -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
Commands::Setup { name } => {
|
||||
let l = config.find(&name).ok_or_else(|| {
|
||||
anyhow::anyhow!("unknown launcher '{name}' — try `umutray launchers`")
|
||||
})?;
|
||||
setup::run(&config, l)?;
|
||||
}
|
||||
Commands::Setup { name } => match name {
|
||||
None => setup::run_new(&config)?,
|
||||
Some(n) => {
|
||||
let l = config.find(&n).ok_or_else(|| {
|
||||
anyhow::anyhow!(
|
||||
"unknown launcher '{n}' — try `umutray setup` to add it first"
|
||||
)
|
||||
})?;
|
||||
setup::run(&config, l)?;
|
||||
}
|
||||
},
|
||||
|
||||
Commands::Gui => gui::run(&config)?,
|
||||
|
||||
Commands::Detect { dir, apply } => {
|
||||
detect::run(&config, &dir, apply)?;
|
||||
@@ -402,6 +418,8 @@ fn main() -> Result<()> {
|
||||
ServiceAction::Install => service::install()?,
|
||||
ServiceAction::Uninstall => service::uninstall()?,
|
||||
ServiceAction::Status => service::status()?,
|
||||
ServiceAction::InstallDesktop => service::install_desktop()?,
|
||||
ServiceAction::UninstallDesktop => service::uninstall_desktop()?,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user