parent
41199b2f09
commit
08b69d788f
10 changed files with 179 additions and 28 deletions
@ -1,25 +1,38 @@ |
|||||||
|
// Copyright (C) 2021 Tassilo Horn <tsdh@gnu.org>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU General Public License as published by the Free
|
||||||
|
// Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
// more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License along with
|
||||||
|
// this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! The `swayr` binary.
|
//! The `swayr` binary.
|
||||||
|
|
||||||
use clap::{crate_version, Clap}; |
use clap::{crate_version, Clap}; |
||||||
use swayr::client; |
|
||||||
use swayr::ipc; |
|
||||||
|
|
||||||
/// Windows are sorted urgent first, then windows in LRU order, focused window
|
/// Windows are sorted urgent first, then windows in LRU order, focused window
|
||||||
/// last. Licensed under the GPLv3 (or later).
|
/// last. Licensed under the GPLv3 (or later).
|
||||||
#[derive(Clap)] |
#[derive(Clap)] |
||||||
#[clap(
|
#[clap(
|
||||||
name = "swayr -- a window switcher for sway", |
name = "swayr -- a window switcher (and more) for sway", |
||||||
version = crate_version!(), |
version = crate_version!(), |
||||||
author = "Tassilo Horn <tsdh@gnu.org>" |
author = "Tassilo Horn <tsdh@gnu.org>" |
||||||
)] |
)] |
||||||
struct Opts { |
struct Opts { |
||||||
#[clap(subcommand)] |
#[clap(subcommand)] |
||||||
command: ipc::SwayrCommand, |
command: swayr::ipc::SwayrCommand, |
||||||
} |
} |
||||||
|
|
||||||
fn main() { |
fn main() { |
||||||
let opts: Opts = Opts::parse(); |
let opts: Opts = Opts::parse(); |
||||||
if let Err(err) = client::send_swayr_cmd(opts.command) { |
if let Err(err) = swayr::client::send_swayr_cmd(opts.command) { |
||||||
eprintln!("Could not send command: {}", err); |
eprintln!("Could not send command: {}", err); |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,7 +1,20 @@ |
|||||||
//! The `swayrd` binary.
|
// Copyright (C) 2021 Tassilo Horn <tsdh@gnu.org>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU General Public License as published by the Free
|
||||||
|
// Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
// more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License along with
|
||||||
|
// this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use swayr::demon; |
//! The `swayrd` binary.
|
||||||
|
|
||||||
fn main() { |
fn main() { |
||||||
demon::run_demon(); |
swayr::demon::run_demon(); |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue