Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid redundancies in the app menu caused by synchronized flatpak apps #5076

Open
nastaziya opened this issue Jun 4, 2019 · 8 comments
Open
Labels
C: core P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.

Comments

@nastaziya
Copy link

The problem you're addressing (if any)

I'm currently working on a post install script(such as the dnf hook) that would synchronize the app menu with newly installed flatpak apps and eventually mention the app source "(Flatpak)" in the app name, whenever a Flatpak app is added.

However, having the same app installed twice, either through flatpak only (per-user and system-wide) or with flatpak and from any other source, can cause apps to be redundant in the app menu after synchronization. It would be better to avoid this confusion by specifying the app source.

Describe the solution you'd like

One solution would be to append "(Flatpak)" to the app name in desktop files every time a flatpak app is installed. Eventually, I admit that appending (Flatpak user)/(Flatpak system) is a foolproof solution to distinguish all apps having the same name.

Where is the value to a user, and who might that user be?
Better end-user experience.

Describe alternatives you've considered

Appending « Flatpak sys/user » only if there is the same application from any other source already installed.

However, it’s a solution that would involve a template based app vm to be supervised while being in the TemplateVm, giving to this one the awareness of all newly installed apps and vice versa.
Only this way, the post install script could add/remove “Flatpak” specification to/from the concerned app name. But, as long as this alternative requires an eventual Vm's interaction, almost unacceptable in Qubes OS, i'd rather be against.

@nastaziya nastaziya added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. labels Jun 4, 2019
@marmarek
Copy link
Member

marmarek commented Jun 4, 2019

I think the place for such processing is in qubes.GetAppmenus script. Right now the desktop file processing is an awk script looking at one desktop file at the time only, but it's ok to make it more elaborate, including changing awk to something else and check whether there are duplicates at this level.

On the other hand, I think there should be only one instance of given application in the final menu, even if multiple instances are available (VM settings - applications tab). This means it's more important to distinguish applications in that settings window than in the final menu. This allows to use also other fields of desktop file (comment, genericname etc) and perhaps adding them as a tooltip to the application selection dialog (which is a good idea anyway).

Please also remember that .desktop files needs to be unique, even if they are in different directories. If you have same named desktop file in different directories, it will be visible as one (AFAIR the one listed later by qubes.GetAppmenus prevails). I think this is ok, as long as it is really the same application - which is the case for system and user installed flatpak.

@fepitre
Copy link
Member

fepitre commented Jun 4, 2019

@marmarta : do you think that would something you could parse easily? For example, we think about adding (Flatpak/System) or (Flatpak/User) at the end of the Comment field. Else, there is a possibility of using Keywords field.

@marmarta
Copy link
Member

marmarta commented Jun 4, 2019

Sounds fine; I think I'm just going to add to qvm-appmenus an option to list selected fields from the .desktop files, and then show as tooltip the contents of the Comment field.

@marmarta marmarta self-assigned this Jun 4, 2019
@marmarek
Copy link
Member

marmarek commented Jun 4, 2019

For the record: here is specification of the file format, with list of available fields: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys

@andrewdavidwong andrewdavidwong added this to the Release 4.1 milestone Jun 5, 2019
marmarta added a commit to marmarta/qubes-desktop-linux-common that referenced this issue Jun 5, 2019
Adding the optional --file-field parameter. It changes to output format
to '|'-separated one, and outputs not only file name and app name, but
also whatever fields from the file the user has requested. Used by
GUI VM settings.

references QubesOS/qubes-issues#5076
marmarta added a commit to marmarta/qubes-manager that referenced this issue Jun 5, 2019
The 'Comment' field will not be displayed as a tooltip in VM settings.
Requires QubesOS/qubes-desktop-linux-common#12

references QubesOS/qubes-issues#5076
marmarta added a commit to marmarta/qubes-manager that referenced this issue Jun 5, 2019
The 'Comment' field will now be displayed as a tooltip in VM settings.
Requires QubesOS/qubes-desktop-linux-common#12

