gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

Linux: GPT4All in the start menu

Open nav9 opened this issue 2 years ago • 6 comments

Feature request

A trivial enhancement, if you'd like to include it. As of now, GPT4All creates a desktop shortcut when installed in Linux. It's also possible to get it into the start menu as per the script shown below.

Motivation

Sometimes, it helps to be able to start an application from the start menu. It also makes it easier to pin the application, when it's available in the start menu.

Your contribution

The file needs to be created in this folder:
sudo -H gedit /usr/share/applications/gpt4all.desktop.

With the following content (and <gpt4all.install.location> substituted with the appropriate path):

[Desktop Entry]
Version=2.4.13
Name=GPT4All
Comment=GPT4All
GenericName=ChatBot
Keywords=gpt,gpt4all
Exec=<gpt4all.install.location>/bin/chat %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=<gpt4all.install.location>/logo-48.png
Categories=QT,LLM
StartupNotify=true

nav9 avatar Jul 25 '23 09:07 nav9

The installer by default doesn't install anything into a system folder. In fact, you shouldn't run it as root on Linux.

I know there are alternative directories in ~/.local/ or ~/.config/ (would have to go look it up in the spec again) but I'm not sure whether they are unified across distros. Even the current method of putting one in the Desktop folder is not without its problems.

See also:

  • #346
  • #873

cosmic-snow avatar Jul 25 '23 13:07 cosmic-snow

It's the ~/.local/share/applications/ folder. Thanks @cosmic-snow. I didn't know we could install it to that folder too. It would work for most Linux distributions, assuming they follow the XDG specification. This is typically the case for mainstream desktop environments like GNOME, KDE, Xfce, and others. I believe this is the desktop entry specification.

nav9 avatar Jul 25 '23 15:07 nav9

IIRC, the desktop spec curiously doesn't mandate a name of variable which points to the desktop folder (see esp. 2nd linked issue).

Also, here's what I currently have in the .desktop file of a test VM:

[Desktop Entry]
Type=Application
Terminal=false
Exec="/home/test/gpt4all/bin/chat"
Name=GPT4All
Icon=/home/test/gpt4all/logo-48.png
Name[en_US]=GPT4All

Expanding that a bit would also be necessary. So there are up to 3-4 things to potentially address:

  • Expand .desktop entry. Should at least have one suitable category (OP lists some more good entries, but not sure which of those are supported/specific keywords).
    • Also, if possible, should probably be made into a template file instead of being wholly part of the installation script (see issue 873).
  • Install a copy into an XDG mandated user location so it gets picked up by the launcher.
  • Address the problem with Desktop folders which have localised names (see linked issues in previous comment).
    • I'm assuming the same problem doesn't exist for a launcher entry, but needs to be checked.

Not all of these would have to be solved at the same time, but it's good to have them grouped here.

cosmic-snow avatar Jul 25 '23 16:07 cosmic-snow

If it's still active, I would love to do this. =)

varshneydevansh avatar Sep 11 '23 17:09 varshneydevansh

I'd say it is and I don't know of anyone who has tried to tackle that.

cosmic-snow avatar Sep 14 '23 09:09 cosmic-snow

i will work on this

srinadh1306 avatar Mar 06 '24 08:03 srinadh1306