Files
Zer0TraceXandclaude[bot] 87a4da9e13 feat(freebsd): Add initial native FreeBSD support (#3559)
* feat(freebsd): add comprehensive native FreeBSD support

* Update BatteryService.qml

* Add battery probe completion and fallback updates

* Add isVideoSource function and update PwObjectTracker filter

* Add isPipewireVideoSource function to AudioService

Added a function to check if a Pipewire node is a video source.

* Refactor video source check to use AudioService

* Remove unnecessary call in BatteryService.qml

* Add call to updateFreeBsdBatteryFallback on completion

* Simplify AudioService by eliminating redundant bindings

Removed unnecessary bindings in the AudioService loader to streamline the loading process.

* Improve error handling in CheckUpdates function

Handle specific exit error for package upgrade check.

* Enhance FreeBSD network detection logic

* Implement FreeBSD Wi-Fi hardware discovery in Initialize

Added FreeBSD Wi-Fi hardware discovery and updated initialization logic to handle cases where no wpa_supplicant control socket is found.

* Implement Ethernet state monitoring in StartMonitoring

Added monitoring for Ethernet state updates in StartMonitoring function.

* Add Ethernet management functions to backend

* Remove unimplemented Ethernet control methods

Removed unimplemented Ethernet control methods from WpaSupplicantBackend.

* Implement SetWiFiEnabled method for WiFi control

Add error handling and state management for WiFi control

* Update core/internal/server/network/backend_wpa_ethernet.go

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Implement Ethernet monitoring in WpaSupplicantBackend

* Refactor startEthernetMonitor and add debounce logic

Refactor the startEthernetMonitor function to improve readability and maintainability. Introduce a debounce mechanism for processing relevant FreeBSD route events.

* Reorder import statements in backend_pkg.go

* Remove unnecessary blank line in backend_wpa_ethernet.go

* Implement FreeBSD audio polling based on UI visibility

Introduce a polling mechanism for FreeBSD audio device updates based on visibility of UI elements.

* Add readonly freeBsdPollingRequested property and optimize polling

Introduce a readonly property to determine if FreeBSD polling is requested based on various UI conditions. Update command execution to prioritize polling efficiency.

* Simplify freeBsdPollingRequested logic

Removed unnecessary conditions from freeBsdPollingRequested property.

* Implement reference counting for battery consumers

Added reference counting to manage battery information consumers and updated related functions for better battery state handling.

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-10-05 22:03:32 -04:00
..

FreeBSD support

DankMaterialShell contains native FreeBSD code paths and does not require PulseAudio, PipeWire, systemd, NetworkManager, or Linux sysfs to provide its core shell features.

Native FreeBSD integrations

  • Audio: sound(4) / mixer(8). DMS enumerates all pcmN mixers, supports output/input volume and mute, and can change the default PCM device. PipeWire is dynamically loaded only on non-FreeBSD systems, so a FreeBSD session does not attempt to create a PipeWire context. Rapid volume changes are coalesced to keep the OSD responsive.
  • Wi-Fi: the DMS daemon has a wpa_supplicant backend.
  • Brightness: native FreeBSD backlight/devd support in the DMS daemon.
  • Battery: UPower is used when useful; acpiconf(8) plus hw.acpi.acline is the native fallback.
  • Power: acpiconf(8) for suspend and shutdown(8) for reboot/poweroff.
  • Users: pw(8).
  • Package updates: pkg(8).
  • Compositor/socket discovery: sockstat(1) where Linux would use /proc.
  • Greeter state: FreeBSD rc service detection for greetd.
  • Sessions: elogind/loginctl is used when installed; otherwise DMS exposes the current session without repeatedly executing a missing Linux command.

Install the Wayland/desktop tools used by the features you enable (for example Quickshell, grim/slurp, wl-clipboard, and a notification/audio stack as desired) from FreeBSD packages/ports. DMS's native audio path itself only needs the base system mixer utility.

For session switching and login-manager integration, install/use elogind so loginctl is available. Without elogind, locking and the current-session shell remain usable, but switching between already-running graphical sessions is not provided by the base system.

FreeBSD limitations that DMS should not fake

  • FreeBSD ACPI S4 hibernation is hardware/kernel dependent and is not presented as generally available by DMS.
  • Charge thresholds are vendor-specific; the Linux /sys/class/power_supply controls are hidden on FreeBSD.
  • Changing the default pcmN affects newly opened native audio streams. Moving an already-open stream between devices requires an audio routing layer such as virtual_oss.
  • Power-profile-daemon and Linux rfkill semantics are not assumed. Features backed only by those Linux services are hidden/degraded rather than invoking Linux commands on FreeBSD.