add eww open-many
This commit is contained in:
parent
5fac2271b5
commit
1c6853cc5d
2 changed files with 12 additions and 0 deletions
|
@ -20,6 +20,7 @@ pub enum EwwCommand {
|
||||||
UpdateVars(Vec<(VarName, PrimitiveValue)>),
|
UpdateVars(Vec<(VarName, PrimitiveValue)>),
|
||||||
ReloadConfig(config::EwwConfig),
|
ReloadConfig(config::EwwConfig),
|
||||||
ReloadCss(String),
|
ReloadCss(String),
|
||||||
|
OpenMany(Vec<WindowName>),
|
||||||
OpenWindow {
|
OpenWindow {
|
||||||
window_name: WindowName,
|
window_name: WindowName,
|
||||||
pos: Option<Coords>,
|
pos: Option<Coords>,
|
||||||
|
@ -88,6 +89,11 @@ impl App {
|
||||||
self.close_window(&window_name)?;
|
self.close_window(&window_name)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
EwwCommand::OpenMany(windows) => {
|
||||||
|
for window in windows {
|
||||||
|
self.open_window(&window, None, None, None)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
EwwCommand::OpenWindow {
|
EwwCommand::OpenWindow {
|
||||||
window_name,
|
window_name,
|
||||||
pos,
|
pos,
|
||||||
|
|
|
@ -74,6 +74,11 @@ pub enum ActionWithServer {
|
||||||
anchor: Option<AnchorPoint>,
|
anchor: Option<AnchorPoint>,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/// Open multiple windows at once.
|
||||||
|
/// NOTE: This will in the future be part of eww open, and will then be removed.
|
||||||
|
#[structopt(name = "open-many")]
|
||||||
|
OpenMany { windows: Vec<WindowName> },
|
||||||
|
|
||||||
/// Close the window with the given name
|
/// Close the window with the given name
|
||||||
#[structopt(name = "close")]
|
#[structopt(name = "close")]
|
||||||
CloseWindow { window_name: WindowName },
|
CloseWindow { window_name: WindowName },
|
||||||
|
@ -127,6 +132,7 @@ impl ActionWithServer {
|
||||||
let command = match self {
|
let command = match self {
|
||||||
ActionWithServer::Daemon | ActionWithServer::Ping => app::EwwCommand::NoOp,
|
ActionWithServer::Daemon | ActionWithServer::Ping => app::EwwCommand::NoOp,
|
||||||
ActionWithServer::Update { mappings } => app::EwwCommand::UpdateVars(mappings.into_iter().collect()),
|
ActionWithServer::Update { mappings } => app::EwwCommand::UpdateVars(mappings.into_iter().collect()),
|
||||||
|
ActionWithServer::OpenMany { windows } => app::EwwCommand::OpenMany(windows),
|
||||||
ActionWithServer::OpenWindow {
|
ActionWithServer::OpenWindow {
|
||||||
window_name,
|
window_name,
|
||||||
pos,
|
pos,
|
||||||
|
|
Loading…
Add table
Reference in a new issue