references QubesOS/qubes-issues#5076
@marmarta
Copy link
Member

marmarta commented Jun 5, 2019

Okay, I added it (pull requests pending ofc); I think just adding it to the 'Comment' field and displaying that in Settings is best - I think it's important mostly in the Settings, once the user sets their Apps like they want it doesn't matter where are they from.

marmarta added a commit to marmarta/qubes-desktop-linux-common that referenced this issue Jun 5, 2019
Adding the optional --file-field parameter. It changes to output format
to '|'-separated one, and outputs not only file name and app name, but
also whatever fields from the file the user has requested. Used by
GUI VM settings.

references QubesOS/qubes-issues#5076
marmarta added a commit to marmarta/qubes-desktop-linux-common that referenced this issue Jun 7, 2019
Adding the optional --file-field parameter. It changes to output format
to '|'-separated one, and outputs not only file name and app name, but
also whatever fields from the file the user has requested. Used by
GUI VM settings.

references QubesOS/qubes-issues#5076
marmarta added a commit to marmarta/qubes-desktop-linux-common that referenced this issue Jun 10, 2019
Adding the optional --file-field parameter. It changes to output format
to '|'-separated one, and outputs not only file name and app name, but
also whatever fields from the file the user has requested. Used by
GUI VM settings.

references QubesOS/qubes-issues#5076
marmarta added a commit to marmarta/qubes-manager that referenced this issue Jun 10, 2019
The 'Comment' field will now be displayed as a tooltip in VM settings.
Requires QubesOS/qubes-desktop-linux-common#12

references QubesOS/qubes-issues#5076
marmarta added a commit to marmarta/qubes-desktop-linux-common that referenced this issue Jun 17, 2019
Adding the optional --file-field parameter. It changes to output format
to '|'-separated one, and outputs not only file name and app name, but
also whatever fields from the file the user has requested. Used by
GUI VM settings.

references QubesOS/qubes-issues#5076
@nastaziya
Copy link
Author

@marmarta Thanks for working on this issue.
At this point, my flatpak sync service works well, except after a dnf update/install/remove that refreshes the app menu excluding flatpak apps.
It seeams to happen because of the XDG_DATA_DIRS that has None value in the dnf hook and takes default "/usr/local/share:/usr/share" in the qubes.GetAppmenus script, omitting flatpak paths.
So @marmarek , @fepitre , @marmarta , i wonder if there is an appropriate way to add flatpak paths to XDG_DATA_DIRS and change this behavior?

@marmarek
Copy link
Member

marmarek commented Jun 20, 2019

One idea would be to source /etc/profile.d/qubes-session.sh in qubes.GetAppmenus, which will include environment from user session. Loading relevant flatpak file from /etc/profile.d or even the whole /etc/profile may not be enough, as it could look for "user" flatpaks of root, not user.

@nastaziya
Copy link
Author

@marmarek @fepitre
Actually, my service is designed to monitor and sync from system flatpak path in TemplateVm and user path in AppVm. So, the best case scenario is to sync apps in TemplateVm only from sys path /var/lib/flatpak . Sourcing /etc/profile.d/qubes-session.sh would be a good idea, but causes user flatpak apps sync in TemplateVM, if somehow there's an app installed in user path(action to be avoided). In consequence, the AppVm appmenu will be populated with "ghost" icons.
For the moment, i think, we can source /etc/profile.d/qubes-session.sh and explain how flatpak is supposed to be used in the "flatpak-helper" package readme.

marmarek added a commit to marmarek/qubes-desktop-linux-common that referenced this issue Aug 28, 2019
Not every line is an assignment, skip lines not containing '='. Also,
skip non-main sections (although the current generator accepts only
main section anyway).

QubesOS/qubes-issues#5076
@andrewdavidwong andrewdavidwong removed this from the Release 4.2 milestone Aug 13, 2023
@marmarta marmarta removed their assignment Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: core P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.
Projects
None yet
Development

No branches or pull requests

5 participants