Rename next/prev-similar-window to next/prev-window-of-same-layout

timeout_old
Tassilo Horn 3 years ago
parent 61d2be87a1
commit bc314e7246
  1. 17
      NEWS.md
  2. 21
      README.md
  3. 22
      src/cmds.rs

@ -0,0 +1,17 @@
swayr v8.0.0
============
- There's now the possibility to define a system-wide config file
`/etc/xdg/swayr/config.toml`. It is used when no
`~/.config/swayr/config.toml` exists.
- New commands: `next-tiled-window`, `prev-tiled-window`,
`next-tabbed-or-stacked-window`, `prev-tabbed-or-stacked-window`,
`next-floating-window`, `prev-floating-window`, `next-window-of-same-layout`,
and `prev-window-of-same-layout`.
- **Incompatible change**: All `next/prev-window` commands (including the new
ones above) now have a mandatory subcommand determining if all or only the
current workspace's windows should be considered: `all-workspaces`, or
`current-workspace`.
- Bugfix: `prev-window` has never worked correctly. Instead of cycling through
all windows in last-recently-used order, it switched between the current and
last recently used window. Now it works as expected.

@ -36,12 +36,13 @@ Right now, there are these subcommands:
a tabbed or stacked container. a tabbed or stacked container.
* `next-floating-window` & `prev-floating-window` do the same as `next-window` * `next-floating-window` & `prev-floating-window` do the same as `next-window`
& `prev-window` but switch only between floating windows. & `prev-window` but switch only between floating windows.
* `next-similar-window` & `prev-similar-window` is like `next-floating-window` * `next-window-of-same-layout` & `prev-window-of-same-layout` is like
/ `prev-floating-window` if the current window is floating, it is like `next-floating-window` / `prev-floating-window` if the current window is
`next-tabbed-or-stacked-window` / `prev-tabbed-or-stacked-window` if the floating, it is like `next-tabbed-or-stacked-window` /
current window is in a tabbed, or stacked container, it is like `prev-tabbed-or-stacked-window` if the current window is in a tabbed, or
`next-tiled-window` / `prev-tiled-window` if the current windows is in a stacked container, it is like `next-tiled-window` / `prev-tiled-window` if
tiled container, and is like `next-window` / `prev-window` otherwise. the current windows is in a tiled container, and is like `next-window` /
`prev-window` otherwise.
* `execute-swaymsg-command` displays most swaymsg which don't require * `execute-swaymsg-command` displays most swaymsg which don't require
additional input and executes the selected one. That's handy especially for 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.
@ -319,6 +320,14 @@ over IPC. Therefore, auto-tiling is triggered by new-window events,
close-events, move-events, floating-events, and also focus-events. The latter close-events, move-events, floating-events, and also focus-events. The latter
are a workaround and wouldn't be required if there were resize-events. are a workaround and wouldn't be required if there were resize-events.
## Version Changes
Since version 8.0.0, I've started writing a [NEWS](NEWS.md) file listing the
news, and changes to `swayr` commands or configuration options. If something
doesn't seem to work as expected after an update, please consult this file to
check if there has been some (possibly incompatible) change requiring an update
of your config.
## Questions & Patches ## Questions & Patches
For asking questions, sending feedback, or patches, refer to [my public inbox For asking questions, sending feedback, or patches, refer to [my public inbox

@ -51,12 +51,12 @@ pub enum SwayrCommand {
SwitchToUrgentOrLRUWindow, SwitchToUrgentOrLRUWindow,
/// Focus the selected window. /// Focus the selected window.
SwitchWindow, SwitchWindow,
/// Focus the next window. /// Focus the next window in LRU order.
NextWindow { NextWindow {
#[clap(subcommand)] #[clap(subcommand)]
windows: ConsiderWindows, windows: ConsiderWindows,
}, },
/// Focus the previous window. /// Focus the previous window in LRU order.
PrevWindow { PrevWindow {
#[clap(subcommand)] #[clap(subcommand)]
windows: ConsiderWindows, windows: ConsiderWindows,
@ -92,12 +92,12 @@ pub enum SwayrCommand {
windows: ConsiderWindows, windows: ConsiderWindows,
}, },
/// Focus the next window having the same layout as the current one. /// Focus the next window having the same layout as the current one.
NextSimilarWindow { NextWindowOfSameLayout {
#[clap(subcommand)] #[clap(subcommand)]
windows: ConsiderWindows, windows: ConsiderWindows,
}, },
/// Focus the previous window having the same layout as the current one. /// Focus the previous window having the same layout as the current one.
PrevSimilarWindow { PrevWindowOfSameLayout {
#[clap(subcommand)] #[clap(subcommand)]
windows: ConsiderWindows, windows: ConsiderWindows,
}, },
@ -151,8 +151,8 @@ impl SwayrCommand {
| SwayrCommand::PrevTabbedOrStackedWindow { .. } | SwayrCommand::PrevTabbedOrStackedWindow { .. }
| SwayrCommand::NextFloatingWindow { .. } | SwayrCommand::NextFloatingWindow { .. }
| SwayrCommand::PrevFloatingWindow { .. } | SwayrCommand::PrevFloatingWindow { .. }
| SwayrCommand::NextSimilarWindow { .. } | SwayrCommand::NextWindowOfSameLayout { .. }
| SwayrCommand::PrevSimilarWindow { .. } | SwayrCommand::PrevWindowOfSameLayout { .. }
) )
} }
} }
@ -263,15 +263,15 @@ pub fn exec_swayr_cmd(args: ExecSwayrCmdArgs) {
Box::new(|w: &con::Window| w.is_floating()), Box::new(|w: &con::Window| w.is_floating()),
) )
} }
SwayrCommand::NextSimilarWindow { windows } => { SwayrCommand::NextWindowOfSameLayout { windows } => {
focus_similar_window_in_direction( focus_window_of_same_layout_in_direction(
Direction::Forward, Direction::Forward,
windows, windows,
&*props.read().unwrap(), &*props.read().unwrap(),
) )
} }
SwayrCommand::PrevSimilarWindow { windows } => { SwayrCommand::PrevWindowOfSameLayout { windows } => {
focus_similar_window_in_direction( focus_window_of_same_layout_in_direction(
Direction::Backward, Direction::Backward,
windows, windows,
&*props.read().unwrap(), &*props.read().unwrap(),
@ -464,7 +464,7 @@ pub fn focus_window_in_direction(
} }
} }
pub fn focus_similar_window_in_direction( pub fn focus_window_of_same_layout_in_direction(
dir: Direction, dir: Direction,
consider_wins: &ConsiderWindows, consider_wins: &ConsiderWindows,
extra_props: &HashMap<i64, con::ExtraProps>, extra_props: &HashMap<i64, con::ExtraProps>,

Loading…
Cancel
Save