Qownnotes: [I] Error when adding application (snap) to "favourites" on Ubuntu 20.04.

Created on 27 Apr 2020  Â·  23Comments  Â·  Source: pbek/QOwnNotes

_Apologies if the below is difficult to follow, I can provide a screengrab if easier._

Expected behaviour

It is possible to add QOwnNotes to your "favourites" (pinned to the default left hand side launcher in Ubuntu 20.04) however when you use this favourite to launch the application a second QOwnNotes appears at the bottom as if it was an un-favourited/unpinned application. Right clicking on this icon does not give the option of adding to your favourites.

Actual behaviour

QOwnNotes is added as a favourite and when clicked displays an orange marker beside that icon to indicate it is running. It does not generate a new icon a the bottom of the launcher.

Steps to reproduce

  1. Run Ubuntu 20.04.
  2. Install QOwnNotes as a snap.
  3. Right click the QOwnNotes icon under "Show Applications" and click "Add to favourites."
  4. Left click the QOwnNotes icon now visible in the left hand side application launcher.
  5. QOwnNotes launches and a second QOwnNotes logo is visible at the bottom of the application launcher with an orange "running" indicator. The original "favourited" icon remains above without the orange "running" indicator.

Relevant log output in the Log panel

Expand


Information about the application, settings and environment

Expand

QOwnNotes Debug Information

General Info

Current Date: Mon. Apr. 27 14:15:51 2020
Version: 20.4.16
Build date: Apr 26 2020
Build number: 705
Platform: linux
Operating System: Ubuntu Core 18
Build architecture: x86_64
Current architecture: x86_64
Release: Snapcraft
Qt Version (build): 5.9.5
Qt Version (runtime): 5.9.5
Portable mode: no
Settings path / key: /home/username/snap/qownnotes/5803/.config/PBE/QOwnNotes.conf
Application database path: /home/username/snap/qownnotes/5803/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite
Application arguments: /snap/qownnotes/5803/usr/bin/QOwnNotes, -style=Breeze, --snap
Qt Debug: 0
Locale (system): en_AU
Locale (interface): empty
Primary screen resolution: 1920x1080
Icon theme: Yaru
Notes in current note folder: 51
Calendar items: 0
Enabled scripts: 0

Server Info

serverUrl: empty
appIsValid: no
notesPathExists: empty
connectionErrorMessage: empty

Spellchecking

Enabled: false
Selected language: empty
Language codes: empty
Language names: empty
Application dictionaries path: /home/username/snap/qownnotes/5803/.local/share/PBE/QOwnNotes/dicts

Note folders

currentNoteFolderId: 1

Note folder default

id: 1
isCurrent: yes
activeTagId: 0
localPath: /home/username/Sync/1. General/Notes
remotePath: Notes
cloudConnectionId: 1
isShowSubfolders: yes
isUseGit: no
activeNoteSubFolder name: Books
database file: /home/username/Sync/1. General/Notes/notes.sqlite

Cloud connections

Cloud connection Default

id: 1
isCurrent: yes
serverUrl: empty
username: empty

Enabled scripts

Settings

ActiveNoteHistoryItem (NoteHistoryItem): <binary data>
DistractionFreeMode/isEnabled (QString): false
DistractionFreeMode/menuBarGeometry (QByteArray): <binary data>
DistractionFreeMode/menuBarHeight (QString): 29
DistractionFreeMode/menuBarVisible (QString): true
DistractionFreeMode/windowState (QByteArray): <binary data>
Editor/CurrentSchemaKey (QString): EditorColorSchema-6033d61b-cb96-46d5-a3a8-20d5172017eb
IssueAssistantDialog/geometry (QByteArray): <binary data>
LastUpdateCheck (QDateTime): 2020-04-27T14:01:54
LogWidget/criticalLog (bool): true
LogWidget/debugLog (bool): true
LogWidget/fatalLog (bool): true
LogWidget/infoLog (bool): true
LogWidget/scriptingLog (bool): true
LogWidget/statusLog (bool): true
LogWidget/warningLog (bool): true
MainWindow/geometry (QByteArray): <binary data>
MainWindow/mainToolBar.iconSize (QString): 22
MainWindow/menuBarGeometry (QByteArray): <binary data>
MainWindow/noteSubFolderTreeWidgetExpandState-1 (QStringList): Notations
MainWindow/noteTextEdit.code.font (QString): monospace,11,-1,2,50,0,0,0,0,0
MainWindow/noteTextEdit.font (QString): Ubuntu,11,-1,5,50,0,0,0,0,0
MainWindow/noteTextView.font (QString): Ubuntu,11,-1,5,50,0,0,0,0,0
MainWindow/showNotesFromAllNoteSubFolders (bool): false
NoteHistory-1 (QVariantList): <variant list with 10 item(s)>
NoteHistoryCurrentIndex-1 (QString): 9
PiwikClientId (QString): <hidden>
WelcomeDialog/geometry (QByteArray): <binary data>
allowNoteEditing (bool): true
allowOnlyOneAppInstance (QString): true
appMetrics/notificationShown (QString): true
checkSpelling (bool): false
cryptoKey (QString): <hidden>
currentNoteFolderId (QString): 1
currentWorkspace (QString): initial
disableAutomaticUpdateDialog (QString): true
dockWasInitializedOnce (QString): true
guiFirstRunInit (bool): true
initialLayoutIdentifier (QString): minimal
itemHeight (QString): 23
markdownHighlightingEnabled (QString): true
noteEditIsCentralWidget (QString): true
notesPath (QString): /home/username/Sync/1. General/Notes
ownCloud/supportEnabled (QString): false
savedSearches/noteFolder-1 (QString): Note 2020-04-26T16.45.35
showMenuBar (bool): true
showStatusBar (bool): true
workspace-initial/name (QString): Minimal
workspace-initial/noteSubFolderDockWidgetVisible (QString): true
workspace-initial/windowState (QByteArray): <binary data>
workspaces (QString): initial

