feat(asc): a Kde platform, for which no rule is written yet

This commit is contained in:
LGUG2Z committed 2026-10-28 22:50:41 -07:00
1 parent 22f73ec27b
commit 135324be89
5 files changed
+28 -10

No files matched your search

+7 -3
View File
@@ -32,6 +32,9 @@ pub enum Platform {
/// komorebi for Mac: `applications.mac.json`. Programs are application names, and a window has
/// no class.
Macos,
/// komorebi for KDE. Its rules are in `komorebic/applications.json` of its own repository, and
/// nothing here writes or proposes one yet. Programs are application ids, as are classes.
Kde,
}
impl Platform {
@@ -40,9 +43,8 @@ impl Platform {
pub fn of(flavor: Flavor) -> Self {
match flavor {
Flavor::Windows => Self::Windows,
// komorebi for KDE has no rule file here yet, and no ghost tiles are found for it
// (see `Analysis::ghost_tiles`), so nothing asks for the platform of one
Flavor::Macos | Flavor::Kde => Self::Macos,
Flavor::Macos => Self::Macos,
Flavor::Kde => Self::Kde,
}
}
@@ -52,6 +54,7 @@ impl Platform {
match self {
Self::Windows => "applications.json",
Self::Macos => "applications.mac.json",
Self::Kde => "komorebic/applications.json",
}
}
@@ -61,6 +64,7 @@ impl Platform {
match self {
Self::Windows => "komorebi for Windows",
Self::Macos => "komorebi for Mac",
Self::Kde => "komorebi for KDE",
}
}
}
+7
View File
@@ -249,6 +249,13 @@ impl Rule {
}
identifiers.push(Identifier::title(&ghost.title));
}
Platform::Kde => {
return Err(NoRule(
"the rules of komorebi for KDE are in its own repository, and a rule for it is \
not written here yet"
.to_string(),
));
}
}
Ok(Self::ignore(&app_name(&ghost.exe), identifiers))
+11 -4
View File
@@ -165,7 +165,7 @@ impl Proposal {
class = ghost.class,
titled = quoted_title(&ghost.title),
),
Platform::Macos => format!(
Platform::Macos | Platform::Kde => format!(
"window {hwnd} of `{exe}` ({titled})",
hwnd = ghost.hwnd,
exe = ghost.exe,
@@ -185,14 +185,21 @@ impl Proposal {
whether a window is drawn, so this is the frame komorebi had for it)",
how = ghost.hidden_how
),
Platform::Kde => format!(
"in every one of those states the frame of the window, as KWin reports it, was {how}, \
and it was never a frame a person could see. (this is the frame komorebi had for \
the window, and not KWin saying that the window is not drawn)",
how = ghost.hidden_how
),
};
let recorded_with = match platform {
Platform::Windows => "with window probes on (komorebi-recorder's default on Windows)",
Platform::Macos => "of komorebi for Mac",
Platform::Kde => "of komorebi for KDE",
};
let reads = match platform {
Platform::Windows => "read the state of",
Platform::Macos => "recorded the state of",
Platform::Macos | Platform::Kde => "recorded the state of",
};
let others = if ghost.siblings.is_empty() {
format!(
@@ -210,7 +217,7 @@ impl Proposal {
sibling.class,
quoted_title(&sibling.title)
),
Platform::Macos => quoted_title(&sibling.title),
Platform::Macos | Platform::Kde => quoted_title(&sibling.title),
})
.collect();
seen.sort();
@@ -234,7 +241,7 @@ impl Proposal {
"the program **and** the class"
}
}
Platform::Macos => "the application **and** the title",
Platform::Macos | Platform::Kde => "the application **and** the title",
};
let body = format!(
"Ignore {what}: {komorebi} gives it a tile that a person can never see.\n\
+2 -2
View File
@@ -68,8 +68,8 @@ fn chip(ui: &mut egui::Ui, text: &str, colour: Color32) {
fn ghost_name(ghost: &GhostTile) -> String {
match ghost.platform {
Platform::Windows => format!("{} ({})", ghost.exe, ghost.class),
Platform::Macos if ghost.title.is_empty() => ghost.exe.clone(),
Platform::Macos => format!("{} ({:?})", ghost.exe, ghost.title),
Platform::Macos | Platform::Kde if ghost.title.is_empty() => ghost.exe.clone(),
Platform::Macos | Platform::Kde => format!("{} ({:?})", ghost.exe, ghost.title),
}
}
+1 -1
View File
@@ -308,7 +308,7 @@ fn what_was_seen(ghost: &GhostTile) -> String {
window exists.",
ghost.exe, ghost.class, ghost.reads, ghost.hidden_how,
),
Platform::Macos => format!(
Platform::Macos | Platform::Kde => format!(
"komorebi gave `{}` ({}) a tile, and on {} reads between {from} and {to} the frame it \
had for the window was {}, never one a person could see. The tile is empty for as long \
as the window exists.",