Difference between revisions of "Desktop Shortcuts"
From GnuCash
m (fixed the external link format) |
(Try to modernize) |
||
(2 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. | ||
− | + | # Create a plain text file called gnucash-xyz.desktop containing the following: <syntaxhighlight lang=ini>[Desktop Entry] | |
− | + | Type=Application | |
− | < | + | # append purpose: |
− | Name=GnuCash | + | 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 | ||
− | |||
Encoding=UTF-8 | Encoding=UTF-8 | ||
Categories=Office;Finance; | Categories=Office;Finance; | ||
− | |||
Comment=Manage your finances, accounts, and investments | Comment=Manage your finances, accounts, and investments | ||
− | </ | + | </syntaxhighlight> |
− | + | # Set the permissions and copy the file to a known place: <syntaxhighlight lang="sh"> | |
− | + | chmod 644 gnucash-xyz.desktop | |
− | + | sudo cp gnucash-xyz.desktop /usr/share/applications/ | |
− | < | + | </syntaxhighlight> |
− | + | # 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. | |
− | |||
− | |||
− | file | ||
− | You | + | You can easily relink to a new version, and if something goes really bad, relink to the old version without downtime. |
− | |||
− | 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: <syntaxhighlight lang="sh"> |
+ | ln -s /usr/local/bin/gnucash /usr/bin/ | ||
+ | </syntaxhighlight> | ||
− | You might | + | ==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. | ||
− | < | + | 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 [ | + | 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.
- 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
- Set the permissions and copy the file to a known place:
chmod 644 gnucash-xyz.desktop sudo cp gnucash-xyz.desktop /usr/share/applications/
- 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.]