0

I can't seem to create a .desktop launcher for the latest FreeCAD AppImage.

I first tried answer by @UriHerrera but it did not work. Then I included the answer by @vanadium but it did not work too. When I press Super+A keys, I can't see the FreeCAD icon there. Neither does FreeCad icon appears when I pressed the Super key and typed Freecad in search bar. I also tried refreshing gnome-shell by pressing Alt+F2followed by pressing r and Enter but this action did not help either.

Can you tell me my mistake?

Summarising my actions:

  1. I downloaded FreeCAD-0.20 from https://www.freecadweb.org/index.php into ~/.local/bin.

  2. Executed:

     $ chmod +x ~/.local/bin/FreeCAD-0.20.0-Linux-x86_64.AppImage
     $ ~/.local/bin/FreeCAD-0.20.0-Linux-x86_64.AppImage --appimage-extract
     $ cp ~/.local/bin/squashfs-root/freecad_weekly.desktop ~/.local/share/applications/freecad_weekly.desktop
     $ mkdir ~/.local/share/icons/FreeCAD/
     $ cp ~/.local/bin/squashfs-root/freecad_weekly.svg ~/.local/share/icons/FreeCAD/freecad_weekly.svg
     $ xprop | grep WM_CLASS
     WM_CLASS(STRING) = "gnome-terminal-server", "Gnome-terminal"
     $ gedit ~/.local/share/applications/freecad_weekly.desktop
    
  3. Changed

     [Desktop Entry]
     Version=1.0
     Name=FreeCAD Weekly
     Exec=AppRun
     Icon=freecad_weekly
     Type=Application
     Categories=Engineering;
     Comment=Feature based Parametric Modeler
     Terminal=false
     StartupNotify=true
     NoDisplay=false
     MimeType=application/x-extension-fcstd;
    

    to

     [Desktop Entry]
     Version=1.0
     Name=FreeCAD Weekly
     Exec=$HOME/.local/bin/FreeCAD-0.20.0-Linux-x86_64.AppImage
     Icon=$HOME/.local/share/icons/FreeCAD/freecad_weekly.svg
     StartupWMClass="gnome-terminal-server","Gnome-terminal"
     Type=Application
     Categories=Engineering;
     Comment=Feature based Parametric Modeler
     Terminal=false
     StartupNotify=true
     NoDisplay=false
     MimeType=application/x-extension-fcstd;
    

Also tried StartupWMClass=gnome-terminal-server Gnome-terminal but this did not work too.

Update: Why does the Freecad icon not show properly? freecad icon not showing

Outcome from updating ~/.local/share/applications/freecad_weekly.desktop to:

[Desktop Entry]
Version=1.0
Name=FreeCAD Weekly
Exec=freecad
Icon=freecad_weekly
Type=Application
Categories=Engineering;
Comment=Feature based Parametric Modeler
Terminal=false
StartupNotify=true
NoDisplay=false
MimeType=application/x-extension-fcstd;
Sun Bear
  • 2,302

1 Answers1

3

Almost there. Replace $HOME by the actual pathname. .desktop files do not know about bash variables.

Tips:

  • You can leave out the path names. Since ~/.local/bin is in your path, and .local/share/icons is a location where icons are searched, it is sufficient to just mention the file name of the executable, i.e., Exec=FreeCAD-0.20.0-Linux-x86_64.AppImage and the file name of the icon without the extension, i.e., Icon=freecad_weekly.

  • Personally, I would rather place the AppImage file in a directory "~/.apps" and create a symlink to it in ~/.local/bin, e.g. ln -s ~/.apps/FreeCAD-0.20.0-Linux-x86_64.AppImage ~/.local/bin/freecad. The line now becomes Exec=freecad. That way you can

    1. Run the program conveniently from the terminal using the command freecad.
    2. When you later download an updated appimage, it will be sufficient to recreate the link to have it point to the new version.
vanadium
  • 88,010
  • Thanks. I have attached to my question an imaged of the freecad icon which is not showing correctly. Why is this so? – Sun Bear Jul 17 '22 at 15:43
  • Also, with or without StartupWMClass="gnome-terminal-server","Gnome-terminal", the "freecad" icon appears. Is this statement still needed? – Sun Bear Jul 17 '22 at 15:47
  • Since I am not on your system, I cannot verify whether the icon is a valid graphics file and whether it effectively is in a correct location. Perhaps the icon file needs to be right under ~/.local/share/icons/ for it to work with the name alone (although systemwide once certainly can have subdirs). – vanadium Jul 17 '22 at 18:24
  • You are right. The icon file needs to be right inside ~/.local/share/icons/ and not inside a subdir. I should have done $ cp ~/.app/squashfs-root/freecad_weekly.svg ~/.local/share/icons/freecad_weekly.svg. – Sun Bear Jul 17 '22 at 18:51