diff --git a/Makefile b/Makefile
index 9a0fcf3..6e30f4c 100644
--- a/Makefile
+++ b/Makefile
@@ -9,9 +9,14 @@ DEMO_PASS ?= demo
SHOTS_DIR := target/shots
SCRATCH := target/scratch
+FLATPAK_ID := me.anshorei.Fettleshed.Remus
+FLATPAK_DIR := target/flatpak
+FLATPAK_SDK := org.freedesktop.Sdk//26.08
+FLATPAK_BUILDER := $(shell command -v flatpak-builder 2>/dev/null || echo flatpak run org.flatpak.Builder)
+
.PHONY: help
help: ## List the targets
- @grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
+ @grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## Debug build
@@ -65,6 +70,29 @@ shots: ## Screenshot the main screens against the demo server into target/shots
REMUS_DEV_SCRIPT="wait:4000,shot:$(SHOTS_DIR)/home.png,right,activate,wait:3000,shot:$(SHOTS_DIR)/album.png,down,activate,wait:3000,now-playing,wait:2500,shot:$(SHOTS_DIR)/now-playing.png,play-pause,back,section-next,section-next,section-next,wait:3000,shot:$(SHOTS_DIR)/artists.png,quit" \
./target/debug/remus
+.PHONY: sdk-check
+sdk-check: ## make check inside the Flatpak SDK, which has the GStreamer dev files
+ flatpak run --share=network --filesystem=$(CURDIR) --command=sh $(FLATPAK_SDK) -c '\
+ export PATH=$$PATH:/usr/lib/sdk/rust-stable/bin CARGO_HOME=$(CURDIR)/target/sdk/cargo-home \
+ CARGO_TARGET_DIR=$(CURDIR)/target/sdk REMUS_AUDIO_SINK=fakesink && \
+ cd $(CURDIR) && cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test'
+
+.PHONY: flatpak
+flatpak: ## Build the Flatpak into target/flatpak/repo
+ cargo vendor --locked $(FLATPAK_DIR)/vendor > /dev/null
+ $(FLATPAK_BUILDER) --user --install-deps-from=flathub --force-clean --state-dir=$(FLATPAK_DIR)/state \
+ --repo=$(FLATPAK_DIR)/repo $(FLATPAK_DIR)/build flatpak/$(FLATPAK_ID).yml
+
+.PHONY: flatpak-install
+flatpak-install: flatpak ## Build the Flatpak and install it for this user
+ flatpak --user remote-add --if-not-exists --no-gpg-verify remus-local $(FLATPAK_DIR)/repo
+ flatpak --user install -y --reinstall remus-local $(FLATPAK_ID)
+
+.PHONY: flatpak-bundle
+flatpak-bundle: flatpak ## Build target/flatpak/remus.flatpak, a single file to copy to a Steam machine
+ flatpak build-bundle --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo \
+ $(FLATPAK_DIR)/repo $(FLATPAK_DIR)/remus.flatpak $(FLATPAK_ID)
+
.PHONY: clean
clean: ## Remove build output, screenshots and scratch config
cargo clean
diff --git a/README.md b/README.md
index 76d8eb7..28ee516 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,26 @@ On first start remus asks for the server address, username and password. It stor
Covers are cached in `~/.cache/remus/covers`.
+## Install on SteamOS
+
+Build the bundle on any Linux machine with Flatpak:
+
+```
+make flatpak-bundle # writes target/flatpak/remus.flatpak
+```
+
+`make flatpak` needs `org.flatpak.Builder` from Flathub. It fetches the freedesktop 26.08 SDK and its Rust extension on first use.
+
+On the Steam machine, in Desktop Mode:
+
+1. Copy `remus.flatpak` over and install it from a terminal: `flatpak install --user remus.flatpak`. Flatpak pulls the freedesktop 26.08 runtime from Flathub.
+2. In Steam, choose Games → Add a Non-Steam Game to My Library and pick Remus.
+3. Back in Game Mode, open its controller settings and pick a Gamepad layout, so Steam passes the buttons through as a controller and not as keyboard and mouse.
+
+The Flatpak keeps its login and cover cache in `~/.var/app/me.anshorei.Fettleshed.Remus/`, not in `~/.config` and `~/.cache`. Flatpak sets `XDG_CONFIG_HOME` itself there, so overriding it with `flatpak run --env` has no effect.
+
+To update, build a new bundle and install it the same way.
+
## Controls
| Gamepad | Keyboard | Action |
diff --git a/flatpak/me.anshorei.Fettleshed.Remus.desktop b/flatpak/me.anshorei.Fettleshed.Remus.desktop
new file mode 100644
index 0000000..260cdcf
--- /dev/null
+++ b/flatpak/me.anshorei.Fettleshed.Remus.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Name=Remus
+Comment=Play your Subsonic music library with a controller
+Exec=remus
+Icon=me.anshorei.Fettleshed.Remus
+Terminal=false
+Categories=AudioVideo;Audio;Player;
+Keywords=music;subsonic;navidrome;player;
+StartupNotify=true
diff --git a/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml b/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml
new file mode 100644
index 0000000..042a349
--- /dev/null
+++ b/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml
@@ -0,0 +1,25 @@
+
+
+ me.anshorei.Fettleshed.Remus
+ Remus
+ Play your Subsonic music library with a controller
+ CC0-1.0
+ MIT
+
+
+ A fullscreen music player for a Subsonic or OpenSubsonic server, built for SteamOS.
+ It is driven entirely with a gamepad and scales to look the same on a Steam Deck
+ and on a 4K TV.
+