diff options
| -rw-r--r-- | attic/elisp/misc.el | 26 | ||||
| -rw-r--r-- | custom/jao-custom-chats.el | 62 | ||||
| -rw-r--r-- | init.el | 43 |
3 files changed, 67 insertions, 64 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el index 77089ff..7cf9029 100644 --- a/attic/elisp/misc.el +++ b/attic/elisp/misc.el @@ -1244,3 +1244,29 @@ It should be the title of the web page as returned by `rdrview'" counts 0))) (when (> n 0) `(:propertize ,(format "%s%d " label n) face ,face)))) + +;;; ement +(use-package ement + :disabled t + :ensure t + :init (setq ement-save-sessions t + ement-sessions-file (locate-user-emacs-file "cache/ement.el") + ement-room-avatars nil + ement-notify-dbus-p nil + ement-room-left-margin-width 0 + ement-room-right-margin-width 11 + ement-room-timestamp-format "%H:%M" + ement-room-timestamp-header-format "--------") + + :custom ((ement-room-message-format-spec "(%S) %B%r%R %t")) + + :config + (defun jao-ement-track (event room session) + (when (ement-notify--room-unread-p event room session) + (when-let ((n (ement-room--buffer-name room)) + (b (get-buffer n))) + (tracking-add-buffer b)))) + + (add-hook 'ement-event-hook #'jao-ement-track) + (jao-shorten-modes 'ement-room-mode) + (jao-tracking-cleaner "^\\*Ement Room: \\(.+\\)\\*" "@\\1")) diff --git a/custom/jao-custom-chats.el b/custom/jao-custom-chats.el index c2105c6..60368d3 100644 --- a/custom/jao-custom-chats.el +++ b/custom/jao-custom-chats.el @@ -117,40 +117,7 @@ (enable-lui-track) (circe-lagmon-mode)) -;;;; telegram -(use-package telega - :ensure t - :custom - (telega-use-tracking-for '(unmuted) ;; '(or unmuted mention) - telega-rainbow-color-custom-for nil - telega-msg-rainbow-title nil - telega-sticker-set-download t - telega-symbol-checkmark "·" - telega-symbol-heavy-checkmark "×" - telega-symbol-verified "*") - :config - (define-key global-map (kbd "C-c C-t") telega-prefix-map) - (setq telega-chat-show-avatars nil - telega-chat-prompt-insexp '(telega-ins "> ") - telega-completing-read-function #'completing-read - telega-root-show-avatars nil - telega-emoji-use-images nil - telega-temp-dir "/tmp/telega" - telega-symbol-horizontal-bar - (propertize "-" 'face 'jao-themes-f00) - telega-symbol-vertical-bar - (propertize "| " 'face 'jao-themes-dimm) - telega-mode-line-string-format - '(:eval (telega-mode-line-unread-unmuted)) - telega-use-images (display-graphic-p) - telega-open-file-function #'jao--see - telega-open-message-as-file - (unless (display-graphic-p) '(photo video animation))) - (with-eval-after-load "tracking" - (jao-shorten-modes 'telega-chat-mode) - (jao-tracking-faces 'telega-tracking)) - (telega-mode-line-mode 1)) - +;;;; startup (defun jao-telega () (interactive) (jao-tracking-go-to-chats) @@ -158,33 +125,6 @@ (pop-to-buffer telega-root-buffer-name) (telega))) -;;;; ement -(use-package ement - :disabled t - :ensure t - :init (setq ement-save-sessions t - ement-sessions-file (locate-user-emacs-file "cache/ement.el") - ement-room-avatars nil - ement-notify-dbus-p nil - ement-room-left-margin-width 0 - ement-room-right-margin-width 11 - ement-room-timestamp-format "%H:%M" - ement-room-timestamp-header-format "--------") - - :custom ((ement-room-message-format-spec "(%S) %B%r%R %t")) - - :config - (defun jao-ement-track (event room session) - (when (ement-notify--room-unread-p event room session) - (when-let ((n (ement-room--buffer-name room)) - (b (get-buffer n))) - (tracking-add-buffer b)))) - - (add-hook 'ement-event-hook #'jao-ement-track) - (jao-shorten-modes 'ement-room-mode) - (jao-tracking-cleaner "^\\*Ement Room: \\(.+\\)\\*" "@\\1")) - -;;;; startup (defun jao-chats (&optional p) (interactive "P") (when (or p (y-or-n-p "Connect to telegram? ")) @@ -1658,9 +1658,41 @@ (jao-exec-in-term (format "ssh %s" h) (format "*ssh %s*" h)))) ;;; Chats -(jao-when-linux (require 'jao-custom-chats)) - -;;;; Mastodon +;;;; telegram +(use-package telega + :ensure t + :custom + (telega-use-tracking-for '(unmuted) ;; '(or unmuted mention) + telega-rainbow-color-custom-for nil + telega-msg-rainbow-title nil + telega-sticker-set-download t + telega-symbol-checkmark "·" + telega-symbol-heavy-checkmark "×" + telega-symbol-verified "*") + :config + (define-key global-map (kbd "C-c C-t") telega-prefix-map) + (setq telega-chat-show-avatars nil + telega-chat-prompt-insexp '(telega-ins "> ") + telega-completing-read-function #'completing-read + telega-root-show-avatars nil + telega-emoji-use-images nil + telega-temp-dir "/tmp/telega" + telega-symbol-horizontal-bar + (propertize "-" 'face 'jao-themes-f00) + telega-symbol-vertical-bar + (propertize "| " 'face 'jao-themes-dimm) + telega-mode-line-string-format + '(:eval (telega-mode-line-unread-unmuted)) + telega-use-images (display-graphic-p) + telega-open-file-function #'jao--see + telega-open-message-as-file + (unless (display-graphic-p) '(photo video animation))) + (with-eval-after-load "tracking" + (jao-shorten-modes 'telega-chat-mode) + (jao-tracking-faces 'telega-tracking)) + (telega-mode-line-mode 1)) + +;;;; mastodon (use-package mastodon :ensure t :init @@ -1751,6 +1783,11 @@ ("?" "help" describe-mode) ("q" "quit" transient-quit-one)])) + +;;;; and more +(jao-when-linux (require 'jao-custom-chats)) + + ;;; Multimedia (jao-when-linux (require 'jao-custom-multimedia)) |
