Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src-tauri/src/helpers/clamshell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ pub fn is_clamshell() -> Result<bool, String> {
Ok(stdout.contains("\"AppleClamshellState\" = Yes"))
}

/// Checks if the Mac is a laptop by detecting battery presence
/// Checks if the Mac is a laptop by detecting battery presence.
///
/// This uses pmset to check for battery information.
/// Returns true if a battery is detected (laptop), false otherwise (desktop)
/// This uses pmset to check for battery information on macOS.
/// Returns true if a battery is detected (laptop), false otherwise (desktop).
/// On non-macOS platforms this is a stub that always returns false.
#[cfg(target_os = "macos")]
#[tauri::command]
#[specta::specta]
Expand All @@ -52,8 +53,11 @@ pub fn is_clamshell() -> Result<bool, String> {
Ok(false)
}

/// Stub implementation for non-macOS platforms
/// Always returns false since laptop detection is macOS-specific
/// Checks if the Mac is a laptop by detecting battery presence.
///
/// This uses pmset to check for battery information on macOS.
/// Returns true if a battery is detected (laptop), false otherwise (desktop).
/// On non-macOS platforms this is a stub that always returns false.
#[cfg(not(target_os = "macos"))]
#[tauri::command]
#[specta::specta]
Expand Down
Loading
Loading