From 7231f914813950d4282c3551251c886b4e3b9660 Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Thu, 21 Nov 2024 13:57:18 +0800 Subject: [PATCH 1/4] Automatically start Firefox on system startup. --- i3/.config/i3/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 8dc5468..d6451e0 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -218,3 +218,6 @@ bindsym --release Shift+Print exec --no-startup-id import -window root /tmp/`dat # Start Emacs in daemon mode and create a frame with mu4e in it exec emacs --daemon && emacsclient -c -e '(mu4e)' + +# Start Firefox on workspace 3 +exec --no-startup-id i3-msg 'workspace 3; exec firefox; workspace 1' -- 2.39.5 From 9a8ddc8d20d3bfba8cd4d6505c33c8bd22d78f47 Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Wed, 15 Jan 2025 18:43:38 +0800 Subject: [PATCH 2/4] Add line around new calendar entry and update large font. --- emacs/.emacs.d/init.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index ec85953..dec61b7 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -125,6 +125,7 @@ vc-follow-symlinks t (file+olp+datetree "~/Nextcloud/notes/calendar.org") "* %?\n :PROPERTIES:\n :location: %^{Location}\n :END:\n%^T--%^T\n\n" :jump-to-captured t + :empty-lines 1 :tree-type month :time-prompt t) ("p" "Permanent note" plain @@ -527,10 +528,9 @@ vc-follow-symlinks t (large-1 :default-family "Iosevka Nerd Font" :default-height 150 - :variable-pitch-family "Linux Biolinum O" + :variable-pitch-family "Literata" :variable-pitch-weight normal - :variable-pitch-height 1.1 - :italic-family "Iosevka Etoile" + :variable-pitch-height 1.0 :line-spacing 1) (regular-2 :default-family "Fira Mono Nerd Font" -- 2.39.5 From 0c9cb76069ba4951e8acd4edf8dc6072e2b51bf0 Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Mon, 3 Mar 2025 21:53:56 +0800 Subject: [PATCH 3/4] Improve R, music, spelling, note-taking and file browsing. --- emacs/.emacs.d/init.el | 61 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index dec61b7..e5c157d 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -53,6 +53,9 @@ vc-follow-symlinks t (load "/usr/share/emacs/site-lisp/ess/lisp/ess-site") (setq inferior-julia-program-name "/usr/bin/julia") +(use-package ess-view-data + :ensure t) + ;; enable autocomplete (use-package corfu :ensure t @@ -183,6 +186,8 @@ vc-follow-symlinks t ;; Usually a good idea to set the timezone manually (setq org-icalendar-timezone "Australia/Perth")) +(use-package org-protocol) + (use-package tex :ensure auctex :config @@ -232,10 +237,24 @@ vc-follow-symlinks t ;; If there is more than one, they won't work right. '(browse-url-browser-function 'browse-url-firefox) '(custom-safe-themes - '("8d146df8bd640320d5ca94d2913392bc6f763d5bc2bb47bed8e14975017eea91" "9a977ddae55e0e91c09952e96d614ae0be69727ea78ca145beea1aae01ac78d2" "0cf95236abcf59e05b1ea69b4edd53d293a5baec4fe4c3484543fee99bfd2204" "80b00f3bf7cdbdca6c80aadfbbb03145f3d0aacf6bf2a559301e61109954e30a" default)) + '("8d146df8bd640320d5ca94d2913392bc6f763d5bc2bb47bed8e14975017eea91" + "9a977ddae55e0e91c09952e96d614ae0be69727ea78ca145beea1aae01ac78d2" + "0cf95236abcf59e05b1ea69b4edd53d293a5baec4fe4c3484543fee99bfd2204" + "80b00f3bf7cdbdca6c80aadfbbb03145f3d0aacf6bf2a559301e61109954e30a" + default)) '(org-export-backends '(ascii html icalendar latex md odt)) '(package-selected-packages - '(devdocs straight calfw calfw-org engrave-faces org-caldav nov eat mu4e ellama emms mpdel-embark libmpdel pass password-store fontaine osm orderless embark-consult embark consult jinx dired-preview ftable flx nerd-icons-dired nerd-icons all-the-icons-dired marginalia vertico denote ox-rss org-ql org-contrib mustache org-static-blog haskell-mode julia-mode elfeed-protocol ack company magit auctex lsp-mode elpy ## org htmlize leuven-theme lua-mode ess-smart-underscore ess-R-data-view ess)) + '(## ack all-the-icons-dired auctex calfw calfw-org company consult + consult-denote denote devdocs dired-preview + dired-quick-sort eat elfeed-protocol ellama elpy embark + embark-consult emms engrave-faces ess ess-R-data-view + ess-smart-underscore ess-view-data flx fontaine ftable + haskell-mode htmlize jinx julia-mode leuven-theme libmpdel + lsp-mode lua-mode magit marginalia mpdel-embark mu4e + mustache nerd-icons nerd-icons-dired nov orderless org + org-caldav org-contrib org-ql org-static-blog osm ox-rss + pass password-store powerthesaurus request straight + vertico)) '(use-package-compute-statistics t)) (custom-set-faces ;; custom-set-faces was added by Custom. @@ -363,6 +382,7 @@ vc-follow-symlinks t (replace-match outfile t t nil 2))) (mapcar #'shell-command cmds))))) (add-hook 'message-send-hook 'mu4e-resize-image-attachments) + (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) ;; Attach files to messages using dired C-c RET C-a (defun mu4e-inhibit-resize() (interactive) (set (make-local-variable 'mu4e-inhibit-resize) t))) @@ -445,6 +465,25 @@ vc-follow-symlinks t (keymap-global-set "M-$" #'jinx-correct) :hook (emacs-startup . global-jinx-mode)) +(use-package powerthesaurus + :ensure t + :init + (require 'transient) + (transient-define-prefix my/transient-spelling () + "Spelling commands" + ["Spelling" + ["Lookups" + ("y" "Synonyms" powerthesaurus-lookup-synonyms-dwim) + ("a" "Antonyms" powerthesaurus-lookup-antonyms-dwim)] + ["Spelling Tools" + ("x" "Jinx" jinx-mode) + ("c" "Jinx correct" jinx-correct)] + ["Dictionary" + ("d" "Lookup" dictionary-lookup-definition)] + ["Miscellaneous" + ("q" "Quit" transient-quit-one)]]) + :bind + ("C-c s" . my/transient-spelling)) ;; Bind embark (use-package embark @@ -482,6 +521,9 @@ vc-follow-symlinks t (consult-mu-action #'consult-mu--view-action) ) +(use-package consult-denote + :ensure t) + ;; Configure `world-clock' (use-package time :ensure nil @@ -572,6 +614,21 @@ vc-follow-symlinks t :bind ("C-h D" . devdocs-lookup)) +(use-package emms + :ensure t + :config + (require 'emms-setup) + (require 'emms-player-mpd) + (emms-all) ; don't change this to values you see on stackoverflow questions if you expect emms to work + (setq emms-player-list '(emms-player-mpd)) + (add-to-list 'emms-info-functions 'emms-info-mpd) + (add-to-list 'emms-player-list 'emms-player-mpd) + + ;; Socket is not supported + (setq emms-player-mpd-server-name "mea-hookani-pila") + (setq emms-player-mpd-server-port "6600") + (emms-player-mpd-connect)) + ;; Custom functions ;; Might want to run this automatically -- 2.39.5 From 7c1ae2a1b7c0674664d97d06a61c232920a72b90 Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Wed, 5 Mar 2025 12:31:34 +0800 Subject: [PATCH 4/4] Support Org mode calendar management in full. * Retire secondary Nextcloud calendar. * Use default calendar for syncing with Org mode. * Update Org capture template to more easily set appointment duration. * Default explicitly to asking before deleting calendar events. --- emacs/.emacs.d/init.el | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index e5c157d..6f6fc16 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -114,7 +114,7 @@ vc-follow-symlinks t ("C-c a" . org-agenda)) :custom (org-default-notes-file "~/Nextcloud/notes/inbox.org") - (org-agenda-files `(,org-default-notes-file "~/Nextcloud/notes/calendar.org")) + (org-agenda-files `(,org-default-notes-file "~/Nextcloud/notes/calendar-nextcloud.org")) (org-capture-bookmark nil) ;; Capture templates (org-capture-templates @@ -125,8 +125,8 @@ vc-follow-symlinks t (file "~/Documents/belastingen/FY24-25.org") "* %t %a\n") ("a" "Appointment" entry - (file+olp+datetree "~/Nextcloud/notes/calendar.org") - "* %?\n :PROPERTIES:\n :location: %^{Location}\n :END:\n%^T--%^T\n\n" + (file+olp+datetree "~/Nextcloud/notes/calendar-nextcloud.org") + "* %?\n :PROPERTIES:\n :location: %^{Location}\n :END:\n%(fv/org-capture-appointment-timestamp)\n\n" :jump-to-captured t :empty-lines 1 :tree-type month @@ -142,7 +142,7 @@ vc-follow-symlinks t (file+headline org-default-notes-file "Tasks") "* TODO %i%?") ("e" "Email follow-up" entry (file+headline org-default-notes-file "Tasks") - "* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))"))) + "* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\") t)"))) ;; Agenda views (org-agenda-custom-commands '(("P" "Expired calendar events" ((tags "TIMESTAMP<=\"\""))) @@ -174,17 +174,29 @@ vc-follow-symlinks t '((R . t) (latex . t)))) +(defun fv/org-capture-appointment-timestamp (&optional duration) + "Get an Org timestamp for an appointment. +Prompt for a start time, calculate the end time by adding DURATION (default 30 +minutes), and return a formatted Org timestamp with start and end times." + (let* ((duration (or duration 30)) + (start-time (org-read-date t t nil "From:")) + (end-time (time-add start-time (seconds-to-time (* duration 60))))) + (concat (format-time-string (org-time-stamp-format t) start-time) + "--" + (format-time-string (org-time-stamp-format t) end-time)))) + (use-package org-caldav :ensure t :config (setq org-caldav-url "https://owncloud.vanrenterghem.biz/remote.php/dav/calendars/frederik") - (setq org-caldav-calendar-id "orgmode") + (setq org-caldav-calendar-id "default%20calendar") ;; Org filename where new entries from calendar stored - (setq org-caldav-inbox "~/Nextcloud/notes/calendar.org") + (setq org-caldav-inbox '(file+olp+datetree "~/Nextcloud/notes/calendar-nextcloud.org")) ;; Additional Org files to check for calendar events (setq org-caldav-files nil) ;; Usually a good idea to set the timezone manually - (setq org-icalendar-timezone "Australia/Perth")) + (setq org-icalendar-timezone "Australia/Perth") + (setq org-caldav-delete-calendar-entries 'ask)) (use-package org-protocol) -- 2.39.5