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

Ubuntu gnome desktop file name #1019

Closed
bios-ben opened this issue Sep 10, 2018 · 97 comments
Closed

Ubuntu gnome desktop file name #1019

bios-ben opened this issue Sep 10, 2018 · 97 comments

Comments

@bios-ben
Copy link

@bios-ben bios-ben commented Sep 10, 2018

Expected behaviour

Add to favorites button works in ubuntu 18.

Actual behaviour

Add to favorites missing.

Steps to reproduce

Open app and right click in dock to see missing menu, try renaming solution and now it shows.

Version 18.09.01

After reading stack exchange I found that desktop links cannot be added to favorites unless their file name matches the window name. Checking into this it seems the file is named PBE.QOwnNotes.desktop and when renamed to QOwnNotes.desktop the problem is fixed, as per the above link. However, I did find #933 that caused this rename to happen in the first place. Is it possible to get the default desktop link named properly to work in ubuntu?

@pbek
Copy link
Owner

@pbek pbek commented Sep 10, 2018

You have researched the problem pretty well. Unfortunately I have no secret information on how to make it work in both conditions, please let me know if you find anything out!

@PaulVanSchayck
Copy link

@PaulVanSchayck PaulVanSchayck commented Oct 17, 2018

I also ran into this, and can confirm this temporary workaround:

sudo mv /usr/share/applications/PBE.QOwnNotes.desktop /usr/share/applications/QOwnNotes.desktop
@pbek
Copy link
Owner

@pbek pbek commented Oct 17, 2018

That was the previous name, see #933.
I will try adding StartupWMClass=QOwnNotes to the desktop file in the next release. Can you please try using the PBE.QOwnNotes.desktop and adding above line to it and report if that works.

@PaulVanSchayck
Copy link

@PaulVanSchayck PaulVanSchayck commented Oct 17, 2018

Yup, this also seems to works! Thanks for that

@pbek
Copy link
Owner

@pbek pbek commented Oct 17, 2018

awesome!

@pbek pbek added this to the 18.10.3 milestone Oct 17, 2018
@pbek
Copy link
Owner

@pbek pbek commented Oct 18, 2018

18.10.3

  • fixed QOwnNotes favorite button in Gnome dash
pbek added a commit that referenced this issue Oct 18, 2018
@pbek
Copy link
Owner

@pbek pbek commented Oct 18, 2018

There now is a new release, could you please test it and report if it works for you?

@pbek pbek closed this Oct 24, 2018
@OtharSmirnow
Copy link

@OtharSmirnow OtharSmirnow commented Dec 20, 2019

On Ubuntu it does not work as expected.
obraz
I will update if any of workarounds above works

@pbek
Copy link
Owner

@pbek pbek commented Dec 20, 2019

On Ubuntu it does not work as expected.
obraz
I will update if any of workarounds above works

Where did you install QOwnNotes from? Can you please post the output from the debug settings (see issue template).

@OtharSmirnow
Copy link

@OtharSmirnow OtharSmirnow commented Dec 20, 2019

Installed snap from Ubuntu Software:
Channel: Stable
Version: 19.12.13
Last Update: 18.12.2019
Developer: Patrizio Bekerle

QOwnNotes.log

@pbek
Copy link
Owner

@pbek pbek commented Dec 20, 2019

I'm not sure how Gnome (or are you using Unity?) is handling desktop files from snaps. If you are using the stable channel this desktop file is used: https://github.com/pbek/QOwnNotes/blob/develop/snap/gui/PBE.QOwnNotes.desktop

@pbek
Copy link
Owner

@pbek pbek commented Dec 21, 2019

Could you test the Ubuntu PPA, AppImage or Flatpack of QOwnNotes if you have the same problem? see https://www.qownnotes.org/installation

@OtharSmirnow
Copy link

@OtharSmirnow OtharSmirnow commented Dec 23, 2019

I am running Ubuntu 19.10 with Gnome

Tested AppImage - same story.

I created a .desktop file with Arronax and it worked well(placed in /usr/share/applications), but I wasn't able to edit the one in snap.
[Desktop Entry]
Type=Application
Icon=folder-copy
Name=QOwnNotes-test
Exec=qownnotes
Terminal=false
Hidden=false
Categories=Office; Utility
StartupWMClass=QOwnNotes
Comment=test

