Skip to content

Commit

Permalink
docs(cli): highlight eol features in start + check
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Oct 11, 2024
1 parent 7f42042 commit 1c94a49
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
26 changes: 23 additions & 3 deletions komorebi/src/static_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ pub struct WorkspaceConfig {
/// Layout (default: BSP)
#[serde(skip_serializing_if = "Option::is_none")]
pub layout: Option<DefaultLayout>,
/// Custom Layout (default: None)
/// END OF LIFE FEATURE: Custom Layout (default: None)
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_layout: Option<PathBuf>,
/// Layout rules (default: None)
#[serde(skip_serializing_if = "Option::is_none")]
pub layout_rules: Option<HashMap<usize, DefaultLayout>>,
/// Layout rules (default: None)
/// END OF LIFE FEATURE: Custom layout rules (default: None)
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_layout_rules: Option<HashMap<usize, PathBuf>>,
/// Container padding (default: global)
Expand Down Expand Up @@ -260,7 +260,7 @@ pub struct StaticConfig {
/// Determine what happens when commands are sent while an unmanaged window is in the foreground (default: Op)
#[serde(skip_serializing_if = "Option::is_none")]
pub unmanaged_window_operation_behaviour: Option<OperationBehaviour>,
/// Determine focus follows mouse implementation (default: None)
/// END OF LIFE FEATURE: Determine focus follows mouse implementation (default: None)
#[serde(skip_serializing_if = "Option::is_none")]
pub focus_follows_mouse: Option<FocusFollowsMouseImplementation>,
/// Enable or disable mouse follows focus (default: true)
Expand Down Expand Up @@ -431,6 +431,26 @@ pub enum KomorebiTheme {
}

impl StaticConfig {
pub fn end_of_life(raw: &str) {
let features = vec![
"focus_follows_mouse",
"custom_layout",
"custom_layout_rules",
];

let mut display = false;

for feature in features {
if raw.contains(feature) {
display = true;
println!(r#""{feature}" is now end-of-life"#);
}
}

if display {
println!("\nEnd-of-life features will not receive any further bug fixes or updates; they should not be used\n")
}
}
pub fn aliases(raw: &str) {
let mut map = HashMap::new();
map.insert("border", ["active_window_border"]);
Expand Down
7 changes: 7 additions & 0 deletions komorebic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,12 @@ fn main() -> Result<()> {
// errors
let _ = serde_json::from_str::<StaticConfig>(&config_source)?;

let path = resolve_home_path(static_config)?;
let raw = std::fs::read_to_string(path)?;
StaticConfig::aliases(&raw);
StaticConfig::deprecated(&raw);
StaticConfig::end_of_life(&raw);

if config_whkd.exists() {
println!("Found {}; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag\n", config_whkd.to_string_lossy());
} else {
Expand Down Expand Up @@ -2098,6 +2104,7 @@ if (!(Get-Process komorebi-bar -ErrorAction SilentlyContinue))
let raw = std::fs::read_to_string(path)?;
StaticConfig::aliases(&raw);
StaticConfig::deprecated(&raw);
StaticConfig::end_of_life(&raw);
}

if bar_config.is_some() {
Expand Down

0 comments on commit 1c94a49

Please sign in to comment.