-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable elcord's rich presence when editing *scratch* #17
Comments
Funny you bring this up. I was considering something like this the other day when somebody asked me. Here's one thing I considered: Have elcord disable itself when all visible* frames are closed, and have it automatically start up again on new frame creation. This way we get to keep using the daemon while having non-daemon-like behaviour. Let me know what you think. * visible because iirc running daemon mode has an invisible frame that always exists). |
That seems pretty reasonable, especially compared to my proposal of disabling |
Cool. I didn't have much time to work on it today but I hacked this up pretty quick (emphasis on the word "hack") (defun elcord--disable-elcord-if-no-frames (f)
(declare (ignore f))
(when (let ((frames (delete f (visible-frame-list))))
(or (null frames)
(and (null (cdr frames))
(eq (car frames) terminal-frame))))
(elcord-mode -1)
(add-hook 'after-make-frame-functions 'elcord--enable-on-frame-created)))
(defun elcord--enable-on-frame-created (f)
(declare (ignore f))
(elcord-mode +1))
(defun my/elcord-mode-hook ()
(if elcord-mode
(add-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames)
(remove-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames)))
(add-hook 'elcord-mode-hook 'my/elcord-mode-hook) should work in practical use-cases, though it looks like there's no hook for detecting when a frame goes invisible (without deleting it) If I get time I'll do more on it |
I'm using doom emacs and I keep on getting editing doom which is quite annoying :( |
Basically it disables elcord if no frames are visible, and will re-enable elcord if a new frame get created. Code is based on: Mstrodl/elcord#17
the above code works but it still shows scratch . Is the a way to filter it in |
Friendly reminder to ask if you got time for this :) |
Thanks a lot, I've been searching for a way to do this 🙏🏻 |
I use
emacs --daemon
, and frequently get queries about why "I've been playing Emacs for two days".When I'm not actively editing a file, Discord shows me as editing the scratchpad.
Hence, I'd like to have functionality where Elcord disables rich presence when editing the buffer
*scratch*
, possibly only if the daemon is enabled, which can be checked via(daemonp)
.The text was updated successfully, but these errors were encountered: