From 613b4eeaebcd10b869f921359717ea06185024ff Mon Sep 17 00:00:00 2001 From: William Barsse Date: Sun, 1 May 2022 20:28:10 +0200 Subject: [PATCH] Use "daemon" instead of "demon" Trivial patch that simply changes the "demon" word to "daemon". As the latter is the more common variant to designate a process toiling in the background, I'm just assuming "demon" was a typo. --- README.md | 12 ++++++------ swayr/src/bin/swayrd.rs | 2 +- swayr/src/{demon.rs => daemon.rs} | 8 +++++--- swayr/src/layout.rs | 2 +- swayr/src/lib.rs | 6 +++--- 5 files changed, 16 insertions(+), 14 deletions(-) rename swayr/src/{demon.rs => daemon.rs} (98%) diff --git a/README.md b/README.md index 133c223..fc2b34d 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,10 @@ [![latest release](https://img.shields.io/crates/v/swayr.svg)](https://crates.io/crates/swayr) -Swayr consists of a demon, and a client. The demon `swayrd` records +Swayr consists of a daemon, and a client. The `swayrd` daemon records window/workspace creations, deletions, and focus changes using sway's JSON IPC -interface. The client `swayr` offers subcommands, see `swayr --help`, and -sends them to the demon which executes them. +interface. The `swayr` client offers subcommands, see `swayr --help`, and +sends them to the daemon which executes them. ### Swayr commands @@ -223,7 +223,7 @@ cargo install-update -- swayr ### Usage -You need to start the swayr demon `swayrd` in your sway config +You need to start the swayr daemon (`swayrd`) in your sway config (`~/.config/sway/config`) like so: ``` @@ -238,8 +238,8 @@ issue with backtrace and logging at the `debug` level and attach that to your bug report. Valid log levels in the order from logging more to logging less are: `trace`, `debug`, `info`, `warn`, `error`, `off`. -Next to starting the demon, you want to bind swayr commands to some keys like -so: +Beyond starting the daemon, you will want to bind swayr commands to some keys +like so: ``` bindsym $mod+Space exec env RUST_BACKTRACE=1 \ diff --git a/swayr/src/bin/swayrd.rs b/swayr/src/bin/swayrd.rs index 3a468e0..c74fa4e 100644 --- a/swayr/src/bin/swayrd.rs +++ b/swayr/src/bin/swayrd.rs @@ -20,5 +20,5 @@ use env_logger::Env; fn main() { env_logger::Builder::from_env(Env::default().default_filter_or("warn")) .init(); - swayr::demon::run_demon(); + swayr::daemon::run_daemon(); } diff --git a/swayr/src/demon.rs b/swayr/src/daemon.rs similarity index 98% rename from swayr/src/demon.rs rename to swayr/src/daemon.rs index 15381c4..6cebaac 100644 --- a/swayr/src/demon.rs +++ b/swayr/src/daemon.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License along with // this program. If not, see . -//! Functions and data structures of the swayrd demon. +//! Functions and data structures of the swayrd daemon. use crate::cmds; use crate::config; @@ -28,11 +28,13 @@ use std::sync::RwLock; use std::thread; use swayipc as s; -pub fn run_demon() { + +pub fn run_daemon() { let extra_props: Arc>> = Arc::new(RwLock::new(HashMap::new())); let extra_props_for_ev_handler = extra_props.clone(); + thread::spawn(move || { monitor_sway_events(extra_props_for_ev_handler); }); @@ -121,7 +123,7 @@ pub fn monitor_sway_events( } } } - log::debug!("Swayr demon shutting down.") + log::debug!("Swayr daemon shutting down.") } fn handle_window_event( diff --git a/swayr/src/layout.rs b/swayr/src/layout.rs index d295fc3..2305875 100644 --- a/swayr/src/layout.rs +++ b/swayr/src/layout.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License along with // this program. If not, see . -//! Functions and data structures of the swayrd demon. +//! Functions and data structures of the swayrd daemon. use crate::config; use crate::shared::ipc; diff --git a/swayr/src/lib.rs b/swayr/src/lib.rs index 6f046a0..1d4c535 100644 --- a/swayr/src/lib.rs +++ b/swayr/src/lib.rs @@ -14,14 +14,14 @@ // this program. If not, see . //! **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 +//! It consists of a daemon, and a client. The `swayrd` daemon records //! window/workspace creations, deletions, and focus changes using sway's JSON -//! IPC interface. The client `swayr` offers subcommands, see `swayr --help`. +//! IPC interface. The `swayr` client offers subcommands, see `swayr --help`. pub mod client; pub mod cmds; pub mod config; -pub mod demon; +pub mod daemon; pub mod layout; pub mod shared; pub mod tree;