主题与外观
检测明暗主题,实时跟随系统外观。

检测明暗主题,实时跟随系统外观。
支持多显示器、填充模式与明暗配对。
发送系统通知,支持操作按钮与优先级。
按需阻止显示器休眠或系统空闲。
use uda_core::appearance::AppearanceManager;
use uda_platform_linux::appearance::LinuxAppearanceManager;
fn main() -> Result<(), uda_core::error::UdaError> {
let desktop = LinuxAppearanceManager::new();
let theme = desktop.detect_theme()?;
println!("System theme: {theme:?}");
Ok(())
}from uda import Uda, FillMode
with Uda() as desktop:
theme = desktop.detect_theme()
print(f"System theme: {theme}")
desktop.set_wallpaper(
"/usr/share/backgrounds/wallpaper.jpg",
FillMode.FIT
)const koffi = require('koffi');
const lib = koffi.load(process.env.UDA_LIBRARY ?? 'uda_ffi.dll');
const detectTheme = lib.func(
'uda_detect_theme', 'int32', ['void *']
);
const theme = koffi.alloc(koffi.types.int32, 1);
if (detectTheme(theme) === 0) {
console.log(koffi.decode(theme, koffi.types.int32));
}Unsupported通过 capabilities() 区分完整支持、受限支持与不支持,让应用在调用之前就能做出判断。
| 桌面环境 | 接入方式 | 核心能力 |
|---|---|---|
| Windows 10 / 11 | 原生 Win32 / WinRT | ✓ 完整支持 |
| GNOME 42+ | Portal / 桌面接口 | ✓ 完整支持 |
| KDE Plasma 5 / 6 | Portal / 桌面接口 | ✓ 完整支持 |
| XFCE | 桌面接口 / 回退后端 | ✓ 完整支持 |
| Hyprland / Sway | Wayland / 可用后端 | ◒ 部分支持 |
| Generic X11 | CLI 回退后端 | ◒ 部分支持 |
完整支持指主题、壁纸、通知和唤醒四项能力。部分支持环境的壁纸能力可用,其余能力依赖运行环境及回退后端。
查看详细兼容性说明