Describe the bug
Quick Add Shortcut "CTRL + TAB" should trigger Quick Add to add a item in the inbox. The flatpak variant does not trigger this Quick Add app.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Quick Add application starts
Desktop (please complete the following information):
I've installed Planner 2.2.8 on Fedora 32 using ninja install. Quick-add works without any problem.
Command com.github.alainm23.planner-quick-add launches a quick add window. I can define shortcut directly in the application or in gnome settings -> keyboard shortcuts.
However, this command does not work in flatpak version. Executing flatpak run com.github.alainm23.planner-quick-add
returns:
error: app/com.github.alainm23.planner-quick-add/x86_64/master not installed
I wonder if quick-add shouldn't be installed as a separate flatpak application?
I think it's most likely. I still have some technical issues to solve, for example: my flatpak installation doesn't recognize me "org.gnome.settings-daemon.plugins.media-keys, I'm not sure how to fix this.
I've also noticed a warning about media keys.
I can confirm that "quick add" works when installed as a separate flatpak application. I didn't build it. I just manually created flatpak app based on original Planner filer. Modified metadata, removed the unnecessary files and created sym link to Planner database and config. flatpak run com.github.alainm23.planner-quick-add executes the application and allows to add new task under a specified project. The problem is when the main application is running in background you won't see newly created tasks on the main Planner window. Only the task counter refreshes. To see tasks added by "quick add" you have to kill background process of main Planner app and run it again. I understand that this is because, as a flatpak, these are separate applications and "quick-add" will not refresh the list of another application. The solution would be to refresh the task list every time the application window is activated.
In the AppCenter version I am using a dbus server to connect the two applications and thus update each time a task is created from QuickAdd.
Do you think that if we reference this dbus server in the flatpak installation file, the two applications can be connected?
@roypen Could you tell me how you did this? I'd be very grateful to you.
@roypen Could you tell me how you did this? I'd be very grateful to you.
I don't know yet but I will try to figure it out.
I built a flatpak quick-add application based on the original manifest file. In manifest changed every line containing com.github.alainm23.planner to com.github.alainm23.planner-quick-add.
In "finish-args" section: I modified --metadata=X-DConf path and added
"--talk-name=com.github.alainm23.planner" to allow qick-add to commnicate with the main app.
The code probably contains many unnecessary things for quick-add flatpak app but I didn't focus on it.
Now it seems that quick-add works as it should. Task list refreshes each time I add task in quick-add.
There are two problems:
~/.var/app/com.github.alainm23.planner-quick-add to ~/.var/app/com.github.alainm23.planner. The apps will share the same .db, config etc.. You can also symlink only database folder or a file to avoid quick-add running in the background. Unfortunately, this solution caused some issues in displaying project names in quick-add window so I made a symlink to the whole folder.flatpak run com.github.alainm23.planner-quick-add. I defined the application shortcut in Gnome Settings and it works.com.github.alainm23.planner-quick-add.txt
I was not able to upload json file so I changed the extension.
Thank you very much, everything works very well, the only thing that worries me is the symbolic links. One solution could be to use our DBus server to get the database information and some dconf settings, but for this to work Planner would have to be running all the time.
I think most users allow Planner to run in background.
Haven't you consider adding a button in Planner settings (only for the Flathub version) that would install quick-add? It could first create a symlink and then install a quick-add application. I know that this is probably not very optimal/elegant solution. And what if the user wants to install "guick-add" by himself from command line? Quick-add should not be available to the public then(e.g. on the flathub site).
It's just my thoughts but maybe you will find them useful. :)
As another workaround the following command seems to open the quick-add window:
flatpak run --command=com.github.alainm23.planner-quick-add --own-name=com.github.alainm23.planner-quick-add com.github.alainm23.planner
@nils-asmussen Thank you very much, that's an incredible solution.
Now, the only problem is how to assign a keyboard shortcut from Flatpak. @bilelmoussaoui maybe you can help us please.
@nils-asmussen Thank you very much, that's an incredible solution.
Now, the only problem is how to assign a keyboard shortcut from Flatpak. @bilelmoussaoui maybe you can help us please.
Flatpak expects that all the exported files or services (this case DBus) should be prefixed by the app-id. Renaming the Quick Add ID to use something like com.github.alainm23.planner.quick-add should fix it as you do own that.
@bilelmoussaoui thank you very much for your time, I have changed the app-id of Quick Add but when I run Planner I have an error with my service that configures the keyboard shortcuts.
** (com.github.alainm23.planner:2): WARNING **: 15:54:36.510: CustomShortcutSettings.vala:28: Schema "org.gnome.settings-daemon.plugins.media-keys" is not installed on your system.
This service does all the work:
https://github.com/alainm23/planner/blob/master/src/Services/CustomShortcutSettings.vala
It's normal that you cant access the scheme of org.gnome.settings-daemon.plugins.media-key as it's not available inside the sandbox. If you want to be able to modify system's settings, you need to open a hole in your sandbox for dconf access which should fix the issue for now.
@bilelmoussaoui Thank you very much for your time, I will continue investigating.
@alainm23 Would you mind to try if you can set the keyboard shortcut if you start planner with the following command?
flatpak run --talk-name=org.gnome.settings-daemon.plugins.media-keys com.github.alainm23.planner
On the system I am currently using, the dbus namespace seems to have a different name, org.gnome.SettingsDaemon.MediaKeys. This unfortunately prevents me from trying it myself.
@nils-asmussen I am getting the same warning.
You need to add dconf access https://docs.flatpak.org/en/latest/sandbox-permissions.html#dconf-access
@bilelmoussaoui Thank you very much, I have changed the permissions of my application to:
"--filesystem=xdg-run/dconf",
"--filesystem=~/.config/dconf:ro",
"--talk-name=ca.desrt.dconf",
"--env=DCONF_USER_CONFIG_DIR=.config/dconf"
I have noticed that I can now access the system's dconf settings but I still don't have access to
org.gnome.settings-daemon.plugins.media-keys
Do you think it is necessary to add one more permit?
@bilelmoussaoui Thank you very much, I have changed the permissions of my application to:
"--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro", "--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf"I have noticed that I can now access the system's dconf settings but I still don't have access to
org.gnome.settings-daemon.plugins.media-keysDo you think it is necessary to add one more permit?
I'm not sure what you mean by "you don't have access", access to modifying the scheme?
I'm not sure what you mean by "you don't have access", access to modifying the scheme?
Yes I am getting the same error,
** (com.github.alainm23.planner:2): WARNING **: 15:54:36.510: CustomShortcutSettings.vala:28: Schema "org.gnome.settings-daemon.plugins.media-keys" is not installed on your system.
@alainm23 Thank you for testing the flatpak option and for your work on this amazing program!
On my "main" system the gsettings schema org.gnome.settings-daemon.plugins.media-keys exists as a file in the folder /usr/share/glib-2.0/schemas. The files does not appear in the flatpak environment (flatpak run --command=sh ...).
Could that be related to the reason why
gsettings list-schemas | grep gnome.s
does not list the settings daemon, and ultimately the media keys do not work?
(Just a guess, as there are lots of things for me to learn about dbus and gsettings...)
I can now confirm that the schema needs to be installed in /usr/share/glib-2.0/schemas.
The conclusions section of this post summarizes what I think needs to be done to resolve this issue.
As a dirty hack to check if it works, I copied the glib-2.0 folder to my home folder and started the flatpak with access to the copy,
cp -r /usr/share/glib-2.0 ~
flatpak run --command=sh --filesystem=~/glib-2.0 com.github.alainm23.planner
Now, in the shell inside flatpak, I make the schemas in ~/glib-2.0 available to glib/gsettings, by adding the home directory to XDG_DATA_DIRS,
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME"
and I can actually see the schema org.gnome.settings-daemon.plugins.media-keys in gsettings:
gsettings list-schemas | grep org.gnome.settings-daemon
If I start com.github.alainm23.planner, I can see in the system settings that a custom keyboard shortcut has been added for com.github.alainm23.planner.quick-add (closing and reopening the settings might be necessary for the changes to appear).
Note: The keyboard shortcut runs the command com.github.alainm23.planner.quick-add, which does not exist if planner is installed via flatpak. Therefore simply pressing the keys still does not open the quick-add dialog, even though the media key has been successfully added.
flatpak run --command=com.github.alainm23.planner.quick-add com.github.alainm23.planner
org.gnome.settings-daemon.plugins.media-keys needs to be installed inside the flatpak. Note: The gnome-settings-daemon sources (https://github.com/GNOME/gnome-settings-daemon) contain the schemas in the data folder. Maybe installing that package inside the flatpak helps?I've been following this for awhile. I love this program, but not having the quick-add feature in the flatpak was problematic. I don't know if it helps, but I have added (from the comment above)
flatpak run --command=com.github.alainm23.planner.quick-add com.github.alainm23.planner
to my keyboard shortcuts on Pop!_OS, and the quick add is working perfectly. It's not the most elegant solution, but I've been using it for a few days without any problems.
Thank you for a wonderful program.
Thank you all very much to everyone to help.
Researching the problem I think Flatpak does not support configuring keyboard shortcuts yet. For this reason and as AppCenter will start using flatpak the only option is to configure keyboard shortcuts manually.
I will make some changes in the Quick Add preferences indicating the steps to configure the keyboard shortcuts in the system 😔️.
Thank you all very much to everyone to help.
Researching the problem I think Flatpak does not support configuring keyboard shortcuts yet. For this reason and as AppCenter will start usingflatpakthe only option is to configure keyboard shortcuts manually.I will make some changes in the Quick Add preferences indicating the steps to configure the keyboard shortcuts in the system pensive.
I just looked at the issue again, and indeed. Flatpak limits the access to the system by default to avoid malicious applications doing random things on the system. I don't think there will be a way to do this automatically like apps used to do so, the best way to handle this would be a portal that allows an app to set a specific shortcut. Shipping the packages that ships the schema doesn't make sense as you will be able to change the setting, inside the sandbox and won't matter for your system at all.
My previous post seems to have been missed. There I describe how one can make this feature work.
Maybe not the cleanest, but the simplest way is to add the following to the manifest (I added it as last module before planner):
{
"name": "media-keys",
"buildsystem": "simple",
"build-commands": [
"install -D data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in /app/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.media-keys.gschema.xml",
"sed -i -e 's/@GETTEXT_PACKAGE@/gnome-settings-daemon/g' /app/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.media-keys.gschema.xml"
],
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/GNOME/gnome-settings-daemon/archive/GNOME_SETTINGS_DAEMON_3_36_1.tar.gz",
"sha256" : "e345411f79b4a1175349e144cc772c7a9eb7ab9ae3a542a73609bee471b72748"
}
]
},
@nils-asmussen I can confirm that the keyboard shortcut settings work on flatpak and elementary OS. I will still do some tests on other distributions.
I confirm Quick Add works on Pop! _OS 19.10 🎉️🎉️🎉️

@alainm23 Is the black bar part of the window decoration? The input field also looks a bit cut off.
Flatpak limits the access to the system by default to avoid malicious applications doing random things on the system.
@bilelmoussaoui So are there currently any security concerns about including Quick Add in a flatpak?
@alainm23 Is the black bar part of the window decoration? The input field also looks a bit cut off.
Flatpak limits the access to the system by default to avoid malicious applications doing random things on the system.
@bilelmoussaoui So are there currently any security concerns about including Quick Add in a flatpak?
I'm no security expert, but Flatpak isn't designed for hackish solutions as this. Apps used to do whatever they wanted at host level and they really shouldn't.
It's a a hackish solution for now, but shouldn't be taken as "the solution".
It's a a hackish solution for now, but shouldn't be taken as "the solution".
@alainm23 Perhaps the code can be annotated to reflect this?
Most helpful comment
Thank you all very much to everyone to help.
Researching the problem I think Flatpak does not support configuring keyboard shortcuts yet. For this reason and as AppCenter will start using
flatpakthe only option is to configure keyboard shortcuts manually.I will make some changes in the Quick Add preferences indicating the steps to configure the keyboard shortcuts in the system 😔️.