-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wip transforming komorebi response
- Loading branch information
1 parent
097ac71
commit 1a7b845
Showing
2 changed files
with
103 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,80 @@ | ||
use komorebi_client::{Monitor, Ring}; | ||
use serde::Serialize; | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct KomorebiVariables { | ||
pub monitors: Ring<Monitor>, | ||
pub monitors: Vec<KomorebiMonitor>, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct KomorebiMonitor { | ||
pub id: isize, | ||
pub name: String, | ||
pub device_id: Option<String>, | ||
pub size: KomorebiRect, | ||
pub work_area_offset: Option<KomorebiRect>, | ||
pub work_area_size: KomorebiRect, | ||
pub workspaces: Vec<KomorebiWorkspace>, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct KomorebiWorkspace { | ||
pub container_padding: u64, | ||
pub floating_windows: Vec<KomorebiWindow>, | ||
pub latest_layout: Vec<KomorebiRect>, | ||
pub layout: KomorebiLayout, | ||
pub layout_flip: Option<KomorebiLayoutFlip>, | ||
pub name: String, | ||
pub maximized_window: Option<KomorebiWindow>, | ||
pub monocle_container: Option<KomorebiWindow>, | ||
pub tiling_containers: Vec<KomorebiWindow>, | ||
pub workspace_padding: u64, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct KomorebiContainer { | ||
pub class: String, | ||
pub exe: String, | ||
pub hwnd: u64, | ||
pub size: KomorebiRect, | ||
pub title: String, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct KomorebiWindow { | ||
pub class: String, | ||
pub exe: String, | ||
pub hwnd: u64, | ||
pub size: KomorebiRect, | ||
pub title: String, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct KomorebiRect { | ||
pub left: u64, | ||
pub top: u64, | ||
pub right: u64, | ||
pub bottom: u64, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum KomorebiLayout { | ||
Bsp, | ||
VerticalStack, | ||
HorizontalStack, | ||
UltrawideVerticalStack, | ||
Rows, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum KomorebiLayoutFlip { | ||
Horizontal, | ||
Vertical, | ||
} |