User .desktop file duplicates and hijacks system app icon in GNOME dock











up vote
1
down vote

favorite












I'm trying to set up a custom "Open in Emacs" .desktop file that uses the emacsclient utility to open a new buffer in an existing Emacs instance, if available, or start a new instance otherwise. In either case, I would like the icon in the dash to be the one for the standard "Emacs (GUI)" desktop launcher. And I would like to keep this launcher pinned in the dash so that I can click it to launch Emacs in the conventional fashion.



I've tried implementing this solution. My current emacsclient.desktop file looks like this:



[Desktop Entry]
Version=1.0
Name=Emacsclient
GenericName=Text Editor
Comment=View and edit files
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=emacsclient --no-wait --alternate-editor "emacs" %F
Icon=emacs
Type=Application
Terminal=false
Categories=Utility;Development;TextEditor;
StartupWMClass=Emacs


It works well for opening things in an existing Emacs instance. However, whenever I launch Emacs, either through the regular app launcher or by calling my custom launcher on a file, GNOME shows the app as being "Emacsclient" rather than Emacs. If I pin the regular Emacs launcher to the app, this results in two separate Emacs icons in the dock, with the Emacsclient one the only one that can be active. I can't even just accept the app being called "Emacsclient" in the dock, because if I try to pin my Emacsclient launcher, clicking it doesn't launch Emacs.



How can I get the Emacsclient functionality without getting duplicate icons in the dock and with the ability to pin Emacs in a sensible fashion?










share|improve this question




























    up vote
    1
    down vote

    favorite












    I'm trying to set up a custom "Open in Emacs" .desktop file that uses the emacsclient utility to open a new buffer in an existing Emacs instance, if available, or start a new instance otherwise. In either case, I would like the icon in the dash to be the one for the standard "Emacs (GUI)" desktop launcher. And I would like to keep this launcher pinned in the dash so that I can click it to launch Emacs in the conventional fashion.



    I've tried implementing this solution. My current emacsclient.desktop file looks like this:



    [Desktop Entry]
    Version=1.0
    Name=Emacsclient
    GenericName=Text Editor
    Comment=View and edit files
    MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
    Exec=emacsclient --no-wait --alternate-editor "emacs" %F
    Icon=emacs
    Type=Application
    Terminal=false
    Categories=Utility;Development;TextEditor;
    StartupWMClass=Emacs


    It works well for opening things in an existing Emacs instance. However, whenever I launch Emacs, either through the regular app launcher or by calling my custom launcher on a file, GNOME shows the app as being "Emacsclient" rather than Emacs. If I pin the regular Emacs launcher to the app, this results in two separate Emacs icons in the dock, with the Emacsclient one the only one that can be active. I can't even just accept the app being called "Emacsclient" in the dock, because if I try to pin my Emacsclient launcher, clicking it doesn't launch Emacs.



    How can I get the Emacsclient functionality without getting duplicate icons in the dock and with the ability to pin Emacs in a sensible fashion?










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm trying to set up a custom "Open in Emacs" .desktop file that uses the emacsclient utility to open a new buffer in an existing Emacs instance, if available, or start a new instance otherwise. In either case, I would like the icon in the dash to be the one for the standard "Emacs (GUI)" desktop launcher. And I would like to keep this launcher pinned in the dash so that I can click it to launch Emacs in the conventional fashion.



      I've tried implementing this solution. My current emacsclient.desktop file looks like this:



      [Desktop Entry]
      Version=1.0
      Name=Emacsclient
      GenericName=Text Editor
      Comment=View and edit files
      MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
      Exec=emacsclient --no-wait --alternate-editor "emacs" %F
      Icon=emacs
      Type=Application
      Terminal=false
      Categories=Utility;Development;TextEditor;
      StartupWMClass=Emacs


      It works well for opening things in an existing Emacs instance. However, whenever I launch Emacs, either through the regular app launcher or by calling my custom launcher on a file, GNOME shows the app as being "Emacsclient" rather than Emacs. If I pin the regular Emacs launcher to the app, this results in two separate Emacs icons in the dock, with the Emacsclient one the only one that can be active. I can't even just accept the app being called "Emacsclient" in the dock, because if I try to pin my Emacsclient launcher, clicking it doesn't launch Emacs.



      How can I get the Emacsclient functionality without getting duplicate icons in the dock and with the ability to pin Emacs in a sensible fashion?










      share|improve this question















      I'm trying to set up a custom "Open in Emacs" .desktop file that uses the emacsclient utility to open a new buffer in an existing Emacs instance, if available, or start a new instance otherwise. In either case, I would like the icon in the dash to be the one for the standard "Emacs (GUI)" desktop launcher. And I would like to keep this launcher pinned in the dash so that I can click it to launch Emacs in the conventional fashion.



      I've tried implementing this solution. My current emacsclient.desktop file looks like this:



      [Desktop Entry]
      Version=1.0
      Name=Emacsclient
      GenericName=Text Editor
      Comment=View and edit files
      MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
      Exec=emacsclient --no-wait --alternate-editor "emacs" %F
      Icon=emacs
      Type=Application
      Terminal=false
      Categories=Utility;Development;TextEditor;
      StartupWMClass=Emacs


      It works well for opening things in an existing Emacs instance. However, whenever I launch Emacs, either through the regular app launcher or by calling my custom launcher on a file, GNOME shows the app as being "Emacsclient" rather than Emacs. If I pin the regular Emacs launcher to the app, this results in two separate Emacs icons in the dock, with the Emacsclient one the only one that can be active. I can't even just accept the app being called "Emacsclient" in the dock, because if I try to pin my Emacsclient launcher, clicking it doesn't launch Emacs.



      How can I get the Emacsclient functionality without getting duplicate icons in the dock and with the ability to pin Emacs in a sensible fashion?







      launcher gnome-shell .desktop emacs ubuntu-dock






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 10 at 21:54









      pomsky

      27.9k1185112




      27.9k1185112










      asked Dec 10 at 21:45









      duncanka

      2614




      2614



























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1099897%2fuser-desktop-file-duplicates-and-hijacks-system-app-icon-in-gnome-dock%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1099897%2fuser-desktop-file-duplicates-and-hijacks-system-app-icon-in-gnome-dock%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:香港粉麵

          List *all* the tuples!

          Channel [V]