unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: 37847@debbugs.gnu.org
Subject: bug#37847: [PATCH] Improve client/daemon xdg/systemd experience
Date: Mon, 21 Oct 2019 12:37:24 -0300	[thread overview]
Message-ID: <CAELgYheC6EBKaVSZd9Vb=gx2p=VQ9Du2j=Gc=S_UyQ6wXFnNzw@mail.gmail.com> (raw)
In-Reply-To: <CAELgYhdF90yA24neUkx=6ut1YK9_ZNtRyVD_qdaLE6evJDXFVg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

> One last remark: the name emacsclient to run `emacs --daemon` is admittedly confusing.

I've renamed it to emacsd since it's launched by systemd. Now it's a
bit confusing that StartupWMClass = Emacsd, but I think it's
preferable to the alternative.

[-- Attachment #2: 0001-Improve-client-daemon-xdg-systemd-experience-Bug-378.patch --]
[-- Type: text/x-patch, Size: 2523 bytes --]

From adee7b90139111ce504a61d710b8de2e4c52846e Mon Sep 17 00:00:00 2001
From: memeplex <carlosjosepita@gmail.com>
Date: Mon, 21 Oct 2019 03:58:55 -0300
Subject: [PATCH] Improve client/daemon xdg/systemd experience (Bug#37847)

* Makefile.in: Add emacsclient.desktop generation.
* etc/emacsclient.desktop: Add file, use emacsd as StartupWMClass.
* etc/emacs.service: Run with name emacsd.
---
 Makefile.in             |  7 +++++++
 etc/emacs.service       |  2 +-
 etc/emacsclient.desktop | 12 ++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 etc/emacsclient.desktop

diff --git a/Makefile.in b/Makefile.in
index aa11e6b0b7..0d50c1636a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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/" \
diff --git a/etc/emacs.service b/etc/emacs.service
index c99c6779f5..0dc2418269 100644
--- a/etc/emacs.service
+++ b/etc/emacs.service
@@ -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
index 0000000000..3feb83c729
--- /dev/null
+++ b/etc/emacsclient.desktop
@@ -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;
-- 
2.20.1


  reply	other threads:[~2019-10-21 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <MN2PR18MB2765AF5AE45CED817D2D0F86C9290@MN2PR18MB2765.namprd18.prod.outlook.com>
2019-10-21  7:15 ` bug#37847: [PATCH] Improve client/daemon xdg/systemd experience Carlos Pita
2019-10-21  7:27   ` Carlos Pita
2019-10-21 15:37     ` Carlos Pita [this message]
2020-08-09 13:59       ` Lars Ingebrigtsen
2020-09-08 21:46   ` Vojtech Stepancik
2020-09-09  9:35     ` Lars Ingebrigtsen
2020-09-09  9:47       ` Vojtech Stepancik
2020-09-09 10:09         ` Lars Ingebrigtsen
2020-10-13  3:48           ` Lars Ingebrigtsen
2021-05-28 17:21   ` Peter Oliver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAELgYheC6EBKaVSZd9Vb=gx2p=VQ9Du2j=Gc=S_UyQ6wXFnNzw@mail.gmail.com' \
    --to=carlosjosepita@gmail.com \
    --cc=37847@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).