Add command line options

timeout_old
Tassilo Horn 4 years ago
parent 03e190067b
commit 8cd4674c15
  1. 26
      src/bin/swayr.rs
  2. 1
      src/util.rs

@ -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(),
}
} }

@ -52,6 +52,7 @@ where
.arg("--allow-markup") .arg("--allow-markup")
.arg("--allow-images") .arg("--allow-images")
.arg("--insensitive") .arg("--insensitive")
.arg("--cache-file=/dev/null")
.arg("--prompt") .arg("--prompt")
.arg(prompt) .arg(prompt)
.stdin(proc::Stdio::piped()) .stdin(proc::Stdio::piped())

Loading…
Cancel
Save