Refactor: workspace with separate swayr & swayrbar crates

main
Tassilo Horn 2 years ago
parent 2f36e073a3
commit 20760c898d
  1. 19
      Cargo.lock
  2. 33
      Cargo.toml
  3. 24
      swayr/Cargo.toml
  4. 0
      swayr/etc/swayrd.service
  5. 0
      swayr/misc/switch-window.png
  6. 0
      swayr/misc/switch-workspace-or-window.png
  7. 0
      swayr/src/bin/swayr.rs
  8. 0
      swayr/src/bin/swayrd.rs
  9. 0
      swayr/src/client.rs
  10. 0
      swayr/src/cmds.rs
  11. 0
      swayr/src/config.rs
  12. 0
      swayr/src/demon.rs
  13. 2
      swayr/src/fmt_replace.rs
  14. 0
      swayr/src/ipc.rs
  15. 0
      swayr/src/layout.rs
  16. 6
      swayr/src/lib.rs
  17. 0
      swayr/src/rtfmt.rs
  18. 0
      swayr/src/tree.rs
  19. 0
      swayr/src/util.rs
  20. 25
      swayrbar/Cargo.toml
  21. 0
      swayrbar/src/bar.rs
  22. 0
      swayrbar/src/bar/config.rs
  23. 0
      swayrbar/src/bar/module.rs
  24. 0
      swayrbar/src/bar/module/battery.rs
  25. 0
      swayrbar/src/bar/module/date.rs
  26. 0
      swayrbar/src/bar/module/sysinfo.rs
  27. 0
      swayrbar/src/bar/module/window.rs
  28. 2
      swayrbar/src/bin/swayrbar.rs
  29. 1
      swayrbar/src/fmt_replace.rs
  30. 1
      swayrbar/src/ipc.rs
  31. 19
      swayrbar/src/lib.rs
  32. 1
      swayrbar/src/rtfmt.rs

19
Cargo.lock generated

@ -616,8 +616,6 @@ dependencies = [
name = "swayr"
version = "0.17.0-alpha.0"
dependencies = [
"battery",
"chrono",
"clap",
"directories",
"env_logger",
@ -628,6 +626,23 @@ dependencies = [
"rt-format",
"serde",
"serde_json",
"swayipc",
"toml",
]
[[package]]
name = "swayrbar"
version = "0.0.1"
dependencies = [
"battery",
"chrono",
"env_logger",
"log",
"once_cell",
"regex",
"rt-format",
"serde",
"serde_json",
"swaybar-types",
"swayipc",
"sysinfo",

@ -1,31 +1,8 @@
[package]
name = "swayr"
version = "0.17.0-alpha.0"
description = "A LRU window-switcher (and more) for the sway window manager"
homepage = "https://sr.ht/~tsdh/swayr/"
repository = "https://git.sr.ht/~tsdh/swayr"
authors = ["Tassilo Horn <tsdh@gnu.org>"]
license = "GPL-3.0+"
edition = "2018"
exclude = ["misc/"]
[dependencies]
battery = "0.7.8"
chrono = "0.4"
clap = {version = "3.0.0", features = ["derive"] }
directories = "4.0"
env_logger = { version = "0.9.0", default-features = false, features = ["termcolor", "atty", "humantime"] } # without regex
log = "0.4"
once_cell = "1.10.0"
rand = "0.8.4"
regex = "1.5.5"
rt-format = "0.3.0"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.64"
swaybar-types = "3.0.0"
swayipc = "3.0.0"
sysinfo = "0.23"
toml = "0.5.8"
[workspace]
members = [
"swayr",
"swayrbar",
]
[profile.release]
lto = "thin"

@ -0,0 +1,24 @@
[package]
name = "swayr"
version = "0.17.0-alpha.0"
description = "A LRU window-switcher (and more) for the sway window manager"
homepage = "https://sr.ht/~tsdh/swayr/"
repository = "https://git.sr.ht/~tsdh/swayr"
authors = ["Tassilo Horn <tsdh@gnu.org>"]
license = "GPL-3.0+"
edition = "2021"
exclude = ["misc/"]
[dependencies]
clap = {version = "3.0.0", features = ["derive"] }
directories = "4.0"
env_logger = { version = "0.9.0", default-features = false, features = ["termcolor", "atty", "humantime"] } # without regex
log = "0.4"
once_cell = "1.10.0"
rand = "0.8.4"
regex = "1.5.5"
rt-format = "0.3.0"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.64"
swayipc = "3.0.0"
toml = "0.5.8"

Before

Width:  |  Height:  |  Size: 434 KiB

After

Width:  |  Height:  |  Size: 434 KiB

Before

Width:  |  Height:  |  Size: 431 KiB

After

Width:  |  Height:  |  Size: 431 KiB

@ -35,7 +35,7 @@ pub fn maybe_html_escape(do_it: bool, text: String) -> String {
macro_rules! fmt_replace {
( $fmt_str:expr, $html_escape:expr,
{ $( $($pat:pat)|+ => $exp:expr, )+ }
{ $( $($pat:pat_param)|+ => $exp:expr, )+ }
) => {
$crate::fmt_replace::PLACEHOLDER_RX
.replace_all($fmt_str, |caps: &regex::Captures| {

@ -13,17 +13,11 @@
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://www.gnu.org/licenses/>.
// TODO: Possibly just include README.md when this feature is in the release
// channel.
//
// #![doc(include = "../README.md")]
//! **Swayr** is a LRU window-switcher and more for the sway window manager.
//! It consists of a demon, and a client. The demon `swayrd` records
//! window/workspace creations, deletions, and focus changes using sway's JSON
//! IPC interface. The client `swayr` offers subcommands, see `swayr --help`.
pub mod bar;
pub mod client;
pub mod cmds;
pub mod config;

@ -0,0 +1,25 @@
[package]
name = "swayrbar"
version = "0.0.1"
edition = "2021"
homepage = "https://sr.ht/~tsdh/swayr/"
repository = "https://git.sr.ht/~tsdh/swayr"
authors = ["Tassilo Horn <tsdh@gnu.org>"]
license = "GPL-3.0+"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
battery = "0.7.8"
chrono = "0.4"
env_logger = { version = "0.9.0", default-features = false, features = ["termcolor", "atty", "humantime"] } # without regex
log = "0.4"
once_cell = "1.10.0"
regex = "1.5.5"
rt-format = "0.3.0"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.64"
swaybar-types = "3.0.0"
swayipc = "3.0.0"
sysinfo = "0.23"
toml = "0.5.8"

@ -18,5 +18,5 @@
fn main() {
// TODO: We need a config file cmd line option so that each bar can have
// its own config.
swayr::bar::start();
swayrbar::bar::start();
}

@ -0,0 +1 @@
../../swayr/src/fmt_replace.rs

@ -0,0 +1 @@
../../swayr/src/ipc.rs

@ -0,0 +1,19 @@
// Copyright (C) 2021-2022 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/>.
pub mod bar;
pub mod fmt_replace;
pub mod ipc;
pub mod rtfmt;

@ -0,0 +1 @@
../../swayr/src/rtfmt.rs
Loading…
Cancel
Save