hoodie / notify-rust

☝️send desktop notifications from your Rust app.
Apache License 2.0
1.15k stars 74 forks source link

Notifications through flatpak do not work #205

Closed toastxc closed 7 months ago

toastxc commented 7 months ago

Hi, After installing various dependancies for Ubuntu notifications started to work (yay), although weirdly they did not come through the default GNOME interface, but that is an issue for another time.

The issue I have is that despite enabling every permission possible on flatseal (Dbus and all) notifications simply don't work. org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown NOTE: it is possible that this issue is a user error, as there may be more steps needed for flatpak.

Steps to reproduce

# clone the repository
git clone https://github.com/toastxc/kuma-rs.git
# cargo-pak manages flatpaks for rust apps, its safe dw
cargo install cargo-pak
cd kuma-rs/
# this uses cargo-pak
sh install.sh
flatpak run xyz.toastxc.Kuma
hoodie commented 7 months ago

That is a fascinating problem. I haven't experimented with that yet. I presume that flatpacks need to be configured in a certain way in order to have permission to talk to dbus.

Maybe you find something useful here: https://docs.flatpak.org/en/latest/sandbox-permissions.html#d-bus-access

toastxc commented 7 months ago

huh... enabling this in flatseal does not fix the issue, it only works from fixing the flatpak manifest which is odd.

Problem solved

app_id="xyz.toastxc.Kuma"
app_name="Kuma"
profile="release"
bin="gui"
permissions = [
    # network
    "--share=network",
    # display
    "--socket=x11",
    "--socket=wayland",
    "socket=fallback-x11",
    # OpenGL
    "--device=dri",
    # notifications
    "--socket=session-bus",
]

[desktopfile]
terminal= false
toastxc commented 7 months ago

I can confirm that your library works with the freedesktop runtime version 23.08 for flatpak, which is awesome :3