[GNC] GNOME shortcuts WAS Re: Switching to/from Flatpak keeping Saved Reports

Tommy Trussell tommy.trussell at gmail.com
Mon Nov 9 12:56:41 EST 2020


see my response below

On Mon, Nov 9, 2020 at 8:09 AM Jon Schewe <jpschewe at mtu.net> wrote:

> Tommy,
>
> Thank you for the tip about the symlink, I'll need to do that.
>
> Here's the menu entry file that I have in
> ~/.local/share/applications/personal-gnucash.desktop. I have similar
> desktop entry for each gnucash file. This allows me to press the "windows"
> key, then type "personal gnucash" and I get the icon and the right file is
> launched.
>
> [Desktop Entry]
> Version=1.0
> Name=Personal GnuCash
> Exec=flatpak run org.gnucash.GnuCash
> "/home/jpschewe/Documents/banking/gnucash/accounts.gnucash"
> Icon=/usr/share/icons/hicolor/64x64/apps/gnucash-icon.png
> Terminal=false
> Type=Application
>
>

Thanks for the reply! Your icon line only works for flatpak if you still
have the distribution version of GnuCash installed. But it prompted me to
get the icon to work with flatpak by changing that line to (sorry this will
almost certainly break in email)

Icon=/var/lib/flatpak/app/org.gnucash.GnuCash/current/active/export/share/icons/hicolor/64x64/apps/org.gnucash.GnuCash.png

SO now the flatpak link has the correct icon.

I keep many active GnuCash books, so I like having a right-click launch for
each of them. At the end of this email is an anonymized and shortened
sample of my GNOME desktop file containing four right-click launch items.

1) Unfortunately it STILL doesn't "consolidate" the running application
icon into the Favorites icon on the taskbar as a distribution application
does.
2) I never could get the "edit" gedit entry to work as expected
3) The crash warning at the end may no longer be true; it was for Ubuntu
Bionic.
4) Even if it doesn't crash, Alt-F2 r  is handy for reloading the edited
file.

  -------------

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=0.9.4
Type=Application
Name=GnuCashFlatpak
MimeType=application/x-gnucash;
Exec=flatpak run org.gnucash.GnuCash
/home/tzt/Work/03Financials/TdA/TdA_Financials
Terminal=false
StartupNotify=true
Icon=/var/lib/flatpak/app/org.gnucash.GnuCash/current/active/export/share/icons/hicolor/64x64/apps/org.gnucash.GnuCash.png
StartupWMClass=Gnucash

Name[en_US]=GnuCashFlatpakAnonymized.desktop

##Gnome Define Actions
Actions=TdA;Cordon;LZX;spacer;edit;

[Desktop Action TdA]
Name=TdA Financials
Exec=flatpak run org.gnucash.GnuCash
/home/tzt/Work/03Financials/TdA/TdA_Financials

[Desktop Action Cordon]
Name=Cordon Corp
Exec=flatpak run org.gnucash.GnuCash
/home/tzt/Work/03Financials/Cordon/Cordon.gnucash

[Desktop Action LZX]
Name=LZX Books
Exec=flatpak run org.gnucash.GnuCash
/home/tzt/Work/03Financials/LZX/LZX_financials

[Desktop Action spacer]
Name=__________________________
Exec=

[Desktop Action edit]
Name=Edit Launcher
Exec=gedit ~/.local/share/applications/GnuCashFlatpakAnonymized.desktop

##End of actions menu
# modified by TT
# INSTRUCTIONS
# 1 copy this file to ~/.local/share/applications/
# 2 update [Desktop Action Edit] section above
# 3 Use GNOME "Show Applications"
#    --> Gnucash --> right-click on icon --> add to favorites
#
# using
https://askubuntu.com/questions/79583/adding-custom-applications-to-gnome-launcher
# using
https://askubuntu.com/questions/64222/how-can-i-create-launchers-on-my-desktop
# using
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#example
# and !!!
# using
https://askubuntu.com/questions/967409/cant-add-custom-desktop-files-to-ubuntu-dock
# and also (to keep things tidy)
# using
https://askubuntu.com/questions/403766/duplicate-icons-for-manually-created-gnome-launcher-items
#
# WARNING WARNING for some reason the top Exec line sometimes makes
# favorites/dock disappear or restart. It HAS to contain a valid exec
# line; commenting it out OR having an error makes desktop restart.
# After making changes you can reload this file with Alt-F2 r


More information about the gnucash-user mailing list