Search code examples
coqubuntu-18.04

Coq IDE icon missing from favorites


I installed Coq and Coq IDE from here. Everything went smooth. I launched the Coq IDE from terminal, then I right clicked it to add it to my favorites and that was not possible. When I looked for its icon in my programs it wasn't there. I'm on Ubuntu 18.04, can it be done?


Solution

  • You can create your own coqide.desktop in ~/.local/share/applications by imitating the ones present in /usr/share/applications.

    The difficulty is that the opam installation may include multiple switches, each with one version of Coq. Thus it is not clear what binary must be pointed to by the shortlink you want to create.

    I see two solutions:

    • choosing the version of Coq present in the current global opam switch. That's what I used for a few months a year ago. If the current opam switch does not contain a Coq binary, launching CoqIDE from the shortlink silently fails. I think I used a command similar to zsh -ic coqide (because zsh is my main shell, you may adapt this command to your own shell). I call zsh so that it loads the opam environment and can find the right coqide. The -i may not be necessary, but I remembered that without it, zsh was not loading the opam environment in my case.

    • choosing the version of Coq present in a given switch. You just have to adapt the previous point so that the right switch is selected before calling coqide. This gives

      zsh -ic "eval $(opam env --switch myswitch) coqide"
      

    I am not sure that running an executable by calling the shell is a good practice (I would say it is not), but at least it works and I do not see how to load the opam environment without such a hack.