mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-12 17:32:21 -04:00
systemd: Add methods for enabling, disabling, masking, and unmasking
This commit is contained in:
parent
96ebb6d75c
commit
eb5fbc8e39
3 changed files with 82 additions and 4 deletions
|
@ -126,7 +126,7 @@ impl FanControl {
|
|||
|
||||
pub async fn get_state(&self) -> Result<FanControlState> {
|
||||
let jupiter_fan_control =
|
||||
SystemdUnit::new(self.connection.clone(), "jupiter_2dfan_2dcontrol_2eservice").await?;
|
||||
SystemdUnit::new(self.connection.clone(), "jupiter-fan-control.service").await?;
|
||||
let active = jupiter_fan_control.active().await?;
|
||||
Ok(match active {
|
||||
true => FanControlState::Os,
|
||||
|
@ -137,7 +137,7 @@ impl FanControl {
|
|||
pub async fn set_state(&self, state: FanControlState) -> Result<()> {
|
||||
// Run what steamos-polkit-helpers/jupiter-fan-control does
|
||||
let jupiter_fan_control =
|
||||
SystemdUnit::new(self.connection.clone(), "jupiter_2dfan_2dcontrol_2eservice").await?;
|
||||
SystemdUnit::new(self.connection.clone(), "jupiter-fan-control.service").await?;
|
||||
match state {
|
||||
FanControlState::Os => jupiter_fan_control.start().await,
|
||||
FanControlState::Bios => jupiter_fan_control.stop().await,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue