parent
03e190067b
commit
8cd4674c15
2 changed files with 26 additions and 1 deletions
@ -1,5 +1,29 @@ |
|||||||
|
extern crate clap; |
||||||
|
use clap::Clap; |
||||||
use swayr::client; |
use swayr::client; |
||||||
|
|
||||||
|
/// Windows are sorted so that urgent windows come first, then windows in
|
||||||
|
/// last-recently-used order, and the focused window last.
|
||||||
|
#[derive(Clap)] |
||||||
|
#[clap(
|
||||||
|
name = "swayr -- a window switcher for sway", |
||||||
|
version = option_env!("CARGO_PKG_VERSION").unwrap_or("<unknown version>"), |
||||||
|
author = "Tassilo Horn <tsdh@gnu.org>" |
||||||
|
)] |
||||||
|
struct Opts { |
||||||
|
#[clap(subcommand)] |
||||||
|
command: SwayrCommand, |
||||||
|
} |
||||||
|
|
||||||
|
#[derive(Clap)] |
||||||
|
enum SwayrCommand { |
||||||
|
/// Switch window using wofi (urgent first, then LRU order, focused last)
|
||||||
|
SwitchWindow, |
||||||
|
} |
||||||
|
|
||||||
fn main() { |
fn main() { |
||||||
client::switch_window(); |
let opts: Opts = Opts::parse(); |
||||||
|
match opts.command { |
||||||
|
SwayrCommand::SwitchWindow => client::switch_window(), |
||||||
|
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue