I have a snap that, I want to run in background, I am using the daemon
option, but now the desktop file is not working. Also, that app has an option to enable pipewire
, that’s also not working, can anyone please help me?
snapcraft.yaml
name: g4music # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '1.8.2' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
compression: lzo
slots:
g4music:
interface: dbus
bus: session
name: com.github.neithern.g4music
parts:
g4music:
# See 'snapcraft plugins'
plugin: meson
source: https://gitlab.gnome.org/neithern/g4music.git
source-tag: v${SNAPCRAFT_PROJECT_VERSION}
meson-parameters:
- --prefix=/usr
build-packages:
- gettext
- libgstreamer1.0-dev
- libgstreamer-plugins-base1.0-dev
- libpipewire-0.3-dev
stage-packages:
- gstreamer1.0-plugins-base
- gstreamer1.0-plugins-good
- libgstreamer1.0-0
- libgstreamer-plugins-base1.0-0
- pipewire
build-environment:
- LDFLAGS: "-Wl,--copy-dt-needed-entries"
override-prime: |
craftctl default
sed -e 's|Icon=com.github.neithern.g4music|Icon=/usr/share/icons/hicolor/scalable/apps/com.github.neithern.g4music.svg|' -i usr/share/applications/com.github.neithern.g4music.desktop
sed -e 's|Exec=g4music %U|Exec=snap run g4music|' -i usr/share/applications/com.github.neithern.g4music.desktop
# This part removes all the files in this snap which already exist in
# connected content and base snaps. Since these files will be available
# at runtime from the content and base snaps, they do not need to be
# included in this snap itself.
#
# More info: https://forum.snapcraft.io/t/reducing-the-size-of-desktop-snaps/17280#heading--cleanup-part
#
cleanup:
after: # Make this part run last; list all your other parts here
- g4music
plugin: nil
build-snaps: # List all content-snaps and base snaps you're using here
- gnome-42-2204
- gnome-42-2204-sdk
- core22
override-prime: |
set -eux
for snap in "gnome-42-2204" "gnome-42-2204-sdk" "core22"; do
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
done
find $CRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete
apps:
g4music:
extensions: [gnome]
command: usr/bin/g4music
daemon: simple
desktop: usr/share/applications/com.github.neithern.g4music.desktop
common-id: com.github.neithern.g4music
environment:
GTK_USE_PORTAL: 1
PIPEWIRE_CONFIG_NAME: $SNAP/usr/share/pipewire/pipewire.conf
PIPEWIRE_MODULE_DIR: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pipewire-0.3
HOME: "$SNAP_USER_COMMON"
slots:
- mpris
plugs:
- home
- audio-playback
- removable-media
- mount-observe
Please help…