Rename install/uninstall to register/unregister
This commit is contained in:
parent
ab824a62ac
commit
32dce72acf
26
src/main.rs
26
src/main.rs
|
@ -51,7 +51,7 @@ mod bridge;
|
||||||
mod engine;
|
mod engine;
|
||||||
mod config;
|
mod config;
|
||||||
mod system;
|
mod system;
|
||||||
mod install;
|
mod sysdaemon;
|
||||||
mod context;
|
mod context;
|
||||||
mod matcher;
|
mod matcher;
|
||||||
mod keyboard;
|
mod keyboard;
|
||||||
|
@ -94,10 +94,10 @@ fn main() {
|
||||||
.about("Tool to detect current window properties, to simplify filters creation."))
|
.about("Tool to detect current window properties, to simplify filters creation."))
|
||||||
.subcommand(SubCommand::with_name("daemon")
|
.subcommand(SubCommand::with_name("daemon")
|
||||||
.about("Start the daemon without spawning a new process."))
|
.about("Start the daemon without spawning a new process."))
|
||||||
.subcommand(SubCommand::with_name("install")
|
.subcommand(SubCommand::with_name("register")
|
||||||
.about("MacOS and Linux only. Register espanso in the system daemon manager."))
|
.about("MacOS only. Register espanso in the system daemon manager."))
|
||||||
.subcommand(SubCommand::with_name("uninstall")
|
.subcommand(SubCommand::with_name("unregister")
|
||||||
.about("MacOS and Linux only. Unregister espanso from the system daemon manager."))
|
.about("MacOS only. Unregister espanso from the system daemon manager."))
|
||||||
.subcommand(SubCommand::with_name("log")
|
.subcommand(SubCommand::with_name("log")
|
||||||
.about("Print the latest daemon logs."))
|
.about("Print the latest daemon logs."))
|
||||||
.subcommand(SubCommand::with_name("start")
|
.subcommand(SubCommand::with_name("start")
|
||||||
|
@ -155,13 +155,13 @@ fn main() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(_) = matches.subcommand_matches("install") {
|
if let Some(_) = matches.subcommand_matches("register") {
|
||||||
install_main(config_set);
|
register_main(config_set);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(_) = matches.subcommand_matches("uninstall") {
|
if let Some(_) = matches.subcommand_matches("unregister") {
|
||||||
uninstall_main(config_set);
|
unregister_main(config_set);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,12 +543,12 @@ fn log_main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn install_main(config_set: ConfigSet) {
|
fn register_main(config_set: ConfigSet) {
|
||||||
install::install(config_set);
|
sysdaemon::register(config_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn uninstall_main(config_set: ConfigSet) {
|
fn unregister_main(config_set: ConfigSet) {
|
||||||
install::uninstall(config_set);
|
sysdaemon::unregister(config_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn acquire_lock() -> Option<File> {
|
fn acquire_lock() -> Option<File> {
|
||||||
|
|
|
@ -23,18 +23,13 @@ use crate::config::ConfigSet;
|
||||||
|
|
||||||
// INSTALLATION
|
// INSTALLATION
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
|
||||||
pub fn install(config_set: ConfigSet) {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
const MAC_PLIST_CONTENT : &str = include_str!("res/mac/com.federicoterzi.espanso.plist");
|
const MAC_PLIST_CONTENT : &str = include_str!("res/mac/com.federicoterzi.espanso.plist");
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
const MAC_PLIST_FILENAME : &str = "com.federicoterzi.espanso.plist";
|
const MAC_PLIST_FILENAME : &str = "com.federicoterzi.espanso.plist";
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn install(_config_set: ConfigSet) {
|
pub fn register(_config_set: ConfigSet) {
|
||||||
use std::fs::create_dir_all;
|
use std::fs::create_dir_all;
|
||||||
use std::process::{Command, ExitStatus};
|
use std::process::{Command, ExitStatus};
|
||||||
|
|
||||||
|
@ -82,7 +77,7 @@ pub fn install(_config_set: ConfigSet) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn uninstall(_config_set: ConfigSet) {
|
pub fn unregister(_config_set: ConfigSet) {
|
||||||
use std::fs::create_dir_all;
|
use std::fs::create_dir_all;
|
||||||
use std::process::{Command, ExitStatus};
|
use std::process::{Command, ExitStatus};
|
||||||
|
|
||||||
|
@ -104,12 +99,26 @@ pub fn uninstall(_config_set: ConfigSet) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LINUX
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
pub fn register(config_set: ConfigSet) {
|
||||||
|
println!("Linux does not support automatic system daemon integration.");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
pub fn unregister(config_set: ConfigSet) {
|
||||||
|
println!("Linux does not support automatic system daemon integration.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// WINDOWS
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub fn install(_config_set: ConfigSet) {
|
pub fn register(_config_set: ConfigSet) {
|
||||||
println!("Windows does not support system daemon integration.")
|
println!("Windows does not support automatic system daemon integration.")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub fn uninstall(_config_set: ConfigSet) {
|
pub fn unregister(_config_set: ConfigSet) {
|
||||||
println!("Windows does not support system daemon integration.")
|
println!("Windows does not support automatic system daemon integration.")
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user