Skip to content
Merged
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
17 changes: 17 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,23 @@ cd src-tauri && cargo test bindings

The database is `library.sqlite`. Schema changes are new migration steps in `src-tauri/src/cache/db.rs`.

## Flatpak

`packaging/flatpak/` holds a manifest for local test builds. It unpacks an AppImage built from your checkout onto the GNOME runtime, which has WebKitGTK. You need `flatpak` and `flatpak-builder`, and the runtime from Flathub:

```bash
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install --user flathub org.gnome.Platform//51 org.gnome.Sdk//51 org.freedesktop.Platform.Compat.i386//26.08 org.flatpak.Builder
npm run tauri build -- --bundles appimage --config '{"bundle":{"createUpdaterArtifacts":false}}'
cp src-tauri/target/release/bundle/appimage/Guild_*_amd64.AppImage packaging/flatpak/Guild.AppImage
cd packaging/flatpak
flatpak-builder --user --install --force-clean --repo=repo build-dir cloud.biem.guild.yml
flatpak build-bundle --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo repo guild.flatpak cloud.biem.guild
flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest cloud.biem.guild.yml
```

Install the bundle on another PC with `flatpak install --user guild.flatpak` (it fetches the runtime from Flathub) and start it with `flatpak run cloud.biem.guild`. A bundle has no remote, so Flatpak doesn't fetch the 32-bit extensions Windows games need; install them once with `flatpak install --user flathub org.freedesktop.Platform.Compat.i386//26.08 org.freedesktop.Platform.GL32.default//26.08` (on NVIDIA, the `GL32.nvidia-*` that matches the driver instead of `GL32.default`). In a Flatpak, Guild doesn't check for updates and hides the autostart switch, and it trusts Steam's `RunningAppID` without checking for the Steam process, which the sandbox can't see. It reads Steam folders and installs to `~/Games`, `/mnt`, `/media` and `/run/media`; give it other folders with `flatpak override --user --filesystem=<path> cloud.biem.guild`.

## Releasing

Pushing a `v*` tag runs `.github/workflows/release.yml`: it runs the checks, builds the Windows NSIS installer and the Linux AppImage and `.deb` (on Ubuntu 22.04, so the AppImage runs on older glibc), signs the installer and the AppImage for the updater, and publishes a GitHub release with `latest.json`. A last job writes `latest.json` with both the `windows-x86_64` and `linux-x86_64-appimage` entries. The `.deb` doesn't auto-update: its update check finds no entry for it. The installed app checks `releases/latest/download/latest.json` for updates. Running the workflow by hand only builds and signs, and keeps the files as workflow artifacts.
Expand Down
5 changes: 5 additions & 0 deletions packaging/flatpak/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Guild.AppImage
.flatpak-builder/
build-dir/
repo/
*.flatpak
10 changes: 10 additions & 0 deletions packaging/flatpak/cloud.biem.guild.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=Guild
Comment=Your Steam, Epic, GOG and Amazon games in one library
Exec=guild
Icon=cloud.biem.guild
Terminal=false
Categories=Game;
Keywords=Steam;Epic;GOG;Amazon;Proton;launcher;library;
StartupWMClass=Guild
41 changes: 41 additions & 0 deletions packaging/flatpak/cloud.biem.guild.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>cloud.biem.guild</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>Guild</name>
<summary>Your Steam, Epic, GOG and Amazon games in one library</summary>
<developer id="cloud.biem">
<name>TheBiemGamer</name>
</developer>
<description>
<p>Guild puts your Steam, Epic, GOG and Amazon games in one grid, next to any game you add yourself. A game you own in two stores shows up once, and you pick which store starts it.</p>
<p>Epic, GOG and Amazon games install, update, verify and uninstall from Guild itself, through one download queue you can pause and reorder. Epic and GOG cloud saves sync before and after you play. Windows games run through umu-launcher and Proton, each in its own Wine prefix.</p>
<p>Each game has a page with its description, screenshots, your playtime and how long it takes to beat. You can sort and filter the library, mark favorites, hide games and make your own collections.</p>
<p>Steam games install and start through the Steam client, which stays installed.</p>
</description>
<launchable type="desktop-id">cloud.biem.guild.desktop</launchable>
<url type="homepage">https://github.com/TheBiemGamer/guild</url>
<url type="bugtracker">https://github.com/TheBiemGamer/guild/issues</url>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/TheBiemGamer/guild/main/docs/screenshot.png</image>
<caption>The library grid</caption>
</screenshot>
</screenshots>
<content_rating type="oars-1.1"/>
<supports>
<control>pointing</control>
<control>keyboard</control>
</supports>
<requires>
<display_length compare="ge">720</display_length>
</requires>
<releases>
<release version="0.2.0" date="2026-11-09">
<description>
<p>Guild runs on Linux. Epic, GOG, Amazon and added Windows games run through umu-launcher and Proton, each game in its own Wine prefix.</p>
</description>
</release>
</releases>
</component>
Binary file added packaging/flatpak/cloud.biem.guild.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions packaging/flatpak/cloud.biem.guild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
id: cloud.biem.guild
runtime: org.gnome.Platform
runtime-version: '51'
sdk: org.gnome.Sdk
command: guild

