diff --git a/Cargo.lock b/Cargo.lock index 183c2f2..b414d6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,9 +150,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.106" +version = "0.2.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" +checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" [[package]] name = "memchr" @@ -321,9 +321,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +checksum = "e466864e431129c7e0d3476b92f20458e5879919a0596c6472738d9fa2d342f8" dependencies = [ "itoa", "ryu", @@ -360,7 +360,7 @@ dependencies = [ [[package]] name = "swayr" -version = "0.9.0-beta.4" +version = "0.9.0" dependencies = [ "clap", "directories", diff --git a/Cargo.toml b/Cargo.toml index ef61473..c739d76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swayr" -version = "0.9.0-beta.4" +version = "0.9.0" 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" diff --git a/README.md b/README.md index 063e94a..0e5797b 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ Right now, there are these subcommands: `prev-window` otherwise. * `execute-swaymsg-command` displays most swaymsg which don't require additional input and executes the selected one. That's handy especially for - less often used commands not bound to a key. + less often used commands not bound to a key. Non-matching input will be + executed executed as-is with `swaymsg`. * `execute-swayr-command` displays all commands above and executes the selected one. (This is useful for accessing swayr commands which are not bound to a key.) @@ -72,6 +73,27 @@ Right now, there are these subcommands: between a tabbed and tiled layout, i.e., it calls `shuffle-tile-workspace` if it is currently tabbed, and calls `shuffle-tile-workspace` if it is currently tiled. +* `move-focused-to-workspace` moves the currently focused window or container + to another workspace selected with the menu program. Non-matching input of + the form `#w:` where the hash and `w:` shortcut are optional can + be used to move it to a new workspace. + +### Menu shortcuts for non-matching input + +All menu switching commands (`switch-window`, `switch-workspace`, and +`switch-workspace-or-window`) now handle non-matching input instead of doing +nothing. The input should start with any number of `#` (in order to be able to +force a non-match), a shortcut followed by a colon, and some string as required +by the shortcut. The following shortcuts are supported. +- `w:`: Switches to a possibly non-existing workspace. + `` must be a digit, a name, or `:`. The + `:` format is explained in `man 5 sway`. If that format is + given, `swayr` will create the workspace using `workspace number + :`. If just a digit or name is given, the `number` argument is + not used. +- `s:`: Executes the sway command `` using `swaymsg`. +- Any other input is assumed to be a workspace name and thus handled as + `w:` would do. ## Screenshots diff --git a/src/config.rs b/src/config.rs index 8c6d961..34834e8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -79,13 +79,13 @@ impl Config { .expect("No format.workspace_format defined.") } - pub fn get_format_container_format(&self) -> String { - self.format - .as_ref() - .and_then(|f| f.container_format.clone()) - .or_else(|| Format::default().container_format) - .expect("No format.container_format defined.") - } + // pub fn get_format_container_format(&self) -> String { + // self.format + // .as_ref() + // .and_then(|f| f.container_format.clone()) + // .or_else(|| Format::default().container_format) + // .expect("No format.container_format defined.") + // } pub fn get_format_urgency_start(&self) -> String { self.format @@ -155,7 +155,7 @@ pub struct Menu { pub struct Format { window_format: Option, workspace_format: Option, - container_format: Option, + //container_format: Option, urgency_start: Option, urgency_end: Option, html_escape: Option, @@ -216,11 +216,11 @@ impl Default for Format { ({id})" .to_string(), ), - container_format: Some( - "Container {name} \ - ({id})" - .to_string(), - ), + // container_format: Some( + // "Container {name} \ + // ({id})" + // .to_string(), + // ), html_escape: Some(true), urgency_start: Some( ""