System environment

CLUTTER_IM_MODULE: ibus
__EGL_VENDOR_LIBRARY_DIRS: /var/lib/snapd/lib/glvnd/egl_vendor.d
LIBGL_DRIVERS_PATH: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/dri
LD_LIBRARY_PATH: /var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void:/snap/qownnotes/5803/lib/x86_64-linux-gnu:/snap/qownnotes/5803/usr/lib/x86_64-linux-gnu::/snap/qownnotes/5803/lib:/snap/qownnotes/5803/usr/lib:/snap/qownnotes/5803/lib/x86_64-linux-gnu:/snap/qownnotes/5803/usr/lib/x86_64-linux-gnu:/snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/dri:/var/lib/snapd/lib/gl
FONTCONFIG_PATH: /snap/qownnotes/5803/etc/fonts
XDG_CONFIG_HOME: /home/username/snap/qownnotes/5803/.config
LIBVA_DRIVERS_PATH: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/dri
QTWEBENGINEPROCESS_PATH: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess
XDG_MENU_PREFIX: gnome-
PULSE_SERVER: unix:/run/user/1000/snap.qownnotes/../pulse/native
GST_PLUGIN_SYSTEM_PATH: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/gstreamer-1.0
SNAP_USER_DATA: /home/username/snap/qownnotes/5803
LANG: en_AU.UTF-8
QT_PRINTER_MODULE: qtubuntu-print
MANAGERPID: 1699
DISPLAY: :1
INVOCATION_ID: 8ce5815f440042b696f809007ddce533
GNOME_SHELL_SESSION_MODE: ubuntu
QTCHOOSER_NO_GLOBAL_DIR: 1
XKB_CONFIG_ROOT: /snap/qownnotes/5803/usr/share/X11/xkb
SNAP_REVISION: 5803
DISABLE_WAYLAND: 1
GST_PLUGIN_PATH: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/gstreamer-1.0
SNAP_ARCH: amd64
SNAP_INSTANCE_KEY: empty
USERNAME: username
QT_SELECT: snappy-qt5
GIO_LAUNCHED_DESKTOP_FILE_PID: 13730
SSH_AUTH_SOCK: /run/user/1000/keyring/ssh
SNAP_USER_COMMON: /home/username/snap/qownnotes/common
USER: username
DESKTOP_SESSION: ubuntu
QT4_IM_MODULE: ibus
QT_QPA_PLATFORMTHEME: gtk3
PWD: /home/username
HOME: /home/username/snap/qownnotes/5803
QTCOMPOSE: /snap/qownnotes/5803/usr/share/X11/locale
JOURNAL_STREAM: 9:48259
SNAP_LAUNCHER_ARCH_TRIPLET: x86_64-linux-gnu
SNAP: /snap/qownnotes/5803
SSH_AGENT_PID: 1937
QT_ACCESSIBILITY: 1
SNAP_COMMON: /var/snap/qownnotes/common
XDG_SESSION_TYPE: x11
SNAP_NAME: qownnotes
GTK_PATH: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/gtk-2.0
XDG_DATA_DIRS: /home/username/snap/qownnotes/5803/.local/share:/home/username/snap/qownnotes/5803:/snap/qownnotes/5803/data-dir:/snap/qownnotes/5803/usr/share:/usr/share/ubuntu:/home/username/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
SNAP_INSTANCE_NAME: qownnotes
SNAP_DATA: /var/snap/qownnotes/5803
XDG_SESSION_DESKTOP: ubuntu
QML2_IMPORT_PATH: /snap/qownnotes/5803/lib/x86_64-linux-gnu:/snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/qt5/qml
TMPDIR: /tmp
GJS_DEBUG_OUTPUT: stderr
GDK_PIXBUF_MODULE_FILE: /home/username/snap/qownnotes/common/.cache/gdk-pixbuf-loaders.cache
GTK_MODULES: gail:atk-bridge
LOCPATH: /snap/qownnotes/5803/usr/lib/locale
SNAP_COOKIE: ootcPbuLL-ToFQOsDPlOBdqlbfI3jJvAsaoj2A5MTfNmNx9ppZ2r
WINDOWPATH: 2
QT_PLUGIN_PATH: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/qt5/plugins
SHELL: /bin/bash
XDG_SESSION_CLASS: user
FONTCONFIG_FILE: /snap/qownnotes/5803/etc/fonts/fonts.conf
QT_IM_MODULE: ibus
TEMPDIR: /tmp
XMODIFIERS: @im=ibus
IM_CONFIG_PHASE: 1
XDG_CURRENT_DESKTOP: ubuntu:GNOME
XLOCALEDIR: /snap/qownnotes/5803/usr/share/X11/locale
GPG_AGENT_INFO: /run/user/1000/gnupg/S.gpg-agent:0:1
BAMF_DESKTOP_FILE_HINT: /var/lib/snapd/desktop/applications/qownnotes_QOwnNotes.desktop
SNAP_REEXEC: empty
GIO_LAUNCHED_DESKTOP_FILE: /var/lib/snapd/desktop/applications/qownnotes_QOwnNotes.desktop
SHLVL: 0
LANGUAGE: en_AU:en
GST_PLUGIN_SCANNER: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner
GDK_PIXBUF_MODULEDIR: /snap/qownnotes/5803/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders
QT_QPA_PLATFORM: xcb
GDMSESSION: ubuntu
GNOME_DESKTOP_SESSION_ID: this-is-deprecated
XDG_CACHE_HOME: /home/username/snap/qownnotes/common/.cache
LOGNAME: username
DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR: /run/user/1000/snap.qownnotes
XAUTHORITY: /run/user/1000/gdm/Xauthority
XDG_DATA_HOME: /home/username/snap/qownnotes/5803/.local/share
SNAP_CONTEXT: ootcPbuLL-ToFQOsDPlOBdqlbfI3jJvAsaoj2A5MTfNmNx9ppZ2r
XDG_CONFIG_DIRS: /snap/qownnotes/5803/etc/xdg:/etc/xdg/xdg-ubuntu:/etc/xdg
PATH: /snap/qownnotes/5803/usr/sbin:/snap/qownnotes/5803/usr/bin:/snap/qownnotes/5803/sbin:/snap/qownnotes/5803/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
SNAP_VERSION: 20.4.16
GJS_DEBUG_TOPICS: JS ERROR;JS LOG
GIO_MODULE_DIR: /home/username/snap/qownnotes/common/.cache/gio-modules
SNAP_LIBRARY_PATH: /var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
SESSION_MANAGER: local/hostname:@/tmp/.ICE-unix/2041,unix/hostname:/tmp/.ICE-unix/2041
XCURSOR_PATH: /snap/qownnotes/5803/data-dir/icons:/snap/qownnotes/5803/usr/share/icons
GTK_IM_MODULE: ibus

