Release 0.11.1 with new switch-to command

timeout_old
Tassilo Horn 3 years ago
parent e13eb777f0
commit a8689994ea
  1. 2
      Cargo.lock
  2. 2
      Cargo.toml
  3. 8
      NEWS.md
  4. 2
      README.md
  5. 13
      src/cmds.rs

2
Cargo.lock generated

@ -359,7 +359,7 @@ dependencies = [
[[package]] [[package]]
name = "swayr" name = "swayr"
version = "0.11.0" version = "0.11.1"
dependencies = [ dependencies = [
"clap", "clap",
"directories", "directories",

@ -1,6 +1,6 @@
[package] [package]
name = "swayr" name = "swayr"
version = "0.11.0" version = "0.11.1"
description = "A LRU window-switcher (and more) for the sway window manager" description = "A LRU window-switcher (and more) for the sway window manager"
homepage = "https://sr.ht/~tsdh/swayr/" homepage = "https://sr.ht/~tsdh/swayr/"
repository = "https://git.sr.ht/~tsdh/swayr" repository = "https://git.sr.ht/~tsdh/swayr"

@ -1,3 +1,11 @@
swayr v0.11.1
=============
- Well, bumping the micro version usually indicates a bugfix release but I've
forgotten to add the `switch-to` command in version 0.11.0. It's the
canonical "switch to anything" command, i.e., it offers outputs, workspaces,
containers, and windows.
swayr v0.11.0 swayr v0.11.0
============= =============

@ -23,6 +23,8 @@ Right now, there are these subcommands:
switches to the selected workspace or window. switches to the selected workspace or window.
* `switch-workspace-container-or-window` shows workspaces, containers, and * `switch-workspace-container-or-window` shows workspaces, containers, and
their windows in the menu program and switches to the selected one. their windows in the menu program and switches to the selected one.
* `switch-to` shows outputs, workspaces, containers, and their windows in the
menu program and switches to the selected one.
* `quit-window` displays all windows and quits the selected one. * `quit-window` displays all windows and quits the selected one.
* `quit-workspace-or-window` displays all workspaces and their windows and * `quit-workspace-or-window` displays all workspaces and their windows and
allows to quit either the selected workspace (all its windows) or the allows to quit either the selected workspace (all its windows) or the

@ -78,6 +78,9 @@ pub enum SwayrCommand {
/// Switch to the selected workspace or focus the selected container, or /// Switch to the selected workspace or focus the selected container, or
/// window. /// window.
SwitchWorkspaceContainerOrWindow, SwitchWorkspaceContainerOrWindow,
/// Switch to the selected output or workspace or focus the selected
/// container, or window.
SwitchTo,
/// Quit the selected window. /// Quit the selected window.
QuitWindow, QuitWindow,
/// Quit all windows of selected workspace or the selected window. /// Quit all windows of selected workspace or the selected window.
@ -250,6 +253,7 @@ pub fn exec_swayr_cmd(args: ExecSwayrCmdArgs) {
SwayrCommand::SwitchWorkspaceContainerOrWindow => { SwayrCommand::SwitchWorkspaceContainerOrWindow => {
switch_workspace_container_or_window(&*props.read().unwrap()) switch_workspace_container_or_window(&*props.read().unwrap())
} }
SwayrCommand::SwitchTo => switch_to(&*props.read().unwrap()),
SwayrCommand::QuitWindow => quit_window(&*props.read().unwrap()), SwayrCommand::QuitWindow => quit_window(&*props.read().unwrap()),
SwayrCommand::QuitWorkspaceOrWindow => { SwayrCommand::QuitWorkspaceOrWindow => {
quit_workspace_or_window(&*props.read().unwrap()) quit_workspace_or_window(&*props.read().unwrap())
@ -580,6 +584,15 @@ pub fn switch_workspace_container_or_window(
); );
} }
pub fn switch_to(extra_props: &HashMap<i64, t::ExtraProps>) {
let root = get_tree(true);
let tree = t::get_tree(&root, extra_props);
select_and_focus(
"Select output, workspace, container or window",
&tree.get_outputs_workspaces_containers_and_windows(),
);
}
fn select_and_quit(prompt: &str, choices: &[t::DisplayNode]) { fn select_and_quit(prompt: &str, choices: &[t::DisplayNode]) {
if let Ok(tn) = util::select_from_menu(prompt, choices) { if let Ok(tn) = util::select_from_menu(prompt, choices) {
match tn.node.get_type() { match tn.node.get_type() {

Loading…
Cancel
Save