Struggles launching Gramps from the terminal (command line interface)

I sometimes need to run Gramps from a terminal so I can see the extra warnings and error messages. Or to start in developer/debug mode.

But since I normally run Gramps from an icon on the desktop GUI, it can be challenging to discover how to launch from terminal/command line. You’ll need to fine the file path and command line syntax for launching the application or passing parameters.

Finding the filepath can be the more challenging part of this task. Particularly since that part varies by OS, the flavor of OS, and installation method used to install Gramps.

Windows

The All-In-One installer for Gramps for Windows adds an icon for launching in Terminal Mode in addition to the icon for launching normally. During install, they can be added to the Desktop, application launch bar or just to the Windows Menu. But if you need to use optional switches from the command line, you still need to learn how to navigate to the Gramps installation directory. (Since the Gramps directory is not part of the command PATH environment variable.)

Windows XP

When I was running Gramps from Windows XP, there was Gramps shortcut icon on the desktop (or in the Windows menu). The context menu for that shortcut icon offered to show me the target file and the path to the gramps folder/directory. Then I could open the terminal, Change Directory (cd) to that path and use the command line syntax outlined in the wiki.

Windows 10

Windows 10 complicated things a bit by having a shortcut icon to a shortcut icon.

And the context menu options for each icon were different to do the drilling down. But after the 2nd icon, the target file and path were again shown. So the next process was the same. (open the terminal, Change Directory (cd) to that path and use the command line syntax outlined in the wiki.)

MacOS

If you installed into the normal location (Applications folder), then the command line interface would be:

$ /Applications/Gramps.app/Contents/MacOS/Gramps

If you installed outside of the normal Applications folder, you need to make the appropriate adjustments. For instance, if you installed on your desktop, it would be:

$ ~/Desktop/Gramps.app/Contents/MacOS/Gramps

Linux

As a new user to Linux, I find the file organization to be an experiment in obfuscation. There are so many alternative filepaths that I need a flowchart diagram on the wall to keep track of the paths I’ve already eliminated and those that have yet to be explored.

I’m sure there is logic to the madness. But for a new user, it is dizzying like being blind-folded and spun for a piñata game. And someone has a string tied to the Gramps application so that they can fiendishly gigle while yanking sub-directories to a new places should I blunder too close.

