diff --git a/src/bin/swayr.rs b/src/bin/swayr.rs index 8bad2f7..ae5aa85 100644 --- a/src/bin/swayr.rs +++ b/src/bin/swayr.rs @@ -1,5 +1,29 @@ +extern crate clap; +use clap::Clap; 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(""), + author = "Tassilo Horn " +)] +struct Opts { + #[clap(subcommand)] + command: SwayrCommand, +} + +#[derive(Clap)] +enum SwayrCommand { + /// Switch window using wofi (urgent first, then LRU order, focused last) + SwitchWindow, +} + fn main() { - client::switch_window(); + let opts: Opts = Opts::parse(); + match opts.command { + SwayrCommand::SwitchWindow => client::switch_window(), + } } diff --git a/src/util.rs b/src/util.rs index 7d7867d..433480b 100644 --- a/src/util.rs +++ b/src/util.rs @@ -52,6 +52,7 @@ where .arg("--allow-markup") .arg("--allow-images") .arg("--insensitive") + .arg("--cache-file=/dev/null") .arg("--prompt") .arg(prompt) .stdin(proc::Stdio::piped())