forked from unom/punktfunk
D1's last Linux piece (design/client-deep-links.md §5). The shortcut is a CONTAINER FOR A URL, not a second launch mechanism: it invokes the client with a positional `punktfunk://…`, the same door xdg-open and a browser prompt use. That is what makes it survive things it has no control over — scheme registration being lost, the host moving to a new address, the store being wiped — because the URL itself carries the stable id, the address and the pin. A pinned card writes its profile into the shortcut, so "Desktop · Work" on the app grid is one double-click to that exact session. Two sanitisation points that are not cosmetic: the filename is slugged to ASCII (a host called "Büro · Mac" must still produce a writable name), and the `Name=` value is flattened to one line — desktop entries are line-oriented, so a newline in a host name would end the key and turn the rest into another one. Under flatpak the sandbox cannot write ~/.local/share/applications, so the user gets the URL to place themselves — the fallback the design already sanctions. The `org.freedesktop.portal.DynamicLauncher` route, which exists for exactly this and shows its own confirmation, is the intended upgrade there and is not built yet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
43 lines
1.4 KiB
Rust
43 lines
1.4 KiB
Rust
//! `punktfunk-client` — the native Linux punktfunk/1 desktop shell (relm4/libadwaita).
|
|
//!
|
|
//! Hosts, pairing/trust, settings, and the desktop library page; every stream (and the
|
|
//! console game library) runs in the spawned `punktfunk-session` Vulkan binary — the
|
|
//! shell never touches video (punktfunk-planning `linux-client-rearchitecture.md`).
|
|
#![forbid(unsafe_code)]
|
|
|
|
// The UI-agnostic plumbing lives in `pf-client-core`, shared with the session binary.
|
|
// Root re-exports keep every `crate::trust`-style path resolving unchanged.
|
|
#[cfg(target_os = "linux")]
|
|
pub use pf_client_core::{discovery, gamepad, library, trust, video, wol};
|
|
|
|
#[cfg(target_os = "linux")]
|
|
mod app;
|
|
#[cfg(target_os = "linux")]
|
|
mod cli;
|
|
// "Create shortcut…" — the desktop-entry writer (design/client-deep-links.md §5).
|
|
#[cfg(target_os = "linux")]
|
|
mod shortcuts;
|
|
#[cfg(target_os = "linux")]
|
|
mod spawn;
|
|
#[cfg(target_os = "linux")]
|
|
mod ui_hosts;
|
|
#[cfg(target_os = "linux")]
|
|
mod ui_library;
|
|
#[cfg(target_os = "linux")]
|
|
mod ui_settings;
|
|
#[cfg(target_os = "linux")]
|
|
mod ui_trust;
|
|
|
|
#[cfg(target_os = "linux")]
|
|
fn main() -> gtk::glib::ExitCode {
|
|
app::run()
|
|
}
|
|
|
|
/// GTK4/SDL3 are Linux turf; this stub keeps `cargo build --workspace` green on macOS
|
|
/// (the Mac client lives in clients/apple).
|
|
#[cfg(not(target_os = "linux"))]
|
|
fn main() {
|
|
eprintln!("punktfunk-client is Linux-only — the macOS client lives in clients/apple");
|
|
std::process::exit(2);
|
|
}
|