After reading some of the features of Mastodon that Sacha has fixed, I decided to steal and extend.
6.9 KiB
Auxillary and Optional Applications
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.
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)))
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 (:repo "https://codeberg.org/martianh/mastodon.el")
:init
(setq mastodon-instance-url "https://emacs.ch"
mastodon-active-user "howard")
:bind
(:map mastodon-mode-map
("g" . mastodon-tl--update)
("@" . my-mastodon-mentions)))
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-leader
"a m t" '("toot" . mastodon-toot)
"a m u" '("update" . mastodon-tl--update)
"a m d" '("discover" . mastodon-discover))
(my-mastodon-start))))
(ha-leader
"a m" '(:ignore t :which-key "mastodon")
"a m m" '("perspective" . mastodon-perspective)))
Starting the mastodon
perspective, could set things up:
(defun my-mastodon-start ()
"Configure the window placement for a Mastodon Instance."
(let ((default-directory (getenv "HOME")))
(mastodon)
(split-window-right)
(mastodon-tl--get-local-timeline)
(split-window-right)
(my-mastodon-mentions)))
What about a timeline of just call-outs to me?
(defun mastodon-mentions--timeline (json)
"Format JSON in Emacs buffer."
(if (seq-empty-p json)
(message "Looks like you have no (more) notifications for the moment.")
(mapc #'mastodon-notifications--by-type json)
(goto-char (point-min))))
(defun my-mastodon-mentions ()
"Display mentions in buffer."
(interactive)
(mastodon-tl--init-sync
"mentions"
"notifications?exclude_types=follow,favourite,reblog,poll,follow_request&limit=50"
'mastodon-mentions--timeline))
Now I need to make a function to paste the same message to both while we make a transition.
(defun my-mastodon-toot-public-string (message)
(interactive "sMessage: ")
(let* ((endpoint (mastodon-http--api "statuses"))
(args `(("status" . ,message)
("visibility" . "public"))))
(mastodon-http--post endpoint args nil)))
Telega
I'm thinking the Telega package would be better than Bitlbee for Telegram communication. Seems to have a bug on the Melpa version, so I'm keeping this to the HEAD
, if I've cloned it.
(when (file-exists-p "~/other/telega.el")
(use-package telega
:straight (:local-repo "~/other/telega.el")
:commands (telega)
:init
(setq telega-use-images nil)
:config
(ha-leader "a T" 'telega)))
For some reason, you need rainbow-identifiers to work, oh, I guess the docs state this.
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/rpgdm")
(use-package rpgdm
:straight (:local-repo "~/other/rpgdm")
:commands (rpgdm-mode rpgdm-tables-load)
:init (setq rpgdm-base (expand-file-name "~/other/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.