docs(cli): highlight eol features in start + check

This commit is contained in:
LGUG2Z
2024-10-11 12:50:46 -07:00
parent 7943fccb1b
commit 3c5852ae20
2 changed files with 34 additions and 3 deletions

View File

@@ -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)
@@ -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)
@@ -431,6 +431,30 @@ 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) {
if !display {
display = true;
println!("\n\"{feature}\" is now end-of-life");
} else {
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"]);

View File

@@ -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 {
@@ -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() {