]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve client/daemon xdg/systemd experience
authorCarlos Pita <carlosjosepita@gmail.com>
Sun, 9 Aug 2020 13:57:51 +0000 (15:57 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 9 Aug 2020 13:57:51 +0000 (15:57 +0200)
* Makefile.in: Add emacsclient.desktop generation.
* etc/emacsclient.desktop: Add file, use emacsd as StartupWMClass.
* etc/emacs.service: Run with name emacsd (bug#37847).

Makefile.in
etc/emacs.service
etc/emacsclient.desktop [new file with mode: 0644]

index 67e15cfecd24333d6f39683cabda0e36c28bd26b..fbb1891ba72254ff9d280b071905a5e6f79dc117 100644 (file)
@@ -714,6 +714,13 @@ install-etc:
          ${srcdir}/etc/emacs.desktop > $${tmp}; \
        ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"; \
        rm -f $${tmp}
+       tmp=etc/emacsclient.tmpdesktop; rm -f $${tmp}; \
+       client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
+       sed -e "/^Exec=emacsclient/ s|emacsclient|${bindir}/$${client_name}|" \
+         -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
+         ${srcdir}/etc/emacsclient.desktop > $${tmp}; \
+       ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \
+       rm -f $${tmp}
        umask 022; ${MKDIR_P} "$(DESTDIR)${appdatadir}"
        tmp=etc/emacs.tmpappdata; rm -f $${tmp}; \
        sed -e "s/emacs\.desktop/${EMACS_NAME}.desktop/" \
index c99c6779f58e7c30ff1fae7c44e4e34c1ebc367c..0dc2418269ed6a98931ff82c6ecc6f55e05eeeb3 100644 (file)
@@ -8,7 +8,7 @@ Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
 
 [Service]
 Type=notify
-ExecStart=emacs --fg-daemon
+ExecStart=@emacs emacsd --fg-daemon
 ExecStop=emacsclient --eval "(kill-emacs)"
 # The location of the SSH auth socket varies by distribution, and some
 # set it from PAM, so don't override by default.
diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
new file mode 100644 (file)
index 0000000..3feb83c
--- /dev/null
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=Emacs (Client)
+GenericName=Text Editor
+Comment=Edit text
+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 -c %F
+Icon=emacs
+Type=Application
+Terminal=false
+Categories=Development;TextEditor;
+StartupWMClass=Emacsd
+Keywords=Text;Editor;