Difference between revisions of "Desktop Shortcuts"

From GnuCash
Jump to: navigation, search
(How to create GnuCash desktop files for multiple versions or files)
 
(Try to modernize)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
Desktop files can be used to start a specific ''version'' of a program like GnuCash with a specific ''data file''. You can create as many separate desktop files as you need:
 +
:;By Data files: my, spouse, charity…
 +
:;By installed program versions: From Distribution, stable and nighly [[Flatpak]]…
 +
[[Category:Customization]]
 +
 +
==Create Customized Desktop Files==
 
Make a desktop file, set permissions, and move to the correct location for your environment.
 
Make a desktop file, set permissions, and move to the correct location for your environment.
  
1. Create a plain text file called gnucash-xyz.desktop containing the following:
+
# Create a plain text file called gnucash-xyz.desktop containing the following: <syntaxhighlight lang=ini>[Desktop Entry]
 
+
Type=Application
<pre>[Desktop Entry]
+
# append purpose:
Name=GnuCash 2.6
+
Name=GnuCash
 +
# adjust path, optionally add path to data file:
 +
Exec=/usr/bin/gnucash
 +
# Enable for debugging:
 
Terminal=false
 
Terminal=false
 
Icon=/usr/share/pixmaps/gnucash-icon-256x256.png
 
Icon=/usr/share/pixmaps/gnucash-icon-256x256.png
Type=Application
 
 
Encoding=UTF-8
 
Encoding=UTF-8
 
Categories=Office;Finance;
 
Categories=Office;Finance;
Exec=/usr/bin/gnucash /path/to/myfile
 
 
Comment=Manage your finances, accounts, and investments
 
Comment=Manage your finances, accounts, and investments
</pre>
+
</syntaxhighlight>
 
+
# Set the permissions and copy the file to a known place: <syntaxhighlight lang="sh">
2. Set the permissions and copy the file to a known place.
+
chmod 644 gnucash-xyz.desktop
 
+
sudo cp gnucash-xyz.desktop /usr/share/applications/
<code> $ chmod 644 gnucash-xyz.desktop
+
</syntaxhighlight>
$ cp gnucash-xyz.desktop /usr/share/applications/ </code>
+
# Create a link from the executable file to the name used in the desktop file if you are using stable/testing multiple versions of GnuCash.
 
 
3. Create a link from the executable file to the name used in the desktop
 
file if if you are using / testing multiple versions of GnuCash.
 
  
You might want separate icons for stable, distro,
+
You can easily relink to a new version, and if something goes really bad, relink to the old version without downtime.
and latest, and easily relink to a new version, and if something
 
goes really bad, relink to the old version without downtime.  Also you
 
might find different configurations install to different locations, so
 
good to check this matches your system.
 
  
<code>$ ln -s /usr/local/bin/gnucash /usr/bin/ </code>
+
Also you might find different configurations install to different locations, so good to check this matches your system: <syntaxhighlight lang="sh">
 +
ln -s /usr/local/bin/gnucash /usr/bin/
 +
</syntaxhighlight>
  
You might copy the svg file or the png file for your bitmap:
+
==Optionally Create Separate Icons==
 +
You might want separate icons for stable, distro, and latest. You can use an image editor like [{{URL:wp}}GIMP GIMP] and create modified icons for each purpose.
  
<code>$ cp /usr/local/share/gnucash/pixmaps/gnucash-icon-256x256.png /usr/share/pixmaps/ </code>
+
You might copy the svg or png file for your icon: <syntaxhighlight lang="sh">
 +
cp /usr/local/share/gnucash/pixmaps/gnucash-icon-256x256.png /usr/share/pixmaps/
 +
</syntaxhighlight>
  
For more information on desktop shortcuts, see [[http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html|the official desktop entry specification]].
+
For more information on desktop shortcuts, see [{{URL:XDG-spec}}desktop-entry-spec/desktop-entry-spec-latest.html the official desktop entry specification].
  
 
[Thanks to Bob Brush on the GnuCash Users email list for the initial content of this page.]
 
[Thanks to Bob Brush on the GnuCash Users email list for the initial content of this page.]

Latest revision as of 12:39, 27 December 2021

Desktop files can be used to start a specific version of a program like GnuCash with a specific data file. You can create as many separate desktop files as you need:

By Data files
my, spouse, charity…
By installed program versions
From Distribution, stable and nighly Flatpak

Create Customized Desktop Files

Make a desktop file, set permissions, and move to the correct location for your environment.

  1. Create a plain text file called gnucash-xyz.desktop containing the following:
    [Desktop Entry]
    Type=Application
    # append purpose:
    Name=GnuCash
    # adjust path, optionally add path to data file:
    Exec=/usr/bin/gnucash
    # Enable for debugging:
    Terminal=false
    Icon=/usr/share/pixmaps/gnucash-icon-256x256.png
    Encoding=UTF-8
    Categories=Office;Finance;
    Comment=Manage your finances, accounts, and investments
    
  2. Set the permissions and copy the file to a known place:
    chmod 644 gnucash-xyz.desktop
    sudo cp gnucash-xyz.desktop /usr/share/applications/
    
  3. Create a link from the executable file to the name used in the desktop file if you are using stable/testing multiple versions of GnuCash.

You can easily relink to a new version, and if something goes really bad, relink to the old version without downtime.

Also you might find different configurations install to different locations, so good to check this matches your system:
ln -s /usr/local/bin/gnucash /usr/bin/

Optionally Create Separate Icons

You might want separate icons for stable, distro, and latest. You can use an image editor like GIMP and create modified icons for each purpose.

You might copy the svg or png file for your icon:
cp /usr/local/share/gnucash/pixmaps/gnucash-icon-256x256.png /usr/share/pixmaps/

For more information on desktop shortcuts, see the official desktop entry specification.

[Thanks to Bob Brush on the GnuCash Users email list for the initial content of this page.]