mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-05 14:10:34 -04:00
Tell orca to reload settings after we change them.
Use SIGUSR1 to tell orca to reload the settings we just wrote.
This commit is contained in:
parent
da2585f2d7
commit
2508919d93
1 changed files with 16 additions and 0 deletions
|
@ -293,6 +293,7 @@ impl<'dbus> OrcaManager<'dbus> {
|
|||
|
||||
self.set_orca_option(PITCH_SETTING, pitch).await?;
|
||||
self.pitch = pitch;
|
||||
self.reload_orca().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -305,6 +306,7 @@ impl<'dbus> OrcaManager<'dbus> {
|
|||
|
||||
self.set_orca_option(RATE_SETTING, rate).await?;
|
||||
self.rate = rate;
|
||||
self.reload_orca().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -317,6 +319,7 @@ impl<'dbus> OrcaManager<'dbus> {
|
|||
|
||||
self.set_orca_option(VOLUME_SETTING, volume).await?;
|
||||
self.volume = volume;
|
||||
self.reload_orca().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -423,6 +426,19 @@ impl<'dbus> OrcaManager<'dbus> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
async fn reload_orca(&self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
async fn reload_orca(&self) -> Result<()> {
|
||||
// TODO: Use dbus api to tell orca to reload settings once dbus api is packaged.
|
||||
let pid = self.get_orca_pid()?;
|
||||
signal::kill(pid, signal::Signal::SIGUSR1)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_orca_pid(&self) -> Result<Pid> {
|
||||
let mut system = System::new();
|
||||
system.refresh_all();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue