diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-17 10:38:32 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-17 10:45:18 +0400 |
| commit | 40c85da102054caeb86b7905cd27c69e392c8f92 (patch) | |
| tree | ea0f2547ca2949d43ff5898ebab3a56d7eee6d1e /src/niri.rs | |
| parent | 768b32602839896012a9ee3c4ed6885360fa5395 (diff) | |
| download | niri-40c85da102054caeb86b7905cd27c69e392c8f92.tar.gz niri-40c85da102054caeb86b7905cd27c69e392c8f92.tar.bz2 niri-40c85da102054caeb86b7905cd27c69e392c8f92.zip | |
Add an IPC socket and a niri msg outputs subcommand
Diffstat (limited to 'src/niri.rs')
| -rw-r--r-- | src/niri.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/niri.rs b/src/niri.rs index f22612ed..d0a7490f 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -98,6 +98,7 @@ use crate::dbus::mutter_screen_cast::{self, ScreenCastToNiri}; use crate::frame_clock::FrameClock; use crate::handlers::configure_lock_surface; use crate::input::{apply_libinput_settings, TabletData}; +use crate::ipc::server::IpcServer; use crate::layout::{Layout, MonitorRenderElement}; use crate::pw_utils::{Cast, PipeWire}; use crate::render_helpers::{NiriRenderer, PrimaryGpuTextureRenderElement}; @@ -190,6 +191,8 @@ pub struct Niri { #[cfg(feature = "dbus")] pub inhibit_power_key_fd: Option<zbus::zvariant::OwnedFd>, + pub ipc_server: Option<IpcServer>, + // Casts are dropped before PipeWire to prevent a double-free (yay). pub casts: Vec<Cast>, pub pipewire: Option<PipeWire>, @@ -865,6 +868,14 @@ impl Niri { }) .unwrap(); + let ipc_server = match IpcServer::start(&event_loop, &socket_name.to_string_lossy()) { + Ok(server) => Some(server), + Err(err) => { + warn!("error starting IPC server: {err:?}"); + None + } + }; + let pipewire = match PipeWire::new(&event_loop) { Ok(pipewire) => Some(pipewire), Err(err) => { @@ -949,6 +960,8 @@ impl Niri { #[cfg(feature = "dbus")] inhibit_power_key_fd: None, + ipc_server, + pipewire, casts: vec![], } |