Low Bug Upstream-problem

Most helpful comment

Thank you for testing!
Most of the people don't use ${} in a command, so the change was ok.

All 23 comments

Thank you for reporting. Nothing has changed in the snap build process or desktop file in ages. So I wonder if it is a thing of Snap with Ubuntu 20.04 and/or Gnome. Does anyone have more insight into this?

@gitbrn, did it work with a previous version of Ubuntu?

@pbek Unfortunately up until yesterday I was running Kubuntu 19.10. FWIW I didn't notice this behaviour in Latte dock under KDE.

Maybe someone from the Ubuntu Desktop or Snap Team has more insight...

Doesn't seem to happen with the flatpak, so I've just moved to the flatpak. Thanks for a great piece of software by the way! :)

Thank you for your kind words. :grin:

Maybe there's a fix in Ubuntu 20.04.1.

For what its worth, I also saw this issue with the snap since 19.04. Sorry, I probably should have made an issue earlier, but with so many other ways to install it hasn't been much of an issue ¯\_(ツ)_/¯

If anyone finds something out on how to fix things (without destroying other things :sweat_smile:) please let me know :grin:

I think I got it :tada:

Just need to add a couple lines to snapcraft.yaml

First,

    command: desktop-launch ${SNAP}/usr/bin/QOwnNotes -style=Breeze --snap
  >>desktop: usr/share/applications/PBE.QOwnNotes.desktop
    environment:

