From b8e9d592aa703580acada44e6876db228b86b4d4 Mon Sep 17 00:00:00 2001 From: Jakub Date: Fri, 14 Nov 2025 12:03:45 +0800 Subject: [PATCH] Add startup notification Add better pdftools and ready player toggle Add org-roam toggle based on directory location Add paradox modding support --- init.el | 4 + userland/dired-custom.el | 8 +- workflows/org-custom.el | 193 ++++++++++++++++++----------------- workflows/paradox-modding.el | 34 ++++++ 4 files changed, 139 insertions(+), 100 deletions(-) create mode 100644 workflows/paradox-modding.el diff --git a/init.el b/init.el index 939d5a9..b655b25 100644 --- a/init.el +++ b/init.el @@ -85,3 +85,7 @@ (load-directory (concat user-emacs-directory "workflows")) ;; Custom screens (load-directory (concat user-emacs-directory "screens")) + +(unless (fboundp 'notifications-notify) + (require 'notifications)) +(notifications-notify :title "Emacs Server Started" :app-name "Emacs") diff --git a/userland/dired-custom.el b/userland/dired-custom.el index 1ee78c5..6d8b884 100644 --- a/userland/dired-custom.el +++ b/userland/dired-custom.el @@ -51,27 +51,27 @@ :config (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)) -(defcustom theurgy-enable-pdf-tools-windows nil +(defcustom theurgy-enable-pdf-tools (equal system-type 'gnu/linux) "Whether `pdf-tools' should be enabled on Windows sytems." :type 'boolean :group 'theurgy :group 'theurgy-compat) -(defcustom theurgy-enable-ready-player-windows nil +(defcustom theurgy-enable-ready-player (equal system-type 'gnu/linux) "Whether `ready-player' should be enabled on Windows sytems." :type 'boolean :group 'theurgy :group 'theurgy-compat) ;; Multimedia and PDF viewing -(when (or (equal system-type 'gnu/linux) theurgy-enable-ready-player-windows) +(when theurgy-enable-ready-player-windows (use-package ready-player :ensure t :config (setq ready-player-autoplay nil) (ready-player-mode 1))) -(when (or (equal system-type 'gnu/linux) theurgy-enable-pdf-tools-windows) +(when theurgy-enable-pdf-tools-windows (use-package pdf-tools :config (pdf-loader-install))) diff --git a/workflows/org-custom.el b/workflows/org-custom.el index 1a65a6e..214b640 100644 --- a/workflows/org-custom.el +++ b/workflows/org-custom.el @@ -55,7 +55,7 @@ org-agenda-skip-scheduled-if-done t ;; Don't show done stuff in the agenda view org-agenda-skip-deadline-if-done t org-agenda-skip-timestamp-if-done t - + org-todo-keywords '((sequence "TODO(t)" "WIP(w)" "DELEGATED(p)" "WAITING(?)" "|" "CANCELLED(x)" "DONE(d)")) ;; Some extra keywords in addition to TODO and DONE org-use-fast-todo-selection t ;; Always use fast selection org-refile-targets '((org-agenda-files :maxlevel . 2)) ;; Allow any agenda files to be refile targets. @@ -543,112 +543,113 @@ (window-width . 0.2)))) ;; Org roam -(use-package org-roam - :straight nil - :ensure t - :init - (setq org-roam-v2-ack t) - :custom - (org-roam-directory (file-truename "~/.org/lore/")) - (org-roam-dailies-directory (file-truename "~/.org/lore/refined/journal/")) - (org-roam-file-exclude-regexp "\\.git/.*\\|logseq/.*$") - (org-roam-completion-everywhere) - (org-roam-capture-templates - '(("r" "Raw") - ("rr" "Note" plain - "%?" - :target (file+head "raw/${slug}.org" "#+title: ${title}\n") - :unnarrowed t) - ("rq" "Question" plain - "%?" - :target (file+head "raw/${slug}.org" "#+title: ${title}\n#+filetags: :question:") - :unnarrowed t) - ("i" "Index" plain - "%?" - :target (file+head "raw/${slug}.org" "#+title: ${title} - Index\n#+filetags: :index:") - :unnarrowed t) - ("R" "Refined") - ("Rm" "Mini-essay" plain - "%?" - :target (file+head "refined/wiki/${slug}.org" "#+title: ${title}\n#+author: Jakub Nowak\n#+filetags: :mini-essay:") - :unnarrowed t) - ("Re" "Essay" plain - "%?" - :target (file+head "refined/wiki/${slug}.org" "#+title: ${title}\n#+author: Jakub Nowak\n#+filetags: :essay:") - :unnarrowed t))) - (org-roam-dailies-capture-templates - '(("d" "default" entry - "* %?" - :target (file+head "%<%Y-%m-%d>.org" ;; format matches Logseq - "#+title: %<%Y-%m-%d>\n")))) - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n g" . org-roam-graph) - ("C-c n i" . org-roam-node-insert) - ("C-c n c" . org-roam-capture) - :map org-roam-dailies-map - ("Y" . org-roam-dailies-capture-yesterday) - ("T" . org-roam-dailies-capture-tomorrow)) - :bind-keymap ("C-c n d" . org-roam-dailies-map) - :config - (require 'org-roam-dailies) ;; Ensure the keymap is available - (org-roam-db-autosync-mode)) +(when (file-directory-p "~/.org/lore") + (use-package org-roam + :straight nil + :ensure t + :init + (setq org-roam-v2-ack t) + :custom + (org-roam-directory (file-truename "~/.org/lore/")) + (org-roam-dailies-directory (file-truename "~/.org/lore/refined/journal/")) + (org-roam-file-exclude-regexp "\\.git/.*\\|logseq/.*$") + (org-roam-completion-everywhere) + (org-roam-capture-templates + '(("r" "Raw") + ("rr" "Note" plain + "%?" + :target (file+head "raw/${slug}.org" "#+title: ${title}\n") + :unnarrowed t) + ("rq" "Question" plain + "%?" + :target (file+head "raw/${slug}.org" "#+title: ${title}\n#+filetags: :question:") + :unnarrowed t) + ("i" "Index" plain + "%?" + :target (file+head "raw/${slug}.org" "#+title: ${title} - Index\n#+filetags: :index:") + :unnarrowed t) + ("R" "Refined") + ("Rm" "Mini-essay" plain + "%?" + :target (file+head "refined/wiki/${slug}.org" "#+title: ${title}\n#+author: Jakub Nowak\n#+filetags: :mini-essay:") + :unnarrowed t) + ("Re" "Essay" plain + "%?" + :target (file+head "refined/wiki/${slug}.org" "#+title: ${title}\n#+author: Jakub Nowak\n#+filetags: :essay:") + :unnarrowed t))) + (org-roam-dailies-capture-templates + '(("d" "default" entry + "* %?" + :target (file+head "%<%Y-%m-%d>.org" ;; format matches Logseq + "#+title: %<%Y-%m-%d>\n")))) + :bind (("C-c n l" . org-roam-buffer-toggle) + ("C-c n f" . org-roam-node-find) + ("C-c n g" . org-roam-graph) + ("C-c n i" . org-roam-node-insert) + ("C-c n c" . org-roam-capture) + :map org-roam-dailies-map + ("Y" . org-roam-dailies-capture-yesterday) + ("T" . org-roam-dailies-capture-tomorrow)) + :bind-keymap ("C-c n d" . org-roam-dailies-map) + :config + (require 'org-roam-dailies) ;; Ensure the keymap is available + (org-roam-db-autosync-mode)) -(defun org-roam-create-node-from-headline () - "Create an Org-roam note from the current headline and jump to it. + (defun org-roam-create-node-from-headline () + "Create an Org-roam note from the current headline and jump to it. Normally, insert the headline’s title using the ’#title:’ file-level property and delete the Org-mode headline. However, if the current headline has a Org-mode properties drawer already, keep the headline and don’t insert ‘#+title:'. Org-roam can extract the title from both kinds of notes, but using ‘#+title:’ is a bit cleaner for a short note, which Org-roam encourages." - (interactive) - (let ((title (nth 4 (org-heading-components))) - (has-properties (org-get-property-block))) - (org-cut-subtree) - (org-roam-find-file title nil nil 'no-confirm) - (org-paste-subtree) - (unless has-properties - (kill-line) - (while (outline-next-heading) - (org-promote))) - (goto-char (point-min)) - (when has-properties - (kill-line) - (kill-line)))) + (interactive) + (let ((title (nth 4 (org-heading-components))) + (has-properties (org-get-property-block))) + (org-cut-subtree) + (org-roam-find-file title nil nil 'no-confirm) + (org-paste-subtree) + (unless has-properties + (kill-line) + (while (outline-next-heading) + (org-promote))) + (goto-char (point-min)) + (when has-properties + (kill-line) + (kill-line)))) -(use-package logseq-org-roam - :straight (:host github - :repo "sbougerel/logseq-org-roam" - :files ("*.el"))) + (use-package logseq-org-roam + :straight (:host github + :repo "sbougerel/logseq-org-roam" + :files ("*.el"))) -(transient-define-prefix org-roam-menu () - "Transient menu for task management shortcuts." - ["Node" ("c" "Capture" org-roam-node-find) - ("i" "Insert" org-roam-node-insert) - ("r" "Refile" org-roam-create-node-from-headline) - ("f" "Find" org-roam-node-find) ] - ["Dailies" ("t" "Today" org-roam-dailies-capture-today) - ("y" "Yesterday" org-roam-dailies-capture-yesterday) - ("n" "Tomorrow" org-roam-dailies-capture-tomorrow)] - ["Logseq" ("R" "Fix links" logseq-org-roam)] - ["Org Roam UI" ("U" "Enable org-roam-ui-mode" org-roam-ui-mode)]) + (transient-define-prefix org-roam-menu () + "Transient menu for task management shortcuts." + ["Node" ("c" "Capture" org-roam-node-find) + ("i" "Insert" org-roam-node-insert) + ("r" "Refile" org-roam-create-node-from-headline) + ("f" "Find" org-roam-node-find) ] + ["Dailies" ("t" "Today" org-roam-dailies-capture-today) + ("y" "Yesterday" org-roam-dailies-capture-yesterday) + ("n" "Tomorrow" org-roam-dailies-capture-tomorrow)] + ["Logseq" ("R" "Fix links" logseq-org-roam)] + ["Org Roam UI" ("U" "Enable org-roam-ui-mode" org-roam-ui-mode)]) -(define-key global-map (kbd "C-c o n") #'org-roam-menu) + (define-key global-map (kbd "C-c o n") #'org-roam-menu) -(use-package org-roam-ui - :straight - (:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out")) - :after org-roam - ;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have - ;; a hookable mode anymore, you're advised to pick something yourself - ;; if you don't care about startup time, use - :hook (after-init . org-roam-ui-mode) - :config - (setq org-roam-ui-sync-theme t - org-roam-ui-follow t - org-roam-ui-update-on-save t - org-roam-ui-open-on-start nil)) + (use-package org-roam-ui + :straight + (:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out")) + :after org-roam + ;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have + ;; a hookable mode anymore, you're advised to pick something yourself + ;; if you don't care about startup time, use + :hook (after-init . org-roam-ui-mode) + :config + (setq org-roam-ui-sync-theme t + org-roam-ui-follow t + org-roam-ui-update-on-save t + org-roam-ui-open-on-start nil))) ;; Bibliography stuff (setq bibtex-dialect 'biblatex) ;; Use biblatex instead of bibtex. diff --git a/workflows/paradox-modding.el b/workflows/paradox-modding.el new file mode 100644 index 0000000..a7f02ef --- /dev/null +++ b/workflows/paradox-modding.el @@ -0,0 +1,34 @@ +;;; paradox-modding.el --- Tools for paradox game modding. -*- lexical-binding: t -*- + +;; This file is not part of GNU Emacs + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + + +;;; Commentary: + +;; commentary + +;;; Code: + +(use-package jomini-mode + :straight (jomini-mode + :type git + :host nil + :repo "https://git.cyan.sh/BirDt/jomini.el.git" + :files ("*.el"))) + +(provide 'paradox-modding) + +;;; paradox-modding.el ends here