There’s got to be an easier way to discover in the GUI what installer was used to install Gramps and where the core code is located. (My system is complicated by having had different installers a several installations (and versions) of Gramps. So while I know which version is running (5.2.1), I do not recall the installer that was finally successful or understand which concurrently installed instance is dominant.

Fedora with Gnome

There is an icon when you press the Super (Windows) key. It can be at the bottom if Gramps is in your Favorites or at the top when you search by typing “Gramps”. The Gramps icon is also located in the Office category of the Applications overview.

I thought I could examine the underpinning of these icons to discover the path to the installation. But it is not that simple. The “Show details” context menu gives a hint if you understand how to interpret. It opens an “application store” like dialog. And under the buttons to Open or Update it gave a critical hint: this particular installation was using a Flatpak. So the method to find the installation is quite specific.

Here’s Perplexity’s suggestion:
This summarizes of the process to find the terminal launch command for a Flatpak application like Gramps, when you know it appears in the GNOME application menu under Favorites and Office:

  1. Locate the .desktop file:
    find /var/lib/flatpak/exports/share/applications -name "*gramps*.desktop"
  2. Examine the .desktop file contents:
    cat /var/lib/flatpak/exports/share/applications/org.gramps_project.Gramps.desktop
  3. Look for the Exec= line in the .desktop file:
    This line contains the full command used to launch the application.
  4. Identify the Flatpak application ID:
    Look for the X-Flatpak= line or the application ID in the Exec= line.
  5. Extract the simple launch command:
    The simple launch command is always in the format:
    flatpak run [application-id]
    In this case: flatpak run org.gramps_project.Gramps
  6. Note the full command (if needed):
    This is the entire Exec= line from the .desktop file, minus any file forwarding arguments.

By following these steps, you can find both the simple launch command and the full command for any Flatpak application in your GNOME menu. The simple launch command is usually sufficient for most purposes, while the full command can be useful if you need to specify particular options or troubleshoot issues.

MacOS
I dont think it is as easy as you state. If you want to run from the command line, you need to find the correct file.

If you installed into the normal location (Applications folder), then the command line interface would be:

$ /Applications/Gramps.app/Contents/MacOS/Gramps

I doubt many Mac users could find it easily. If you installed outside of the normal Applications folder, you need to make the appropriate adjustments. For instance, if you installed on your desktop, it would be:

$ ~/Desktop/Gramps.app/Contents/MacOS/Gramps

1 Like

That posting is set to be a ‘Wiki’ now. Improve/correct it as you like. After it is (mostly) correct and my whinging about Linux is removed, the content can be moved to be a MediaWiki article.

TBH, if you’re on Linux, any flavor, you definitely don’t need the BS produced by Perplexity, or any other so-called AI. They’re known to produce BS, and that knowledge comes from reliable sources like this one:

And as you can see, the British don’t have a problem calling it what it is, and don’t really avoid words that Americans don’t like to hear.

Anyway, what I tried to say is that on Linux, it’s common to add all commands to the path, which on my machine means that there’s a Python script named gramps in /usr/local/bin, which is just one of the 10 directories in my PATH. And you can find the location of your gramps script by typing “which gramps” in your terminal.

If you installed the flatpak version, there is no problem either, because flatpak is also in your path, and here it’s in /usr/bin. That means that you start flatpak from terminal too, and flatpak keeps track of all installed applications, which you can see by typing “flatpak list”, so if you have any, you know what to type after “flatpak run”.

This habit of adding installed programs to the path is almost as old as unix itself.

3 Likes

This is why I alway Cite the AI and the prompt. When BS is likely, it is good for people to see when excretions and foul odors are imminent.

That’s interesting.

and flatpak list --app is a bit more compact. Although that our application lists as:

Name Application ID Version Branch Origin Installation
Gramps Development Team org.gramps_project.Gramps 5.2.1 stable flathub system

I wonder who should correct the name of the application showing author info?

I did not see your prompt, but the answer shows that there’s no knowledge behind the text. If there were, it would tell you about the paths, and not grab some texts and create a long text, that may be correct, but makes things way more complex than needed.

The truth is, that at least on Linux and Windows, you can select Properties in the menu, most times with a right click, and if you do that, you can see the command, which may be just the word gramps, or a full path. And in Windows, you will also see the location where the command is executed, in a separate field. I don’t see that in my Linux Mint.

I normally run my own Gramps 5.1.7, which is in my path, but to test, I also installed the latest flatpak, which gave me an extra menu entry called ‘Gramps (Flatpak)’, so that I can run both, even at the same time. You don’t get that other name on every Linux though.

My Gramps flatpak version is 5.2.3, and that’s simply named Gramps.

You can see the author info on

and I recommend that you run “flatpak upgrade” to get the latest.

The Prompt is (re)stated in the 1st paragraph:

This summarizes of the process to find the terminal launch command for a Flatpak application like Gramps, when you know it appears in the GNOME application menu under Favorites and Office:

As @codefarmer pointed out elsewhere, a poor quality AI response can often be traced back to a poorly-written prompt. So maybe I need to learn how to frame a better question.

I admit to beginning to like using AIs because they do not get testy when facing the Socratic Method. However, the hallucinations do seem to be aggravated by repeated refinements of the same question.

1 Like

OK, I get it. I read that text, but did not know that it was a restated prompt. And although I support the idea that better prompts trigger better answers, I still see that the answers are way longer than needed, and that they miss common knowlledge, like the fact that almost all Linux commands are in the path, and that you can find the command much faster by right clicking the menu entry, or the desktop icon, and selecting properties, which gives something like this:

I got both in one screenshot by superimposing the Linux properties window over a VirtualBox session running Windows 10.

The screenshot’s in Dutch, but I assume that you get the idea. And as you can see, my instruction’s just one sentence, and not 4 paragraphs, like I get from ChatGPT.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.