which fixes the favorite adding behavior, but breaks the icon :frowning_face:

Then,

    after: [desktop-qt5]
  >>override-prime: |
    >>snapcraftctl prime
    >>sed -i 's|^Icon=QOwnNotes|Icon=/usr/share/icons/hicolor/scalable/apps/QOwnNotes.svg|' usr/share/applications/PBE.QOwnNotes.desktop

  desktop-qt5:

to fix the icon

I don't really understand why the icon broke, but it seems having to add a sed is common enough in other snaps.

>>sed -i 's|^Icon=QOwnNotes|Icon=/usr/share/icons/hicolor/scalable/apps/QOwnNotes.svg|' usr/share/applications/PBE.QOwnNotes.desktop

Does that even use the icon from the snap? It looks like the path for the SVG provided by some other means (like the PPA version of QOwnNotes) 😄

yes :grimacing:
I couldn't get it to grab from the meta directory, but now I realize it is because I was using override-pull instead of override-prime.

Anyway, please disregard that whole message. What I was doing ended up making a second desktop entry that worked while leaving the original that kinda worked. I think I found the actual problem for real this time :tada:

All that is needed is to change:
command: desktop-launch ${SNAP}/usr/bin/QOwnNotes -style=Breeze --snap
to
command: desktop-launch $SNAP/usr/bin/QOwnNotes -style=Breeze --snap
in snap/snapcraft.yaml

For some reason doing this adds StartupWMClass=QOwnNotes to the generated .desktop file and I guess that is what keeps the favorite and the new window from disassociating like gitbrn and I have noticed.

tested on Ubuntu and Kubuntu 20.04

${SNAP}

strange, that's just the shell variable escaping, but it's should be ok if removed

(Non technical contribution incoming)

You are both wonderful!

20.6.0

  • fix problem with adding QOwnNotes installed from snap as favorite
    in Ubuntu 20.04

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

Thanks for pushing it to release so fast :smiley:
Unfortunately, it still has the same behavior :grimacing:

I have been trying to troubleshoot, but I can't reproduce my build of 20.5.13 from yesterday, where I built with {}s and without {}s and it seemed pretty clear. Now I tried building 20.5.13 and 20.6.0 with and without {}s and they all work. And by work I mean StartupWMClass=QOwnNotes is in /var/lib/snapd/desktop/applications/qownnotes_PBE.QOwnNotes.desktop.

My only clue is that the .desktop from SnapStore has a different name and old description from this commit.

For 20.6.0
My .desktop in /var/lib/snapd/desktop/applications/qownnotes_PBE.QOwnNotes.desktop

[Desktop Entry]
X-SnapInstanceName=qownnotes
Name=QOwnNotes
Comment=Plain-text file markdown note taking with Nextcloud/ownCloud integration
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/qownnotes_PBE.QOwnNotes.desktop /snap/bin/qownnotes
Icon=/snap/qownnotes/x21/meta/gui/QOwnNotes.png
Type=Application
Terminal=false
StartupNotify=true
Categories=Qt;TextEditor;Todo;
StartupWMClass=QOwnNotes

SnapStore .desktop in /var/lib/snapd/desktop/applications/qownnotes_QOwnNotes.desktop

[Desktop Entry]
X-SnapInstanceName=qownnotes
Name=QOwnNotes
Comment=Plain text notepad and todo list manager with markdown support that works together with ownCloud/Nextcloud
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/qownnotes_QOwnNotes.desktop /snap/bin/qownnotes
Icon=/snap/qownnotes/6357/meta/gui/QOwnNotes.png
Type=Application
Terminal=false
StartupNotify=true
Categories=Qt;TextEditor;Todo;

This .desktop also shows up in /snap/qownnotes/current/meta/gui/QOwnNotes.desktop

To get that old Comment= into the SnapStore build something has to be stuck on the way over there?

Sorry for wild goose chase. I think the issue is that the .desktop on launchpad never got updated.
https://git.launchpad.net/~pbek/qownnotes-snap/tree/snap/gui/QOwnNotes.desktop

Could you please also the edge channel, it isn't build with Launchpad.

edge channel works :+1:

My only guess is that the .desktop (and maybe QOwnNotes.png) do not get added to the scripted commit since this commit to modify the directory structure or this commit to rename to PBE.QOwnNotes.desktop. Maybe one of these made them a new file according to lauchpad and -a won't add them to the commit without an explicit git add

Yes, your observation confirms mine.

In maybe an hour or so there should be a new snap (in the default release channel). Could you please test it then.

Yup, it is fixed! :tada:

Thanks for everything pbek :+1:

Sorry for wasting time with that whole ${} thing. I still don't know what happened there

Thank you for testing!
Most of the people don't use ${} in a command, so the change was ok.

Was this page helpful?
0 / 5 - 0 ratings