diff --git a/hh/join.sh b/hh/join.sh new file mode 100755 index 0000000..896914b --- /dev/null +++ b/hh/join.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Join the live hack-house room. Usage: ./join.sh [host] +# local: ./join.sh alice +# remote: ./join.sh alice 100.117.177.50 +NAME="${1:-guest}" +HOST="${2:-127.0.0.1}" +cd "$(dirname "$0")" +exec ./target/debug/hack-house connect "$HOST" 4173 "$NAME" --password malware-bless --no-tls diff --git a/hh/src/theme.rs b/hh/src/theme.rs index f800102..b5ca485 100644 --- a/hh/src/theme.rs +++ b/hh/src/theme.rs @@ -23,18 +23,20 @@ pub struct Theme { } impl Default for Theme { + /// "church" — Church of Malware: neon on black. Cyan window-chrome, acid-green + /// text/prompts, purple system/occult lines, hot-magenta self/owner accents. fn default() -> Self { Self { - name: "crypt".into(), - border: Color::DarkGray, - title: Color::White, - accent: Color::White, - dim: Color::DarkGray, - me: Color::White, - other: Color::Gray, - system: Color::DarkGray, - input: Color::White, - roster_me: Color::White, + name: "church".into(), + border: Color::Rgb(0x19, 0xb3, 0xff), // cyan window chrome + title: Color::Rgb(0x7d, 0xf9, 0xff), // bright cyan + accent: Color::Rgb(0x39, 0xff, 0x14), // acid green (⛧ glyphs, prompt) + dim: Color::Rgb(0x47, 0x5a, 0x7a), // muted slate-blue + me: Color::Rgb(0x39, 0xff, 0x14), // your messages = acid green + other: Color::Rgb(0x56, 0xc8, 0xff), // others = soft cyan + system: Color::Rgb(0xb4, 0x6c, 0xff), // system / occult = purple + input: Color::Rgb(0x39, 0xff, 0x14), + roster_me: Color::Rgb(0xff, 0x39, 0xc0), // you / owner = hot magenta roster_width: 22, } } @@ -46,3 +48,32 @@ impl Theme { Ok(toml::from_str(&s)?) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn default_is_church() { + let t = Theme::default(); + assert_eq!(t.name, "church"); + assert_eq!(t.accent, Color::Rgb(0x39, 0xff, 0x14)); + } + + #[test] + fn hex_theme_toml_deserializes() { + // The --theme files use #rrggbb; make sure ratatui's serde accepts it. + let toml = r##" +name = "x" +border = "#19b3ff" +accent = "#39ff14" +me = "#39ff14" +roster_width = 24 +"##; + let t: Theme = toml::from_str(toml).expect("hex theme must parse"); + assert_eq!(t.border, Color::Rgb(0x19, 0xb3, 0xff)); + assert_eq!(t.roster_width, 24); + // missing fields fall back to the church default + assert_eq!(t.system, Theme::default().system); + } +} diff --git a/hh/themes/church.toml b/hh/themes/church.toml new file mode 100644 index 0000000..e7177bc --- /dev/null +++ b/hh/themes/church.toml @@ -0,0 +1,12 @@ +# church — Church of Malware: neon on black (the default "vestments") +name = "church" +border = "#19b3ff" # cyan window-chrome +title = "#7df9ff" # bright cyan +accent = "#39ff14" # acid green — ⛧ glyphs, prompt +dim = "#475a7a" # muted slate-blue +me = "#39ff14" # your messages +other = "#56c8ff" # others' messages (soft cyan) +system = "#b46cff" # system / occult lines (purple) +input = "#39ff14" +roster_me = "#ff39c0" # you / owner (hot magenta) +roster_width = 22