may be unrelated:
when starting from terminal I got this
Warning: Qt: Session management error: None of the authentication protocols specified are supported ((null):0, (null)) Warning: propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.758\" (uid=1000 pid=12069 comm=\"/snap/qownnotes/4219/usr/bin/QOwnNotes -style=Fusi\" label=\"snap.qownnotes.qownnotes (enforce)\") interface=\"org.freedesktop.DBus.Properties\" member=\"GetAll\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=1372 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")" ((null):0, (null)) Warning: nmReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.758\" (uid=1000 pid=12069 comm=\"/snap/qownnotes/4219/usr/bin/QOwnNotes -style=Fusi\" label=\"snap.qownnotes.qownnotes (enforce)\") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=1372 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")" ((null):0, (null)) Warning: "Object path cannot be empty" ((null):0, (null)) Warning: Unable to find dictionary for "pl_PL" in path "/pl_PL" ((null):0, (null)) Info: "Serwer QOwnNotes oczekuje na połączenia na porcie 22222" ((null):0, (null))

@datumbox
Copy link

@datumbox datumbox commented Aug 29, 2020

Same problem on Gnome 3.36.3 while using the snap version (20.8.10). Could we reopen the ticket given that the problem persists?

@pbek
Copy link
Owner

@pbek pbek commented Aug 29, 2020

Doesn't make a lot difference as long nobody knows how to fix it. 😁

@datumbox
Copy link

@datumbox datumbox commented Aug 29, 2020

If there is anything I can do to help debug I'm more than happy to help. Let me know.

@pbek
Copy link
Owner

@pbek pbek commented Aug 30, 2020

The only thing that comes to mind is to play with the desktop file or research how the favorites in Gnome work and why it has troubles detecting the application correctly. I don't have this issue under KDE.

@pbek pbek closed this Aug 30, 2020
@pbek pbek reopened this Aug 30, 2020
@datumbox
Copy link

@datumbox datumbox commented Aug 31, 2020

Here is an ugly workaround. If you rename the file qownnotes_PBE.QOwnNotes.desktop to qownnotes_qownnotes.desktop it works fine. This is located in /var/lib/snapd/desktop/applications/ and also in your ~/.local/share/applications/ if you have custom shortcuts. No other desktop file needs to be modified.

