Add scss colors into rust via build-script, flesh out math evaluation in launcher, Restructure some code

This commit is contained in:
jmb05
2026-11-02 19:31:21 +01:00
parent 11fb03427c
commit c3ad6f38cf
15 changed files with 167 additions and 114 deletions

31
src/lib.rs Normal file
View File

@@ -0,0 +1,31 @@
use std::fmt::{Display, Formatter};
use std::str::FromStr;
pub mod config;
pub mod theme;
pub const SOCKET_PATH: &str = "/run/user/1000/jmb-bar.sock";
#[derive(Clone, Debug)]
pub enum ControlCommand {
OpenRunMenu,
}
impl Display for ControlCommand {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
ControlCommand::OpenRunMenu => f.write_str("menu"),
}
}
}
impl FromStr for ControlCommand {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"menu" => Ok(ControlCommand::OpenRunMenu),
other => Err(format!("Unknown command: {other}")),
}
}
}