Implement niri msg focused-window

This commit is contained in:
Ivan Molodetskikh
2024-03-28 13:45:24 +04:00
parent a7b3819214
commit 3091102365
5 changed files with 77 additions and 0 deletions
+13
View File
@@ -14,6 +14,8 @@ pub const SOCKET_PATH_ENV: &str = "NIRI_SOCKET";
pub enum Request {
/// Request information about connected outputs.
Outputs,
/// Request information about the focused window.
FocusedWindow,
/// Perform an action.
Action(Action),
}
@@ -37,6 +39,8 @@ pub enum Response {
///
/// Map from connector name to output info.
Outputs(HashMap<String, Output>),
/// Information about the focused window.
FocusedWindow(Option<Window>),
}
/// Actions that niri can perform.
@@ -308,6 +312,15 @@ pub enum Transform {
Flipped270,
}
/// Toplevel window.
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Window {
/// Title, if set.
pub title: Option<String>,
/// Application ID, if set.
pub app_id: Option<String>,
}
impl FromStr for SizeChange {
type Err = &'static str;