finish-args:
- --share=ipc
- --share=network
- --socket=x11
- --socket=wayland
- --socket=pulseaudio
# GPU, and controllers for games
- --device=all
# 32-bit Wine and Proton parts
- --allow=multiarch
# Wine and pressure-vessel use syscalls the default seccomp filter blocks
- --allow=devel
# pressure-vessel shares /dev/shm with the container it starts games in
- --allow=per-app-dev-shm
# The Steam refresh token, the IGDB secret and the SteamGridDB key, in the keyring
- --talk-name=org.freedesktop.secrets
# Tray icon
- --talk-name=org.kde.StatusNotifierWatcher
# Download-finished notifications
- --talk-name=org.freedesktop.Notifications
# Steam: its library, pid, registry.vdf and art (regular and Flatpak Steam); Guild never writes there
- --filesystem=~/.steam:ro
- --filesystem=xdg-data/Steam:ro
- --filesystem=~/.var/app/com.valvesoftware.Steam:ro
# umu keeps the Steam Linux Runtime in the host's ~/.local/share/umu when in a Flatpak; pressure-vessel can only
# hand a folder on the real disk to the Flatpak portal's sub-sandbox it runs games in
- --filesystem=xdg-data/umu:create
# The default install folder for Epic, GOG and Amazon games
- --filesystem=~/Games:create
# Install folders and Steam libraries on other drives
- --filesystem=/mnt
- --filesystem=/media
- --filesystem=/run/media

add-extensions:
org.freedesktop.Platform.Compat.i386:
directory: lib/i386-linux-gnu
version: '26.08'

org.freedesktop.Platform.GL32:
directory: lib/i386-linux-gnu/GL
version: '1.4'
versions: 26.08;1.4
subdirectories: true
no-autodownload: true
autodelete: false
add-ld-path: lib
merge-dirs: vulkan/icd.d;glvnd/egl_vendor.d;OpenCL/vendors;lib/dri;lib/d3d;vulkan/explicit_layer.d;vulkan/implicit_layer.d
download-if: active-gl-driver
enable-if: active-gl-driver
autoprune-unless: active-gl-driver

