Compare commits

...

12 commits

5 changed files with 140 additions and 22 deletions

Binary file not shown.

View file

@ -41,7 +41,17 @@ For using the Macbook keyboard effectively with Emacs I made some adjustments ba
(setq mac-option-modifier 'alt)
(setq mac-right-option-modifier 'none)
(setq mac-command-modifier 'meta)
(global-set-key [kp-delete] 'delete-char))
(global-set-key [kp-delete] 'delete-char)
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(setq ns-pop-up-frames nil))
#+end_src
Additionally, getting the correct path in the App executable is apparently not that simply. Thankfully, [[https://www.sanityinc.com/][Steve Purcell]] wrote the [[https://github.com/purcell/exec-path-from-shell][exec-path-from-shell]] helper.
#+begin_src emacs-lisp
(use-package exec-path-from-shell
:when on-macos
:init (exec-path-from-shell-initialize))
#+end_src
** System Detection
@ -54,7 +64,6 @@ My work machine is called “mccarthy” and there is some configuration which I
(string-equal (system-name) "mccarthy"))
#+end_src
** Personal Information
#+begin_src emacs-lisp
@ -62,6 +71,13 @@ My work machine is called “mccarthy” and there is some configuration which I
user-mail-address "opensource@mmk2410.org")
#+end_src
** Encryption
#+begin_src emacs-lisp
(setq plstore-encrypt-to "opensource@mmk2410.org"
epa-file-encrypt-to "opensource@mmk2410.org")
#+end_src
** Date & Time
Set the first day of the week to Mondays.
@ -526,19 +542,19 @@ Installing and enabling ef-themes.
(use-package ef-themes
:init
(setq ef-themes-to-toggle '(ef-eagle ef-owl))
(setq ef-themes-mixed-fonts t)
(setq ef-themes-headings
'((0 . (variable-pitch light 1.9))
(1 . (variable-pitch light 1.8))
(2 . (variable-pitch regular 1.7))
(3 . (variable-pitch regular 1.6))
(4 . (variable-pitch regular 1.5))
(5 . (variable-pitch 1.4))
(6 . (variable-pitch 1.3))
(7 . (variable-pitch 1.2))
(t . (variable-pitch 1.1))))
(setq ef-themes-mixed-fonts nil)
(setq ef-themes-headings nil)
;;'((0 . (variable-pitch light 1.9))
;; (1 . (variable-pitch light 1.8))
;; (2 . (variable-pitch regular 1.7))
;; (3 . (variable-pitch regular 1.6))
;; (4 . (variable-pitch regular 1.5))
;; (5 . (variable-pitch 1.4))
;; (6 . (variable-pitch 1.3))
;; (7 . (variable-pitch 1.2))
;; (t . (variable-pitch 1.1))))
:config
(load-theme 'ef-owl t))
(load-theme 'ef-eagle t))
#+end_src
@ -656,6 +672,11 @@ I found out that a bit more line spacing makes Emacs look more nicely and increa
(setq-default line-spacing 4)
#+end_src
** Scolling
#+begin_src emacs-lisp
(pixel-scroll-precision-mode 1)
#+end_src
* Keybinding
List of own custom keybindings
@ -1445,7 +1466,7 @@ Define org-capture templates.
(setq mmk2410/created-date ":PROPERTIES:\n:CREATED: %U\n:END:")
(setq org-capture-templates
`(("q" "Quick Capture" entry (file "~/org/tasks/inbox.org")
,(concat "* TODO %^{Todo Title}\n:" mmk2410/created-date "\n")
,(concat "* TODO %^{Todo Title}\n" mmk2410/created-date "\n")
:immediate-finish t)
("p" "New Personal Project" entry (file "~/org/tasks/personal.org")
,(concat "* %? :@project:\n" mmk2410/created-date "\n"))
@ -1609,8 +1630,8 @@ From [[https://github.com/daviwil/emacs-from-scratch/blob/master/Emacs.org#cente
:hook (org-mode . efs/org-mode-visual-fill))
(add-hook 'org-mode-hook (lambda ()
(display-line-numbers-mode -1)
(variable-pitch-mode)))
(display-line-numbers-mode -1)))
; (variable-pitch-mode)))
#+end_src
** Hooks
@ -1673,9 +1694,20 @@ Source: [[https://gitlab.com/phillord/org-drill/][GitLab: phillord/org-drill]]
#+begin_src emacs-lisp
(use-package org-drill
:after org
:custom
(org-drill-learn-fraction 0.4)
(org-drill-maximum-items-per-session 50)
:config
(setq org-drill-learn-fraction 0.4)
(setq org-drill-maximum-items-per-session 50))
(with-eval-after-load 'org-capture
(add-to-list 'org-capture-templates '("d" "Org Drill"))
(add-to-list
'org-capture-templates
'("de"
"Org Drill: English Word"
entry
(file+headline "~/org/drill/english.org" "Two-sided")
"** %^{Type|Noun|Verb|Adjective|Conjuction} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: twosided\n:END:\n\n*** Word\n\n%^{Word}\n\n*** Description\n\n%^{Description}\n\n*** Examples\n\n%?\n\n"
:empty-lines 1))))
#+end_src
** Org for blogging
@ -1684,6 +1716,7 @@ Since [[https://mmk2410.org/2020/05/15/switching-my-website-to-hugo-using-ox-hug
#+begin_src emacs-lisp
(use-package ox-hugo
:disabled t
:after org)
#+end_src
@ -2429,9 +2462,10 @@ Emacs client for Mastodon.
#+begin_src emacs-lisp
(use-package mastodon
:config
(setq mastodon-instance-url "https://fosstodon.org"
mastodon-active-user "mmk2410")
:custom
(mastodon-instance-url "https://fosstodon.org")
(mastodon-active-user "mmk2410")
(mastodon-auth-use-auth-source t)
:bind ("C-c M" . mastodon))
#+end_src
@ -2934,6 +2968,26 @@ API Integration for [[https://linkding.link/][Linkding]].
linkding-user "mmk2410"))
#+end_src
** Tandoor Integration
API Integration for [[https://tandoor.dev/][Tandoor]].
#+begin_src emacs-lisp
(use-package tandoor
:load-path "packages/"
:custom
(tandoor-host "recipes.mmk2410.org"))
#+end_src
* EDAM
A simple work-in-progress photography DAM in Emacs.
#+begin_src emacs-lisp
(use-package edam
:load-path "packages/")
#+end_src
* Work
For my workplace I have some additional packages and configuration that I keep in an own file.

23
packages/edam.el Normal file
View file

@ -0,0 +1,23 @@
;;; edam.el --- Eamcs DAM -*- lexical-binding: t -*-
;;; Commentary:
;;; A simple work-in-progress photography DAM in Emacs
;;; Code:
(require 'dired)
(defun edam-set-rating-file-at-point (rating)
"Set image RATING."
(interactive "nRating: ")
(let ((args (cond ((= rating 1) "-Rating=1 -RatingPercent=1")
((= rating 2) "-Rating=2 -RatingPercent=25")
((= rating 3) "-Rating=3 -RatingPercent=50")
((= rating 4) "-Rating=4 -RatingPercent=75")
((= rating 5) "-Rating=5 -RatingPercent=99")
(t (error "Not a valid rating")))))
(dired-do-shell-command
(concat "exiftool " args)
(dired-get-marked-files))))
(provide 'edam)
;;; edam.el ends here

View file

@ -4,6 +4,7 @@
;;; Personal helpers and shortcuts to work more effectively with tab-bar mode.
;;; Code:
(require 'hydra)
(defun mmk2410/tab-bar-new-tab (name func)
"Create new tab using FUNC with name NAME."

40
packages/tandoor.el Normal file
View file

@ -0,0 +1,40 @@
;;; tandoor.el --- Tandoor Integration -*- lexical-binding: t -*-
;;; Commentary:
;;; Integration with Tandoor.
;;; Code:
(require 'json)
(require 'plz)
(defcustom tandoor-host ""
"Hostname of the Tandoor instance."
:type '(string)
:group 'tandoor)
(defun tandoor--get-api-key ()
"Get Tandoor API key from auth store."
(let ((result (auth-source-search :host tandoor-host)))
(if result
(funcall (plist-get (car result) :secret))
nil)))
(defun tandoor--build-headers ()
"Build headers for Tandoor API request."
`(("Content-Type" . "application/json")
("Authorization" . ,(concat "Bearer " (tandoor--get-api-key)))))
(defun tandoor-shopping-list-add-entry (food amount unit)
"Add AMOUNT UNIT FOOD to Tandoor shopping list."
(interactive "sFood to add: \nsAmount: \nsUnit: ")
(plz 'post (concat "https://" tandoor-host "/api/shopping-list-entry/")
:headers (tandoor--build-headers)
:body (json-encode `(("food" ("name" . ,food))
("unit" ("name" . ,unit))
("amount" . ,amount)))
:as 'string
:then (lambda (res) (message "Entry added successfully."))
:else (lambda (res) (message "Failed to add entry."))))
(provide 'tandoor)
;;; tandoor.el ends here