unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Clicking once, starting either daemon or client
@ 2021-07-21  9:43 Jean Louis
  0 siblings, 0 replies; only message in thread
From: Jean Louis @ 2021-07-21  9:43 UTC (permalink / raw)
  To: Help GNU Emacs

This may be useful to somebody, this is how I start Emacs client since
quite some longer time.

I have this script as the icon in Window Manager, so I do have to
click twice. It will first load Emacs server in the memory, and if it
is already in memory then it will invoke the `emacsclient' and I like
`espeak' to hear which one is being started.

Of course it could be done better, this works well for personal use.



#!/bin/bash
export EMACS_SOCKET_NAME="/run/user/1001/emacs/server"
if pgrep -f "emacs --bg-daemon" > /dev/null
then
    espeak "Starting Emacs client"
    emacsclient -c
else
    espeak "Starting Emacs daemon"
    emacs --bg-daemon
fi





Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-21  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-21  9:43 Clicking once, starting either daemon or client Jean Louis

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).