modules:
- name: guild
buildsystem: simple
build-commands:
- chmod +x Guild.AppImage
- ./Guild.AppImage --appimage-extract >/dev/null
- install -Dm755 squashfs-root/usr/bin/Guild /app/bin/guild
- mkdir -p /app/lib/i386-linux-gnu/GL
# The tray library; the GNOME runtime has WebKitGTK but not this
- cp -a squashfs-root/usr/lib/libayatana-*.so* squashfs-root/usr/lib/libdbusmenu-*.so* /app/lib/
- install -Dm644 ld.so.conf -t /app/etc
- install -Dm644 cloud.biem.guild.desktop -t /app/share/applications
- install -Dm644 cloud.biem.guild.metainfo.xml -t /app/share/metainfo
- install -Dm644 cloud.biem.guild.png /app/share/icons/hicolor/256x256/apps/cloud.biem.guild.png
sources:
# Built from this checkout, see DEVELOPMENT.md. A Flathub manifest would point at the release's AppImage.
- type: file
path: Guild.AppImage
- type: inline
dest-filename: ld.so.conf
contents: /app/lib/i386-linux-gnu
- type: file
path: cloud.biem.guild.desktop
- type: file
path: cloud.biem.guild.metainfo.xml
- type: file
path: cloud.biem.guild.png
4 changes: 4 additions & 0 deletions src-tauri/src/commands/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ pub struct SettingsView {
start_with_windows: bool,
/// Picks the Linux wording where the Windows one names Windows.
linux: bool,
/// A Flatpak hides the autostart switch (the sandbox can't reach the host's autostart folder) and update checks.
flatpak: bool,
close_to_tray: bool,
notify_downloads: bool,
app_version: String,
Expand Down Expand Up @@ -408,6 +410,7 @@ pub async fn settings_view(app: AppHandle) -> Res<SettingsView> {
gog_cloud_saves: saved.gog_cloud_saves,
start_with_windows: app.autolaunch().is_enabled().unwrap_or(false),
linux: cfg!(target_os = "linux"),
flatpak: crate::platform::flatpak(),
close_to_tray: saved.close_to_tray,
notify_downloads: saved.notify_downloads,
app_version: app.package_info().version.to_string(),
Expand Down Expand Up @@ -1070,6 +1073,7 @@ mod tests {
gog_cloud_saves: false,
start_with_windows: false,
linux: false,
flatpak: false,
close_to_tray: true,
notify_downloads: true,
app_version: env!("CARGO_PKG_VERSION").into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ expression: view
"gogCloudSaves": false,
"startWithWindows": false,
"linux": false,
"flatpak": false,
"closeToTray": true,
"notifyDownloads": true,
"appVersion": "[version]",
Expand Down
4 changes: 4 additions & 0 deletions src-tauri/src/commands/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ pub struct UpdateInfo {
#[tauri::command]
#[specta::specta]
pub async fn check_update(app: AppHandle, state: State<'_, AppState>) -> Res<Option<UpdateInfo>> {
// Flathub updates a Flatpak, which must not update itself.
if crate::platform::flatpak() {
return Ok(None);
}
let mut pending = state.update.lock().await;
let checked = async {
app.updater_builder()
Expand Down
4 changes: 3 additions & 1 deletion src-tauri/src/library/steam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ pub fn running_game() -> Option<String> {
let id = running_id(crate::platform::steam_running_app())?;
// After a Steam crash RunningAppID keeps its last value (seen on this PC), so only
// trust it while the Steam process it was written by is still alive.
steam_alive(steam_pid()?).then_some(id)
// shortcut: a Flatpak can't see host processes, so there a crash's stale id counts as running until Steam starts
// again; find another liveness signal if that shows up.
(crate::platform::flatpak() || steam_alive(steam_pid()?)).then_some(id)
}

pub fn download_progress(game: &Game) -> Option<Progress> {
Expand Down
43 changes: 42 additions & 1 deletion src-tauri/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,41 @@ pub fn open_url(url: &str) -> Result<(), crate::library::Error> {
shell_open(url)
}

/// Windows has no Flatpak.
#[cfg(windows)]
pub fn flatpak() -> bool {
false
}

/// Whether Guild runs as a Flatpak: the store updates it, and the sandbox hides host processes and the host's
/// autostart folder.
#[cfg(target_os = "linux")]
pub fn flatpak() -> bool {
static FLATPAK: std::sync::LazyLock<bool> =
std::sync::LazyLock::new(|| std::path::Path::new("/.flatpak-info").exists());
*FLATPAK
}

/// Windows draws the tray icon itself.
#[cfg(windows)]
pub fn tray_icon_dir() -> Option<std::path::PathBuf> {
None
}

/// Where the tray writes its icon for the desktop's tray to read: a Flatpak's own `$XDG_RUNTIME_DIR` is private to
/// the sandbox, but `$XDG_RUNTIME_DIR/app/<app id>` is the same folder on the host. `None` keeps tray-icon's default.
#[cfg(target_os = "linux")]
pub fn tray_icon_dir() -> Option<std::path::PathBuf> {
let runtime = std::env::var_os("XDG_RUNTIME_DIR")?;
let id = std::env::var_os("FLATPAK_ID").filter(|_| flatpak())?;
Some(
std::path::Path::new(&runtime)
.join("app")
.join(id)
.join("tray-icon"),
)
}

/// Whether process `pid` runs and is named `image` (the name guards against a reused pid).
#[cfg(windows)]
pub fn pid_is(pid: u32, image: &str) -> bool {
Expand Down Expand Up @@ -788,7 +823,13 @@ pub fn os_version() -> String {
/// sets them, like "CachyOS Linux, KDE, wayland": WebKitGTK and tray bugs often depend on those two.
#[cfg(target_os = "linux")]
pub fn os_version() -> String {
let distro = std::fs::read_to_string("/etc/os-release")
// A Flatpak's /etc/os-release names its runtime; the host's is under /run/host.
let release = if flatpak() {
"/run/host/os-release"
} else {
"/etc/os-release"
};
let distro = std::fs::read_to_string(release)
.ok()
.and_then(|text| pretty_name(&text))
.unwrap_or_else(|| "Linux".into());
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ pub fn build(app: &AppHandle) -> tauri::Result<()> {
if let Some(icon) = app.default_window_icon() {
tray = tray.icon(icon.clone());
}
if let Some(dir) = crate::platform::tray_icon_dir() {
tray = tray.temp_dir_path(dir);
}
tray.build(app)?;
Ok(())
}
Expand Down
15 changes: 11 additions & 4 deletions src-tauri/src/wine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,18 @@ pub fn setting_up(key: &str) -> bool {
true
}

/// umu's own folder, where it keeps the Steam Linux Runtime.
/// umu's own folder, where it keeps the Steam Linux Runtime. In a Flatpak umu skips the sandbox's data folder for the
/// host's (`umu_consts.py`).
fn umu_data() -> PathBuf {
directories::BaseDirs::new()
.map(|b| b.data_dir().join("umu"))
.unwrap_or_default()
let host = std::env::var_os("HOST_XDG_DATA_HOME")
.map(PathBuf::from)
.or_else(|| directories::BaseDirs::new().map(|b| b.home_dir().join(".local/share")));
let data = if crate::platform::flatpak() {
host
} else {
directories::BaseDirs::new().map(|b| b.data_dir().to_path_buf())
};
data.map(|d| d.join("umu")).unwrap_or_default()
}

/// Whether a launch must wait: the prefix hasn't been set up (Proton writes `version` once it has), or umu still has to
Expand Down
18 changes: 10 additions & 8 deletions src/lib/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1153,12 +1153,14 @@
<h3>{t('settings.section.general')}</h3>
<h4>{t('settings.group.startup')}</h4>
<div class="group">
{@render switchRow(
'power',
'start_with_windows',
'startWithWindows',
view.linux ? t('settings.startupLinux') : t('settings.startup'),
)}
{#if !view.flatpak}
{@render switchRow(
'power',
'start_with_windows',
'startWithWindows',
view.linux ? t('settings.startupLinux') : t('settings.startup'),
)}
{/if}
{@render switchRow('tray', 'close_to_tray', 'closeToTray', t('settings.tray'), t('settings.trayHint'))}
{@render switchRow('bell', 'notify_downloads', 'notifyDownloads', t('settings.notify'))}
</div>
Expand Down Expand Up @@ -1389,7 +1391,7 @@
{@render tile('about')}
<div class="what">
<!-- The header shows the version, so this row says only what the last check found. -->
{versionNote ?? t('settings.version', { version: view.appVersion })}
{(view.flatpak ? null : versionNote) ?? t('settings.version', { version: view.appVersion })}
</div>
{#if notes}
<button
Expand All @@ -1406,7 +1408,7 @@
<button class="btn" aria-disabled={installing} onclick={() => installing || oninstall()}>
{installing ? t('update.downloading') : t('update.restart')}
</button>
{:else}
{:else if !view.flatpak}
<button class="btn" disabled={checking} onclick={checkNow}>{checking ? t('steam.checking') : t('settings.checkUpdates')}</button>
{/if}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/lib/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ export type SettingsView = {
startWithWindows: boolean,
/** Picks the Linux wording where the Windows one names Windows. */
linux: boolean,
/** A Flatpak hides the autostart switch (the sandbox can't reach the host's autostart folder) and update checks. */
flatpak: boolean,
closeToTray: boolean,
notifyDownloads: boolean,
appVersion: string,
Expand Down
Loading