About time I update these, too, I guess

This commit is contained in:
Jeffrey Serio 2024-02-14 23:34:05 -06:00
parent a9a9b7ccea
commit 697b11dd51
3 changed files with 23 additions and 175 deletions

178
config.el
View File

@ -6,39 +6,35 @@
;; start Emacs as a server process
(server-start)
;; user info
(setq user-full-name "Jeffrey Serio"
user-mail-address "hyperreal@fedoraproject.org")
(setq doom-user-dir "~/sync/doom/")
(after! projectile
(setq projectile-project-root-files-bottom-up
(remove ".git" projectile-project-root-files-bottom-up)))
;; This sets the frame dimensions and position on the screen when on moonshadow host.
;; Also sets the font size for moonshadow host.
(when (string= (system-name) "moonshadow")
(setq fontsize 18)
;; This sets the frame dimensions and position take up the right half
;; of the screen when the host is default.ravenwatch, which has an
;; ultra-wide monitor.
(when (string= (system-name) "default.ravenwatch")
(setq default-frame-alist
'((height . 54)
'((height . 55)
(width . 154)
(left . 1720)
(top . 0)
(vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil))))
;; This sets the frame to be full screen maximized on evergloam host.
;; Also sets the font size for evergloam host.
(when (string= (system-name) "evergloam")
(setq fontsize 18)
;; This sets the frame to be fullscreen and maximized when the host is
;; default.evergloam, which is my 15-inch screen laptop.
(when (string= (system-name) "default.evergloam")
(add-to-list 'default-frame-alist '(fullscreen . maximized)))
;; Set fonts
(setq fontsize 18)
(setq monofontfam "JetBrainsMono Nerd Font Mono")
(setq doom-font (font-spec :family monofontfam :size fontsize)
doom-variable-pitch-font (font-spec :family "Rubik")
doom-unicode-font (font-spec :family monofontfam :size fontsize)
doom-variable-pitch-font (font-spec :family monofontfam :size fontsize)
doom-symbol-font (font-spec :family monofontfam :size fontsize)
doom-big-font (font-spec :family monofontfam :size fontsize))
;; Use catppuccin-mocha theme
@ -132,7 +128,7 @@ Version 2015-08-22"
(defun browse-host-web (url &rest ignored)
"Browse URL with Firefox/LibreWolf"
(interactive "sURL: ")
(shell-command (concat "librewolf " url)))
(shell-command (concat "distrobox-host-exec firefox " url)))
(setq browse-url-browser-function 'browse-host-web)
@ -171,28 +167,6 @@ If point was already at that position, move point to beginning of line."
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)))
;;;; artbollocks-mode
;;;; https://github.com/sachac/artbollocks-mode
(setq artbollocks-weasel-words-regex
(concat "\\b" (regexp-opt
'("one of the"
"should"
"just"
"etc"
"sort of"
"kind of"
"a lot"
"probably"
"maybe"
"perhaps"
"I think"
"really"
"pretty"
"utilize"
"leverage") t) "\\b"))
;;;; undo-tree-mode - visualize undos and branches
(global-undo-tree-mode)
@ -371,9 +345,6 @@ If point was already at that position, move point to beginning of line."
(add-hook! python-mode-hook
(setq python-shell-interpreter "bpython"))
;; enable elpy
(elpy-enable)
;; set tab width; use flake8 as python-flymake-command, python-check-command
(setq python-indent-offset 4)
(add-hook 'python-mode-hook
@ -428,12 +399,14 @@ If point was already at that position, move point to beginning of line."
;;;; helpful
(global-set-key (kbd "C-h f") #'helpful-callable)
(global-set-key (kbd "C-h v") #'helpful-variable)
(global-set-key (kbd "C-h k") #'helpful-key)
(global-set-key (kbd "C-h x") #'helpful-command)
(global-set-key (kbd "C-c C-d") #'helpful-at-point)
;;;; dired
(after! dired
@ -508,16 +481,6 @@ If point was already at that position, move point to beginning of line."
)))
;;;; elfeed
(setq elfeed-protocol-enabled-protocols '(fever))
(elfeed-protocol-enable)
(setq elfeed-protocol-fever-update-unread-only t)
(setq elfeed-protocol-feeds '(("fever+https://admin@rss.hyperreal.coffee"
:api-url "https://rss.hyperreal.coffee/fever/"
:password (shell-command-output-string "pass show miniflux/admin"))))
;; ;; elpher
(setq elpher-certificate-directory "~/sync/elpher/certs")
@ -544,116 +507,3 @@ and switch to it."
(rename-buffer mvterm-buffer-name)
(message "Created and started: %s" mvterm-buffer-name)
(switch-to-buffer mvterm-buffer-name)))
(defun hyperreal/setup-mvterm ()
"Create a set of vterm buffers for my terminal setup."
(interactive)
(require 'vterm)
(let ((buffer-command-pairs '(("journald" . "sudo journalctl -f")
("htop" . "htop")
("nexus" . "autossh -M 0 jas@nexus.local")
("apocrypha" . "autossh -M 0 jas@apocrypha.local")
("rockpro64" . "autossh -M 0 dietpi@rockpro64.local")
("orangepi5" . "autossh -M 0 dietpi@orangepi5.local"))))
(dolist (pair buffer-command-pairs)
(let ((buffer-name (car pair))
(command (cdr pair)))
;; Check if buffer exists
(unless (get-buffer buffer-name)
(multi-vterm)
(rename-buffer buffer-name)
;; Send the command to the vterm buffer
(vterm-send-string command)
(vterm-send-return)
(message "Created and started: %s" buffer-name))))
;; Create and switch to default buffer
(hyperreal/create-mvterm-buffer)
(centaur-tabs-mode)))
(defun hyperreal/kill-all-vterms ()
"Kill all vterm buffers (do not ask for confirmation)."
(interactive)
(let ((kill-buffer-query-functions nil))
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (eq major-mode 'vterm-mode)
(kill-buffer buffer)))))
(message "All vterm buffers killed."))
;;;; ERC
(setq erc-timestamp-format "[%H:%M:%S] ")
(setq erc-insert-timestamp-function 'erc-insert-timestamp-left)
(setq erc-fill-prefix " ")
(setq erc-fill-function 'erc-fill-static)
(setq erc-hide-list '("JOIN" "PART" "QUIT"))
(defun tilde-chat ()
"Connect to irc.tilde.chat."
(interactive)
(setq erc-email-userid "hyperreal/irc.tilde.chat")
(erc-tls :server "chat.sr.ht"
:port 6697
:nick "hyperreal"
:password (shell-command-output-string "pass show chat.sr.ht/hyperreal")
:full-name "Jeffrey Serio")
(centaur-tabs-mode))
(defun libera-chat ()
"Connect to irc.libera.chat."
(interactive)
(setq erc-email-userid "hyperreal/irc.libera.chat")
(erc-tls :server "chat.sr.ht"
:port 6697
:nick "hyperreal"
:password (shell-command-output-string "pass show chat.sr.ht/hyperreal")
:full-name "Jeffrey Serio")
(centaur-tabs-mode))
;; nickcolor funcs lifted from EmacsWiki
(defmacro unpack-color (color red green blue &rest body)
`(let ((,red (car ,color))
(,green (car (cdr ,color)))
(,blue (car (cdr (cdr ,color)))))
,@body))
(defun rgb-to-html (color)
(unpack-color color red green blue
(concat "#" (format "%02x%02x%02x" red green blue))))
(defun hexcolor-luminance (color)
(unpack-color color red green blue
(floor (+ (* 0.299 red) (* 0.587 green) (* 0.114 blue)))))
(defun invert-color (color)
(unpack-color color red green blue
`(,(- 255 red) ,(- 255 green) ,(- 255 blue))))
(defun erc-get-color-for-nick (nick dark)
(let* ((hash (md5 (downcase nick)))
(red (mod (string-to-number (substring hash 0 10) 16) 256))
(blue (mod (string-to-number (substring hash 10 20) 16) 256))
(green (mod (string-to-number (substring hash 20 30) 16) 256))
(color `(,red ,green ,blue)))
(rgb-to-html (if (if dark (< (hexcolor-luminance color) 85)
(> (hexcolor-luminance color) 170))
(invert-color color)
color))))
(defun erc-highlight-nicknames ()
(save-excursion
(goto-char (point-min))
(while (re-search-forward "\\w+" nil t)
(let* ((bounds (bounds-of-thing-at-point 'symbol))
(nick (buffer-substring-no-properties (car bounds) (cdr bounds))))
(when (erc-get-server-user nick)
(put-text-property
(car bounds) (cdr bounds) 'face
(cons 'foreground-color (erc-get-color-for-nick nick 't))))))))
(add-hook 'erc-insert-modify-hook 'erc-highlight-nicknames)
;; set the column width based on window width
(add-hook 'window-configuration-change-hook
#'(lambda ()
(setq erc-fill-column (- (window-width) 2))))

14
init.el
View File

@ -81,7 +81,7 @@
:checkers
syntax ; tasing you for every semicolon you forget
(spell +flyspell) ; tasing you for misspelling mispelling
;; (spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make
:tools
@ -152,7 +152,7 @@
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother
@ -178,16 +178,16 @@
;;zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
;; (mu4e +org +gmail)
;; notmuch
;; (wanderlust)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;; irc ; how neckbeards socialize
;; (rss +org) ; emacs as an RSS reader
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config

View File

@ -7,12 +7,10 @@
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package)
(package! artbollocks-mode
:recipe (:host github :repo "sachac/artbollocks-mode"))
(package! apheleia)
(package! autothemer)
(package! catppuccin-theme)
(package! elfeed)
(package! elfeed-goodies)
(package! elfeed-protocol)
(package! elpher)
(package! elpy)
@ -24,11 +22,11 @@
(package! helpful)
(package! importmagic)
(package! just-mode)
(package! justl)
(package! license-templates)
(package! multi-vterm)
(package! nov)
(package! org-roam)
(package! org-static-blog)
(package! org-superstar)
(package! python-docstring)
(package! shell-pop)