From 50f81ffa43d8afd5193e6b027bd3452d573ddeac Mon Sep 17 00:00:00 2001 From: Rafael Zanella Date: Mon, 11 May 2026 18:14:35 +0100 Subject: [PATCH] Added default PID path when running as daemon --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index b49d8193..7d6a7e2b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use crate::config::CliConfig; +use crate::config::{CliConfig, SpotifydConfig}; use clap::Parser; #[cfg(unix)] use color_eyre::eyre::eyre; @@ -159,6 +159,16 @@ fn run_daemon(mut cli_config: CliConfig) -> eyre::Result<()> { // Returns the old SpotifydConfig struct used within the rest of the daemon. let internal_config = config::get_internal_config(cli_config); + #[cfg(unix)] + let internal_config = if internal_config.pid.is_none() { + SpotifydConfig { + pid: Some("/tmp/spotifyd.pid".to_string()), // Default PID location when running as daemon + ..internal_config + } + } else { + internal_config + }; + if is_daemon { info!("Daemonizing running instance");