[Bug]: Bottle's can't create a desktop entry if the XDG applications directory does not exist.
Describe the bug
I am using Bottles from flathub on a relatively new system. I do not yet have a ~/.local/share/applications directory. When I attempt "Add Desktop Entry" Bottles opens up a browser showing https://docs.usebottles.com/bottles/programs#flatpak, which tells me to run this command:
flatpak override com.usebottles.bottles --user --filesystem=xdg-data/applications
After doing so, and quitting Bottles and restarting Bottles, the cycle repeats. This seems related to the following:
Bottles cannot automatically create that path as the check is based on the path existence
Originally posted by @mirkobrombin in https://github.com/bottlesdevs/Bottles/issues/1468#issuecomment-1127839616
However, there is an easy fix! If I change the permission to xdg-data/applications:create instead, Bottles can, and does, create the directory if it does not exist. Suggested fix is to update https://docs.usebottles.com/bottles/programs#flatpak to suggest this command:
flatpak override com.usebottles.bottles --user --filesystem=xdg-data/applications:create
The :create suffix is described at https://docs.flatpak.org/en/latest/sandbox-permissions-reference.html
To Reproduce
In a shell, run:
APP="${XDG_DATA_HOME:-$HOME/.local/share}"/applications
mv "${APP}" "${APP}".old
- Run bottles and try to create a desktop entry for something.
Expected: it works Actual: Bottles brings up https://docs.usebottles.com/bottles/programs#flatpak
When done: mv "${APP}".old "${APP}"
Package
Flatpak from Flathub
Distribution
Fedora 36
Troubleshooting Logs
Sorry, choosing "Troubleshooting" pops up a browser and takes me to https://docs.usebottles.com/flatpak/black-screen-or-silent-crash. I don't have any "Debugging Information."
Display Protocol
Wayland
Display Backend used by Bottles
I don't know
Additional context
No response
We could give the permission by default in the manifest: xdg-data/applications/Bottles:create, then make Bottles create the shortcuts there.
:create may not be necessary: https://github.com/flathub/flatpak-builder-lint/issues/110
+1 is usually not helpful but I spent quite some time figuring out why it couldn't create the entry. adding :create was enough for me. I'm not sure if I understand the linked issue though.
I have not used bottles often, initially the suggested command just worked, but I did a more limited install of arch/plasma and I needed the create permission.
We could give the permission by default in the manifest:
xdg-data/applications/Bottles:create, then make Bottles create the shortcuts there.
just worked, Thank you so much :)