refactor: remove client module and associated show command logic
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
use std::io::Write;
|
||||
|
||||
pub fn send_show() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let runtime_dir =
|
||||
std::env::var("XDG_RUNTIME_DIR").unwrap_or_else(|_| "/run/user/1000".to_string());
|
||||
let socket_path = format!("{runtime_dir}/k-launcher.sock");
|
||||
let mut stream = std::os::unix::net::UnixStream::connect(&socket_path)?;
|
||||
stream.write_all(b"show\n")?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
mod client;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use k_launcher_kernel::Kernel;
|
||||
@@ -15,15 +13,6 @@ use plugin_files::FilesPlugin;
|
||||
fn main() {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
if args.get(1).map(|s| s.as_str()) == Some("show") {
|
||||
if let Err(e) = client::send_show() {
|
||||
eprintln!("error: failed to send show command: {e}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if let Err(e) = run_ui() {
|
||||
eprintln!("error: UI: {e}");
|
||||
std::process::exit(1);
|
||||
|
||||
Reference in New Issue
Block a user