small amounts of work on ws monitor
This commit is contained in:
parent
bc6d1a94a5
commit
582b4cbe3f
3 changed files with 19 additions and 14 deletions
|
@ -3,8 +3,8 @@
|
||||||
:class "workspaces"
|
:class "workspaces"
|
||||||
(for workspace in workspaces
|
(for workspace in workspaces
|
||||||
(button
|
(button
|
||||||
:style "border-bottom: 4px solid ${workspace.color}"
|
:style "border-bottom: 4px solid ${workspace.color}${workspace.active ? "; background-color: #3c3836" : ""}"
|
||||||
:class "${workspace.active ? "focused" : 0}"
|
:class "${workspace.focused ? "focused" : ""}"
|
||||||
:onclick "swaymsg workspace ${workspace.name}"
|
:onclick "swaymsg workspace ${workspace.name}"
|
||||||
(label :text "${workspace.idx}")
|
(label :text "${workspace.idx}")
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,10 +10,6 @@ label {
|
||||||
border: 0px;
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspaces button.urgent {
|
|
||||||
background-color: #cc241d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.workspaces button.focused {
|
.workspaces button.focused {
|
||||||
background-color: #504935;
|
background-color: #504935;
|
||||||
}
|
}
|
||||||
|
@ -37,4 +33,4 @@ label {
|
||||||
|
|
||||||
.traveldingsWindow {
|
.traveldingsWindow {
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
}
|
}
|
|
@ -46,6 +46,7 @@ fn main() -> Result<(), std::io::Error> {
|
||||||
.values()
|
.values()
|
||||||
.map(|it| it.clone())
|
.map(|it| it.clone())
|
||||||
.collect::<Vec<Workspace>>();
|
.collect::<Vec<Workspace>>();
|
||||||
|
|
||||||
workspaces.sort_by(|a, b| a.idx.cmp(&b.idx));
|
workspaces.sort_by(|a, b| a.idx.cmp(&b.idx));
|
||||||
workspaces.sort_by(|a, b| {
|
workspaces.sort_by(|a, b| {
|
||||||
a.output
|
a.output
|
||||||
|
@ -71,13 +72,21 @@ fn main() -> Result<(), std::io::Error> {
|
||||||
|
|
||||||
let results = workspaces
|
let results = workspaces
|
||||||
.iter()
|
.iter()
|
||||||
.map(|ws| WsData {
|
.map(
|
||||||
color: output_colors_lut[&ws.output.clone().expect("unreachable")]
|
|Workspace {
|
||||||
[if ws.is_active { 1 } else { 0 }],
|
idx,
|
||||||
idx: ws.idx,
|
output,
|
||||||
focused: ws.is_focused,
|
is_active,
|
||||||
active: ws.is_active,
|
is_focused,
|
||||||
})
|
..
|
||||||
|
}| WsData {
|
||||||
|
color: output_colors_lut[&output.clone().expect("unreachable")]
|
||||||
|
[if *is_active { 1 } else { 0 }],
|
||||||
|
idx: *idx,
|
||||||
|
focused: *is_focused,
|
||||||
|
active: *is_active,
|
||||||
|
},
|
||||||
|
)
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
println!("{}", serde_json::to_string(&results).unwrap());
|
println!("{}", serde_json::to_string(&results).unwrap());
|
||||||
|
|
Loading…
Add table
Reference in a new issue