Auxillary and Optional Applications

Table of Contents

A literate programming file for helper apps in Emacs.

Introduction

The following applications are not needed. I alternate between trying to stay in Emacs taking advantage of the consistent interface, and using a stand-alone app on my Workday computer.

Federation

Mastodon

Glad to see the 2FA feature is working on the mastodon.el project, and even more glad to see the great birdland diaspora arrive in the land of the toots.

(use-package mastodon
  :straight (:host codeberg :repo "martianh/mastodon.el")
  :init
  (setq mastodon-instance-url "https://emacs.ch"
        mastodon-active-user "howard"))

I would like a dedicate perspective to Mastodon, and I would like a leader key sequence that expands will all options, once Mastodon is running in its own perspective:

(use-package mastodon
  :config
  (defun mastodon-perspective ()
    (interactive)
    (let ((already-tooted? (seq-contains-p
                            (persp-names) "mastodon" 'equal)))
      (persp-switch "mastodon")
      (unless already-tooted?
        (ha-local-leader :keymaps 'mastodon-mode-map
          ;; "," '("thread" . mastodon-tl--thread)
          "t" '("toot" . mastodon-toot)
          "u" '("update" . mastodon-tl--update)
          "f" '("favorite" . mastodon-toot--toggle-favourite)
          "b" '("boost" . mastodon-toot--toggle-boost)
          "r" '("reply" . mastodon-toot--reply)
          "s" '("share" . mastodon-toot--copy-toot-url)
          "y" '("copy text" . mastodon-toot--copy-toot-text)
          "d" '("discover" . mastodon-discover))
        (my-mastodon-start))))

  (ha-leader
    "a m" '("mastodon" . mastodon-perspective)))

Let’s turn on non-fixed-width fonts to make everything easier to read:

(use-package mastodon
   :hook (mastodon-mode . variable-pitch-mode))

Starting the mastodon perspective, I set some initial windows:

(defun my-mastodon-start ()
  "Configure the window placement for a Mastodon Instance."
  (let ((default-directory (getenv "HOME")))
    (mastodon)
    (switch-to-buffer "*mastodon-home*")
    (split-window-right)
    (mastodon-tl--get-local-timeline)
    (switch-to-buffer "*mastodon-local*")))

Matrix/Element

Yet another encrypted chat/VoIP client-server, but unlike Signal and Telegram, is act ually open source. In other words, a project for nerds. We’ll be using Alphapapa’s latest ement project.

(use-package ement
  :straight (:host github :repo "alphapapa/ement.el")
  :config
  (defun ha-ement-connect ()
    (interactive)
    (let* ((auth-results (auth-source-search :host "howardism-matrix"))
           (auth-first   (first auth-results))
           (username     (plist-get auth-first :user))
           (password     (funcall (plist-get auth-first :secret))))
      (ement-connect :user-id username
                     :password password
                     :uri-prefix "https://howardism.org"))

    (ha-leader
        "a x S" '("send" . ement-send-direct-message)
        "a x s" '("send" . ement-room-send-message)
        "a x c" '("compose" . ement-room-compose-message)
        "a x r" '("room" . ement-view-room)
        "a x d" '("discover" . mastodon-discover)))

  (ha-leader
    "a x"   '(:ignore t :which-key "matrix")
    "a x x" '("connect" . ha-ement-connect)
    "a x s" '("send" . ement-send-direct-message)))

Perhaps we can make it more attractive:

(use-package ement
  :hook (ement-room-mode . ha-textual-litagures)
  :init
  (setq ement-save-sessions t
        ement-room-send-message-filter 'ement-room-send-org-filter))

Other

Twitter

The venerable twittering-mode allows me to follow all the twits.

(use-package twittering-mode
  :init
  (setq twittering-use-master-password t
        epa-pinentry-mode 'loopback)
  :config
  (defalias 'epa--decode-coding-string 'decode-coding-string)
  (ha-leader "a t" '("twitter" . twit)))

And we are no longer using this package.

Telega

I'm thinking the Telega package would be better than Bitlbee for Telegram communication.

(use-package telega
    :commands (telega)
    :config
    (setq telega-user-use-avatars nil
      telega-use-tracking-for nil ; '(any pin unread)
      telega-chat-use-markdown-formatting t
      telega-emoji-use-images t
      ; telega-completing-read-function #'ivy-completing-read
      telega-msg-rainbow-title nil)

    (when (fboundp 'evil-insert-state)
      (add-hook 'telega-chat-mode-hook 'evil-insert-state))

    (ha-leader "a t" 'telega))

For some reason, you need rainbow-identifiers to work, oh, I guess the docs state this.

In the Telega chat’s, let’s turn on non-fixed-width fonts:

(use-package telega
   :hook (telega-chat-mode . variable-pitch-mode))

RPG DM

Been working on my RPG DM project for getting Emacs helping as a Dungeon Master's Assistant. The idea is to be able to roll dice and whatnot. What I find most useful is the random tables.

(when (f-directory? "~/other/emacs-rpgdm")
  (use-package rpgdm
    :straight (:local-repo "~/other/emacs-rpgdm")
    :commands (rpgdm-mode rpgdm-tables-load)
    :init (setq rpgdm-base (expand-file-name "~/other/emacs-rpgdm"))
    :config (ha-leader "t D" '("rpg dm" . rpgdm-mode))))

And my new Ironsworn project expands on it, giving me both the Oracles and the Moves. With an Org file, I can easily play Solo:

(when (f-directory? "~/other/emacs-ironsworn")
  (use-package rpgdm-ironsworn
    :after rpgdm
    :straight (:local-repo "~/other/emacs-ironsworn")
    :init
    (setq rpgdm-ironsworn-project (expand-file-name "~/other/emacs-ironsworn")
          ;; Ignore org links that call my RPG functions:
          org-link-elisp-skip-confirm-regexp (rx string-start (optional "(") "rpgdm-"
                                                 (or "tables-" "ironsworn-")
                                                 (one-or-more any)))))

The project is interesting, and I should record a tutorial how to use it.

Playing Music

Why not? Let’s see if the empv project is sufficient. First install mpv, as in:

brew install mpv

What else?

(use-package empv
  :straight (:host github :repo "isamert/empv.el")
  :general (ha-leader
             "a p" '(empv-map :wk "play music")))