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]]
name = "swayr"
version = "0.11.0"
version = "0.11.1"
dependencies = [
"clap",
"directories",

@ -1,6 +1,6 @@
[package]
name = "swayr"
version = "0.11.0"
version = "0.11.1"
description = "A LRU window-switcher (and more) for the sway window manager"
homepage = "https://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
=============

@ -23,6 +23,8 @@ Right now, there are these subcommands:
switches to the selected workspace or window.
* `switch-workspace-container-or-window` shows workspaces, containers, and
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-workspace-or-window` displays all workspaces and their windows and
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
/// window.
SwitchWorkspaceContainerOrWindow,
/// Switch to the selected output or workspace or focus the selected
/// container, or window.
SwitchTo,
/// Quit the selected window.
QuitWindow,
/// Quit all windows of selected workspace or the selected window.
@ -250,6 +253,7 @@ pub fn exec_swayr_cmd(args: ExecSwayrCmdArgs) {
SwayrCommand::SwitchWorkspaceContainerOrWindow => {
switch_workspace_container_or_window(&*props.read().unwrap())
}
SwayrCommand::SwitchTo => switch_to(&*props.read().unwrap()),
SwayrCommand::QuitWindow => quit_window(&*props.read().unwrap()),
SwayrCommand::QuitWorkspaceOrWindow => {
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]) {
if let Ok(tn) = util::select_from_menu(prompt, choices) {
match tn.node.get_type() {

Loading…
Cancel
Save