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 ;; start Emacs as a server process
(server-start) (server-start)
;; user info
(setq user-full-name "Jeffrey Serio"
user-mail-address "hyperreal@fedoraproject.org")
(setq doom-user-dir "~/sync/doom/") (setq doom-user-dir "~/sync/doom/")
(after! projectile (after! projectile
(setq projectile-project-root-files-bottom-up (setq projectile-project-root-files-bottom-up
(remove ".git" 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. ;; This sets the frame dimensions and position take up the right half
;; Also sets the font size for moonshadow host. ;; of the screen when the host is default.ravenwatch, which has an
(when (string= (system-name) "moonshadow") ;; ultra-wide monitor.
(setq fontsize 18) (when (string= (system-name) "default.ravenwatch")
(setq default-frame-alist (setq default-frame-alist
'((height . 54) '((height . 55)
(width . 154) (width . 154)
(left . 1720) (left . 1720)
(top . 0) (top . 0)
(vertical-scroll-bars . nil) (vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil)))) (horizontal-scroll-bars . nil))))
;; This sets the frame to be full screen maximized on evergloam host. ;; This sets the frame to be fullscreen and maximized when the host is
;; Also sets the font size for evergloam host. ;; default.evergloam, which is my 15-inch screen laptop.
(when (string= (system-name) "evergloam") (when (string= (system-name) "default.evergloam")
(setq fontsize 18)
(add-to-list 'default-frame-alist '(fullscreen . maximized))) (add-to-list 'default-frame-alist '(fullscreen . maximized)))
;; Set fonts ;; Set fonts
(setq fontsize 18)
(setq monofontfam "JetBrainsMono Nerd Font Mono") (setq monofontfam "JetBrainsMono Nerd Font Mono")
(setq doom-font (font-spec :family monofontfam :size fontsize) (setq doom-font (font-spec :family monofontfam :size fontsize)
doom-variable-pitch-font (font-spec :family "Rubik") doom-variable-pitch-font (font-spec :family monofontfam :size fontsize)
doom-unicode-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)) doom-big-font (font-spec :family monofontfam :size fontsize))
;; Use catppuccin-mocha theme ;; Use catppuccin-mocha theme
@ -132,7 +128,7 @@ Version 2015-08-22"
(defun browse-host-web (url &rest ignored) (defun browse-host-web (url &rest ignored)
"Browse URL with Firefox/LibreWolf" "Browse URL with Firefox/LibreWolf"
(interactive "sURL: ") (interactive "sURL: ")
(shell-command (concat "librewolf " url))) (shell-command (concat "distrobox-host-exec firefox " url)))
(setq browse-url-browser-function 'browse-host-web) (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))) (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 ;;;; undo-tree-mode - visualize undos and branches
(global-undo-tree-mode) (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 (add-hook! python-mode-hook
(setq python-shell-interpreter "bpython")) (setq python-shell-interpreter "bpython"))
;; enable elpy
(elpy-enable)
;; set tab width; use flake8 as python-flymake-command, python-check-command ;; set tab width; use flake8 as python-flymake-command, python-check-command
(setq python-indent-offset 4) (setq python-indent-offset 4)
(add-hook 'python-mode-hook (add-hook 'python-mode-hook
@ -428,12 +399,14 @@ If point was already at that position, move point to beginning of line."
;;;; helpful ;;;; helpful
(global-set-key (kbd "C-h f") #'helpful-callable) (global-set-key (kbd "C-h f") #'helpful-callable)
(global-set-key (kbd "C-h v") #'helpful-variable) (global-set-key (kbd "C-h v") #'helpful-variable)
(global-set-key (kbd "C-h k") #'helpful-key) (global-set-key (kbd "C-h k") #'helpful-key)
(global-set-key (kbd "C-h x") #'helpful-command) (global-set-key (kbd "C-h x") #'helpful-command)
(global-set-key (kbd "C-c C-d") #'helpful-at-point) (global-set-key (kbd "C-c C-d") #'helpful-at-point)
;;;; dired ;;;; dired
(after! 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 ;; ;; elpher
(setq elpher-certificate-directory "~/sync/elpher/certs") (setq elpher-certificate-directory "~/sync/elpher/certs")
@ -544,116 +507,3 @@ and switch to it."
(rename-buffer mvterm-buffer-name) (rename-buffer mvterm-buffer-name)
(message "Created and started: %s" mvterm-buffer-name) (message "Created and started: %s" mvterm-buffer-name)
(switch-to-buffer 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))))

View File

@ -81,7 +81,7 @@
:checkers :checkers
syntax ; tasing you for every semicolon you forget 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 ;;grammar ; tasing grammar mistake every you make
:tools :tools
@ -152,7 +152,7 @@
;;lua ; one-based indices? one-based indices ;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c ;;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 ;;ocaml ; an objective camel
org ; organize your plain life in plain text org ; organize your plain life in plain text
;;php ; perl's insecure younger brother ;;php ; perl's insecure younger brother
@ -180,7 +180,7 @@
:email :email
;; (mu4e +org +gmail) ;; (mu4e +org +gmail)
;; notmuch ;; notmuch
;;(wanderlust +gmail) ;; (wanderlust)
:app :app
;;calendar ;;calendar

View File

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