From 5207826108eb060764213c6f1d128c842427c71c Mon Sep 17 00:00:00 2001 From: Candifloss Date: Sun, 21 Dec 2025 22:47:43 +0530 Subject: [PATCH] Begin restructuring - Daemon `popcorn-d` handles the UI rendering - `popcorn` acts as cli tool --- crates/popcorn-d/Cargo.toml | 20 +++++++++++++++-- crates/{popcorn => popcorn-d}/build.rs | 0 crates/{popcorn => popcorn-d}/src/args.rs | 0 crates/popcorn-d/src/main.rs | 14 ++++++++++-- .../{popcorn => popcorn-d}/src/show_popup.rs | 0 .../{popcorn => popcorn-d}/ui/osd-popup.slint | 0 crates/popcorn/Cargo.toml | 22 ++++--------------- crates/popcorn/src/main.rs | 14 ++---------- 8 files changed, 36 insertions(+), 34 deletions(-) rename crates/{popcorn => popcorn-d}/build.rs (100%) rename crates/{popcorn => popcorn-d}/src/args.rs (100%) rename crates/{popcorn => popcorn-d}/src/show_popup.rs (100%) rename crates/{popcorn => popcorn-d}/ui/osd-popup.slint (100%) diff --git a/crates/popcorn-d/Cargo.toml b/crates/popcorn-d/Cargo.toml index 92f16e0..eb1ba64 100644 --- a/crates/popcorn-d/Cargo.toml +++ b/crates/popcorn-d/Cargo.toml @@ -2,9 +2,25 @@ name = "popcorn-d" version = "0.1.0" edition = "2024" -description = "Popcorn OSD daemon to watch for system events." +description = "Popcorn OSD daemon (UI renderer)" +readme = "README.md" +repository = "https://git.candifloss.cc/candifloss/popcorn.git" +authors = ["Candifloss "] +categories = ["Desktop", "GUI", "Daemon"] +homepage = "https://git.candifloss.cc/candifloss/popcorn.git" +keywords = ["OSD", "popup", "desktop", "gui", "slint"] license = "GPL-3+" +build = "build.rs" [dependencies] +dirs = "6.0.0" +i-slint-backend-winit = "1.14.1" +serde_json = "1.0.145" +slint = { version = "1.14.1", default-features = false, features = ["backend-winit", "renderer-software", "compat-1-2"]} +toml = "0.9.8" +popcorn-conf = { path = "../popcorn-conf" } +clap = { version = "4.5.53", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] } -tokio = { version = "1.48.0", features = ["full"] } + +[build-dependencies] +slint-build = "1.14.1" diff --git a/crates/popcorn/build.rs b/crates/popcorn-d/build.rs similarity index 100% rename from crates/popcorn/build.rs rename to crates/popcorn-d/build.rs diff --git a/crates/popcorn/src/args.rs b/crates/popcorn-d/src/args.rs similarity index 100% rename from crates/popcorn/src/args.rs rename to crates/popcorn-d/src/args.rs diff --git a/crates/popcorn-d/src/main.rs b/crates/popcorn-d/src/main.rs index e7a11a9..7c04dc5 100644 --- a/crates/popcorn-d/src/main.rs +++ b/crates/popcorn-d/src/main.rs @@ -1,3 +1,13 @@ -fn main() { - println!("Hello, world!"); +mod args; +mod show_popup; + +use args::{CliArgs, OsdArgs}; +use clap::Parser; + +fn main() -> Result<(), Box> { + let cli = CliArgs::parse(); + let parsed_args: OsdArgs = cli.into(); + + show_popup::show_popup(&parsed_args)?; + Ok(()) } diff --git a/crates/popcorn/src/show_popup.rs b/crates/popcorn-d/src/show_popup.rs similarity index 100% rename from crates/popcorn/src/show_popup.rs rename to crates/popcorn-d/src/show_popup.rs diff --git a/crates/popcorn/ui/osd-popup.slint b/crates/popcorn-d/ui/osd-popup.slint similarity index 100% rename from crates/popcorn/ui/osd-popup.slint rename to crates/popcorn-d/ui/osd-popup.slint diff --git a/crates/popcorn/Cargo.toml b/crates/popcorn/Cargo.toml index 13b208e..2aa0a2b 100644 --- a/crates/popcorn/Cargo.toml +++ b/crates/popcorn/Cargo.toml @@ -2,25 +2,11 @@ name = "popcorn" version = "0.1.0" edition = "2024" -description = "Cute and simple OSD popups on your desktop" +description = "CLI client for Popcorn OSD" readme = "README.md" repository = "https://git.candifloss.cc/candifloss/popcorn.git" authors = ["Candifloss "] -categories = ["Desktop", "GUI"] +categories = ["Desktop", "CLI"] homepage = "https://git.candifloss.cc/candifloss/popcorn.git" -keywords = ["OSD", "popup", "desktop", "gui", "slint"] -license = "GPL-3+" -build = "build.rs" - -[dependencies] -dirs = "6.0.0" -i-slint-backend-winit = "1.14.1" -serde_json = "1.0.145" -slint = { version = "1.14.1", default-features = false, features = ["backend-winit", "renderer-software", "compat-1-2"]} -toml = "0.9.8" -popcorn-conf = { path = "../popcorn-conf" } -clap = { version = "4.5.53", features = ["derive"] } -serde = { version = "1.0.228", features = ["derive"] } - -[build-dependencies] -slint-build = "1.14.1" +keywords = ["OSD", "popup", "desktop", "cli"] +license = "GPL-3+" \ No newline at end of file diff --git a/crates/popcorn/src/main.rs b/crates/popcorn/src/main.rs index 7c04dc5..e7a11a9 100644 --- a/crates/popcorn/src/main.rs +++ b/crates/popcorn/src/main.rs @@ -1,13 +1,3 @@ -mod args; -mod show_popup; - -use args::{CliArgs, OsdArgs}; -use clap::Parser; - -fn main() -> Result<(), Box> { - let cli = CliArgs::parse(); - let parsed_args: OsdArgs = cli.into(); - - show_popup::show_popup(&parsed_args)?; - Ok(()) +fn main() { + println!("Hello, world!"); }