feature/prod-ready #1

Merged
GKaszewski merged 12 commits from feature/prod-ready into master 2026-03-15 19:03:32 +00:00
4 changed files with 49 additions and 1 deletions
Showing only changes of commit 1e305dc5bf - Show all commits

View File

@@ -0,0 +1,10 @@
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(())
}

View File

@@ -1,3 +1,5 @@
mod client;
use std::sync::Arc; use std::sync::Arc;
use k_launcher_kernel::Kernel; use k_launcher_kernel::Kernel;
@@ -10,8 +12,25 @@ use plugin_calc::CalcPlugin;
use plugin_cmd::CmdPlugin; use plugin_cmd::CmdPlugin;
use plugin_files::FilesPlugin; use plugin_files::FilesPlugin;
fn main() -> iced::Result { fn main() {
tracing_subscriber::fmt::init(); 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);
}
}
fn run_ui() -> iced::Result {
let cfg = k_launcher_config::load(); let cfg = k_launcher_config::load();
let launcher = Arc::new(UnixAppLauncher::new()); let launcher = Arc::new(UnixAppLauncher::new());
let frecency = FrecencyStore::load(); let frecency = FrecencyStore::load();

View File

@@ -0,0 +1,11 @@
[Unit]
Description=k-launcher command palette daemon
After=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/k-launcher
Restart=on-failure
[Install]
WantedBy=graphical-session.target

View File

@@ -0,0 +1,8 @@
[Unit]
Description=k-launcher IPC socket
[Socket]
ListenStream=%t/k-launcher.sock
[Install]
WantedBy=sockets.target