Skip to main content

Crate clairlune_platform

Crate clairlune_platform 

Source
Expand description

Platform layer: finding the monitors and setting the desktop wallpaper.

The OS wallpaper APIs only set static images (PLAN.md section 2). A WallpaperHost wraps one OS’s API: list the monitors with stable ids and physical sizes, read and set each monitor’s wallpaper. detect picks the host for the running system. StillStore writes each still under a new file name, because some systems don’t reload an unchanged path.

Windows (IDesktopWallpaper, per monitor) and Linux (GNOME, Cinnamon, MATE, KDE Plasma, XFCE, Sway; one image for all monitors) are implemented;

Modules§

usage
What this process uses (CPU time, memory), for the log. What this process uses, for the log: CPU time so far, and memory now (on macOS the footprint Activity Monitor shows, GPU surfaces included).
wlr
Compositors with wlr layer-shell: our own background surfaces. Compositors with the wlr layer-shell protocol (Sway, Hyprland, river, Wayfire, labwc and others): Clairlune’s own surfaces in the background layer of every output, drawn in shared memory. They show the still wallpaper where the compositor has no wallpaper tool of its own (show_still, held by a thread for as long as the app runs), and the live wallpaper’s frames (Surfaces, driven by the live host).

Structs§

Capabilities
What a host can do.
Monitor
One monitor, in physical pixels.
Snapshot
The wallpaper as it was before Clairlune first set one, so it can be put back: each monitor’s image (or none) and the system’s fit mode.
StillStore

Enums§

PlatformError

Constants§

BACKGROUND_ARG
The argument a sign-in launch passes: start quietly, no window.

Traits§

WallpaperHost
One system’s wallpaper API.

Functions§

app_config_dir
Clairlune’s configuration directory: <config>/clairlune.
app_data_dir
Clairlune’s data directory (stills, archive, logs): <local data>/clairlune.
config_dir
The per-user configuration directory: Roaming AppData on Windows, ~/Library/Application Support on macOS, $XDG_CONFIG_HOME (or ~/.config) elsewhere.
detect
The host for the running system.
init_dpi_awareness
Makes the process aware of each monitor’s DPI so sizes come back in physical pixels. Call once, before any window or monitor query. A no-op where it does not apply.
linux_desktop_monitor
Linux: the whole desktop as the one monitor wallpapers are made for (its largest output’s size), without a wallpaper host (window managers with none can still play live).
local_data_dir
The per-user local data directory: Local AppData on Windows, ~/Library/Application Support on macOS, $XDG_DATA_HOME (or ~/.local/share) elsewhere.
login_entry_outdated
Whether the login entry for exe is one from 0.12 or older (Windows), which starts it without BACKGROUND_ARG.
on_battery
Running on battery power.
open_login_items_settings
macOS: opens System Settings at General > Login Items. Nothing elsewhere.
open_url
Opens a web page in the default browser (& and % in it are safe).
pictures_dir
The user’s Pictures folder (exports go to Pictures/Clairlune).
set_start_at_login
Registers or removes exe as a login item (per user, no admin rights), started with BACKGROUND_ARG.
start_at_login
Whether exe is registered to start at login; None where this build can’t manage login items.
start_at_login_needs_approval
macOS: start at login is registered but turned off in System Settings > General > Login Items, where only the user can turn it on. false elsewhere.
system_prefers_dark
Whether the system asks apps for a dark appearance, when that is known.
taskbar_is_light
Whether the taskbar (where the tray icon sits) is light, when that is known: Windows only (macOS tints a template icon itself).