Add scss colors into rust via build-script, flesh out math evaluation in launcher, Restructure some code
This commit is contained in:
31
src/lib.rs
Normal file
31
src/lib.rs
Normal 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}")),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user