The way I found this was by observing the naming convention of the desktop files of all of my snaps. Any snap with desktop file not named like {snapname}_{snapname}.desktop has exactly the same problem (excluding the ubuntu snap store which I don't understand why it works).

@pbek Is the naming you are using valid? If yes, looks like an upstream problem as you hinted originally.

@pbek
Copy link
Owner

@pbek pbek commented Aug 31, 2020

I guess snapcraft chose that name. The original file that is used is https://github.com/pbek/QOwnNotes/blob/develop/build-systems/snap/snapcraft/snap/gui/PBE.QOwnNotes.desktop

pbek added a commit that referenced this issue Sep 13, 2020
@pbek
Copy link
Owner

@pbek pbek commented Sep 13, 2020

Great, I now updated the Launchpad Snap config. We'll see at the next release. 😁

pbek added a commit that referenced this issue Sep 17, 2020
@pbek
Copy link
Owner

@pbek pbek commented Sep 17, 2020

20.9.6

  • fixed building snap stable release
@pbek
Copy link
Owner

@pbek pbek commented Sep 17, 2020

There now is a new release, could you please test it and report if it works for you?

@datumbox
Copy link

@datumbox datumbox commented Sep 17, 2020

@pbek Sorry for the delay. It seems that the duplicate desktop files problem is back but everything else works as expected. I really don't understand why this is happening as we tested together the latest/edge version and it fixed the duplicate desktop files issue.

$ sudo snap remove qownnotes  
qownnotes removed

$ ls -lh /var/lib/snapd/desktop/applications/*qown*
ls: cannot access '/var/lib/snapd/desktop/applications/*qown*': No such file or directory

$ sudo snap install qownnotes --jailmode
qownnotes 20.9.6 from Patrizio Bekerle (pbek) installed

$ ls -lh /var/lib/snapd/desktop/applications/*qown*
-rwxr-xr-x 1 root root 417 Sep 17 22:52 /var/lib/snapd/desktop/applications/qownnotes_PBE.QOwnNotes.desktop
-rwxr-xr-x 1 root root 413 Sep 17 22:52 /var/lib/snapd/desktop/applications/qownnotes_qownnotes.desktop

$ diff /var/lib/snapd/desktop/applications/qownnotes_PBE.QOwnNotes.desktop /var/lib/snapd/desktop/applications/qownnotes_qownnotes.desktop
5c5
< Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/qownnotes_PBE.QOwnNotes.desktop /snap/bin/qownnotes
---
> Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/qownnotes_qownnotes.desktop /snap/bin/qownnotes
@pbek
Copy link
Owner

@pbek pbek commented Sep 18, 2020

Thank you for the feedback. I don't understand it. The removal and build process are the same on snapcraft.io and launchpad. 😞

@datumbox
Copy link

@datumbox datumbox commented Sep 18, 2020

@pbek If you download the snap on stable (rev 7455) and check folder /meta/gui/ in the archive you will find 2 desktop files. On the other hand if you download the snap on edge (rev 7457) you will get one desktop file.

How do you deploy the snaps? Do you use travis or some other CI tool? Is there a chance that stable and edge have different configs on their releases?

@pbek
Copy link
Owner

@pbek pbek commented Sep 18, 2020

How do you deploy the snaps? Do you use travis or some other CI tool? Is there a chance that stable and edge have different configs on their releases?

#1019 (comment)

@datumbox
Copy link

@datumbox datumbox commented Sep 18, 2020

Maybe I see it.

Your deploy xml has a "cd src" command while the prod does not. Thus the file is not deleted on the latter case. Could you confirm?

@pbek
Copy link
Owner

@pbek pbek commented Sep 18, 2020

Your deploy xml has a "cd src" command while the prod does not.

That's because the prod uses the source archive, that is made from the src folder.

Thus the file is not deleted on the latter case.

If no file is deleted the build process breaks. I had that when there was the cd src in until I realized above.

@datumbox
Copy link

@datumbox datumbox commented Sep 18, 2020

I see, thanks for clarifying.

I'm running out of ideas... What we see could be explained by a silent failure of the rm command but if you are sure that when any command fails the build breaks then I'm not sure where to go next. :(

pbek added a commit that referenced this issue Sep 21, 2020
pbek added a commit that referenced this issue Sep 22, 2020
@pbek
Copy link
Owner

@pbek pbek commented Sep 22, 2020

20.9.9

  • added a snap build to the release

The 20.9.9 release on https://github.com/pbek/QOwnNotes/releases will have an amd64 snap built on GitHub (currently building on https://github.com/pbek/QOwnNotes/runs/1150478719?check_suite_focus=true). Could you please test that, maybe I'll manage to put it into the snap store automatically.

@datumbox
Copy link

@datumbox datumbox commented Sep 22, 2020

The 20.9.9 release on https://github.com/pbek/QOwnNotes/releases will have an amd64 snap built on GitHub.

Just to confirm you want me to download the snap from github and install it manually? If that's what you mean, I don't think this is possible without turning off the snap confinement which might return different results. Is it possible to upload it on snapstore?

Here it is: https://github.com/pbek/QOwnNotes/releases/download/v20.9.9/QOwnNotes-x86_64.AppImage

You meant to link to the snap version, not the Appimage right?

BTW I did check the contents of the snap and it seems that it does not have the 2 icons inside. So it should be OK from that perspective.

@pbek
Copy link
Owner

@pbek pbek commented Sep 22, 2020

Is it possible to upload it on snapstore?

To do that I need to invest some more hours. I will only attempt that if the snap works as desired.

You meant to link to the snap version, not the Appimage right?

sorry, my bad.

@datumbox
Copy link

@datumbox datumbox commented Sep 22, 2020

Gotcha. Is there any way you can manually put that in snapcraft? Just trying to see if there is a way to avoid turning off the confinement while not adding much overload to you.

@pbek
Copy link
Owner

@pbek pbek commented Sep 22, 2020

sudo snap install --dangerous QOwnNotes-amd64.snap

@datumbox
Copy link

@datumbox datumbox commented Sep 22, 2020

@pbek lol. yeah that's what I wanted to avoid :P

Tested and it works like a charm. Only 1 desktop file, the favourites work fine etc. :)

@pbek
Copy link
Owner

@pbek pbek commented Sep 22, 2020

@pbek lol. yeah that's what I wanted to avoid :P

to my knowledge the confinement is still in place since it isn't a "--classic" snap
the snap is just not coming from the store

Tested and it works like a charm. Only 1 desktop file, the favourites work fine etc. :)

sounds great, thank you for testing!

pbek added a commit that referenced this issue Sep 23, 2020
@pbek
Copy link
Owner

@pbek pbek commented Sep 23, 2020

20.9.10

  • the AMD64 stable release snap of QOwnNotes will now be built by GitHub Actions to prevent
    two desktop files being deployed with the snap
    • the other architectures will still be built by Ubuntu Launchpad
@pbek
Copy link
Owner

@pbek pbek commented Sep 23, 2020

There now is a new stable release building, could you please test it and report if it works for you?

@pbek
Copy link
Owner

@pbek pbek commented Sep 24, 2020

The new stable snap is already in the store. 😉

@datumbox
Copy link

@datumbox datumbox commented Sep 24, 2020

@pbek Sorry man, it's a very busy week. I just tested it. Everything works exactly as you expect: the favourites, the number of desktop files, the program, etc. I think it's time to close this epic saga ticket :) Good job and thank you!

@pbek
Copy link
Owner

@pbek pbek commented Sep 25, 2020

Awesome! Thank you for your patience! 😅 We really should have made a different issue for this. But now I'll try to forget how much time was put into it. 😆

@pbek pbek closed this Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants