diff --git a/espanso/src/main.rs b/espanso/src/main.rs index 70fd48e..89f2b24 100644 --- a/espanso/src/main.rs +++ b/espanso/src/main.rs @@ -441,14 +441,20 @@ fn main() { .find(|cli| matches.subcommand_matches(&cli.subcommand).is_some()) }; - // When started from the macOS App Bundle, override the default - // handler with "launcher" if not present, otherwise the GUI could not be started. if handler.is_none() { + // When started from the macOS App Bundle, override the default + // handler with "launcher" if not present, otherwise the GUI could not be started. if let Some(context) = std::env::var_os("MAC_LAUNCH_CONTEXT") { if context == "bundle" { handler = CLI_HANDLERS.iter().find(|cli| cli.subcommand == "launcher"); } } + + // When started from a Linux app image, override the default handler with the launcher + // to start espanso when double clicked + if std::env::var_os("APPIMAGE").is_some() { + handler = CLI_HANDLERS.iter().find(|cli| cli.subcommand == "launcher"); + } } if let Some(handler) = handler {