app-id: com.doubao.Murmur # GNOME runtime: ships GTK4, PyGObject, and WebKitGTK 6.0 (the # freedesktop runtime has none of these). runtime: org.gnome.Platform runtime-version: '49' sdk: org.gnome.Sdk command: doubao-murmur finish-args: # Display. The overlay windowing relies on X11 (XRecord global keys, # _NET_WM_STATE pinning), so prefer X11 even in mixed sessions. - --socket=x11 - --socket=wayland - --share=ipc - --device=dri # Global hotkey. The X11/XRecord listener is preferred, but it only sees # keys that reach XWayland — on a Wayland session (GNOME) keys going to # native Wayland windows never do, so the evdev listener is the only # working path there and it needs /dev/input. # # This is raw keyboard access, i.e. the sandbox can see every keystroke. # It is what a global hotkey costs; the host still gates it on the user # being in the `input` group, so it is not granted silently. # # --device=all (rather than --device=input) additionally exposes # /dev/uinput, which the paste helper uses for kernel-level Ctrl+V # injection on Wayland desktops (e.g. SteamOS) where xdotool/wtype # cannot reach native Wayland windows. The host still gates uinput on # its own permissions (input group / ACL), so this is not silent access. - --device=all # Audio (microphone via PulseAudio compat layer over PipeWire) - --socket=pulseaudio # Network (WebSocket to ASR service, doubao.com login) - --share=network # Filesystem (config storage) - --filesystem=xdg-config/doubao-murmur:create # DBus (notifications, portals, flatpak-spawn for host xdotool paste) - --talk-name=org.freedesktop.Notifications - --talk-name=org.freedesktop.portal.Desktop - --talk-name=org.freedesktop.Flatpak # System tray (StatusNotifierItem registration with KDE/compatible trays) - --talk-name=org.kde.StatusNotifierWatcher # Version-independent module path (see app module install step) - --env=PYTHONPATH=/app/lib/python/site-packages - --env=GDK_BACKEND=x11 modules: # PortAudio (for sounddevice) - name: portaudio buildsystem: cmake-ninja config-opts: - -DPA_USE_ALSA=ON - -DPA_USE_JACK=OFF - -DPA_USE_OSS=OFF - -DPA_BUILD_TESTS=OFF - -DPA_BUILD_EXAMPLES=OFF # portaudio 19.7's cmake_minimum_required predates the SDK's CMake 4 - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 sources: - type: archive url: https://github.com/PortAudio/portaudio/archive/refs/tags/v19.7.0.tar.gz sha256: 5af29ba58bbdbb7bbcefaaecc77ec8fc413f0db6f4c4e286c40c3e1b83174fa0 # Python dependencies. Network access during build is enabled in # build-args, so this manifest is for local builds (Flathub submission # would need pinned wheel sources instead). - name: python-deps buildsystem: simple build-options: build-args: - --share=network build-commands: - pip3 install --no-cache-dir --prefix=/app websockets sounddevice python-xlib # wl-clipboard: wl-copy/wl-paste bundled in the sandbox. On Wayland the # compositor refuses clipboard writes from windows without keyboard # focus, so the GTK clipboard API silently fails for our non-focusing # overlay. wl-copy uses the wlr-data-control protocol (supported by # KWin/wlroots, e.g. SteamOS), which works without focus. - name: wl-clipboard buildsystem: meson config-opts: - -Dfishcompletiondir=no - -Dzshcompletiondir=no sources: - type: archive url: https://github.com/bugaevc/wl-clipboard/archive/refs/tags/v2.2.1.tar.gz sha256: 6eb8081207fb5581d1d82c4bcd9587205a31a3d47bea3ebeb7f41aa1143783eb # Main application - name: doubao-murmur buildsystem: simple build-commands: # Install to a python-version-independent path - mkdir -p /app/lib/python/site-packages - cp -r src/doubao_murmur /app/lib/python/site-packages/ - mkdir -p /app/bin - | cat > /app/bin/doubao-murmur << 'LAUNCHER' #!/bin/sh SITE="/app/lib/python/site-packages" # pip-installed deps live under the runtime's python version dir for d in /app/lib/python3*/site-packages; do SITE="$SITE:$d" done export PYTHONPATH="$SITE:$PYTHONPATH" exec python3 -m doubao_murmur "$@" LAUNCHER chmod +x /app/bin/doubao-murmur - install -D flatpak/com.doubao.Murmur.desktop /app/share/applications/com.doubao.Murmur.desktop - install -D flatpak/com.doubao.Murmur.metainfo.xml /app/share/metainfo/com.doubao.Murmur.metainfo.xml - install -D flatpak/com.doubao.Murmur.svg /app/share/icons/hicolor/scalable/apps/com.doubao.Murmur.svg sources: - type: dir path: ..