feat(kmonad): KMonad Keyboard Layout

This commit is contained in:
js0ny 2025-02-25 12:35:10 +00:00
parent c9d37743fe
commit 8c5babe80a
7 changed files with 189 additions and 5 deletions

View file

@ -15,6 +15,3 @@ MenuBar=Disabled
[PreviewSettings] [PreviewSettings]
Plugins=appimagethumbnail,audiothumbnail,avif,blenderthumbnail,comicbookthumbnail,cursorthumbnail,djvuthumbnail,ebookthumbnail,exrthumbnail,directorythumbnail,fontthumbnail,heif,imagethumbnail,jpegthumbnail,jxl,kraorathumbnail,windowsexethumbnail,windowsimagethumbnail,mobithumbnail,opendocumentthumbnail,gsthumbnail,rawthumbnail,svgthumbnail,textthumbnail,ffmpegthumbs,gdk-pixbuf-thumbnailer Plugins=appimagethumbnail,audiothumbnail,avif,blenderthumbnail,comicbookthumbnail,cursorthumbnail,djvuthumbnail,ebookthumbnail,exrthumbnail,directorythumbnail,fontthumbnail,heif,imagethumbnail,jpegthumbnail,jxl,kraorathumbnail,windowsexethumbnail,windowsimagethumbnail,mobithumbnail,opendocumentthumbnail,gsthumbnail,rawthumbnail,svgthumbnail,textthumbnail,ffmpegthumbs,gdk-pixbuf-thumbnailer
[Search]
Location=Everywhere

90
tools/KMonad/kmonad.kbd Normal file
View file

@ -0,0 +1,90 @@
;; vim:ft=kmonad
;; Linux kmonad.kbd
(defcfg
;; The device file to read input from, under /dev/input/by-id
;; Can be obtained by running `sudo evtest` and selecting the device
input (device-file "/dev/input/by-id/usb-Razer_Razer_BlackWidow_V3_Mini-event-kbd")
;; The device file to write output to, under /dev/uinput
output (uinput-sink "KMonad")
;; fallthrough - boolean{false}, allows user to only specify certain parts of a layout
;; Others remain unchanged
fallthrough true
;; allow-cmd - boolean{false}, allowing to run shell commands
allow-cmd true
;; cmp-seq - key{RightAlt}, So called `AltGr` key
cmp-seq ralt
;; cmp-seq-delay - NN{0} - delay between each pressed key in a compose-key sequence
cmp-seq-delay 0
;; ;; key-seq-delay - NN{5} - delay between each outputted key event
;; key-seq-delay 5
;; implicit-around - {around} - Not sure what this does
implicit-around around
)
;; Razer BlackWidow V3 Mini - 65% ANSI layout
;; This layer is a reference default layer, won't be used directly
;; The first `deflayer' below will be the default layer
;; (defsrc
;; esc 1 2 3 4 5 6 7 8 9 0 - = bspc del
;; tab q w e r t y u i o p [ ] \ pgup
;; caps a s d f g h j k l ; ' ret pgdn
;; lsft z x c v b n m , . / rsft up ins
;; lctl lmet lalt spc ralt rctl left down right
;; )
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = \ del
tab q w f p g j l u y ; [ ] bspc pgup
caps a r s t d h n e i o ' ret pgdn
lsft z x c v b k m , . / rsft up ins
lctl lmet lalt spc ralt rctl left down right
)
;; (deflayer name
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _
;; _ _ _ _ _ _ _ _ _
;; )
;; CapsLock -> Esc when tapped, Ctrl when held
(defalias mo1 (tap-next-release esc lctl))
(defalias spctl (tap-next-release spc (layer-toggle spcl)))
;; Colemak
(deflayer colemak
grv 1 2 3 4 5 6 7 8 9 0 - = \ del
tab q w f p g j l u y ; [ ] bspc pgup
@mo1 a r s t d h n e i o ' ret pgdn
lsft z x c v b k m , . / rsft up ins
lctl lmet lalt @spctl ralt rctl left down right
)
(deflayer qwerty
esc 1 2 3 4 5 6 7 8 9 0 - = bspc del
tab q w e r t y u i o p [ ] \ pgup
@mo1 a s d f g h j k l ; ' ret pgdn
lsft z x c v b n m , . / rsft up ins
lctl lmet lalt @spctl ralt rctl left down right
)
;; SPACE Layer
(deflayer spcl
grv f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 \ del
tab q w f p g j l u y ; pgup pgdn bspc pgup
@mo1 a r s t d left down up right end ' ret pgdn
lsft z x c v b home m , . / rsft up ins
lctl lmet lalt spc ralt rctl left down right
)
;; (deflayer spcl
;; esc 1 2 3 4 5 6 7 8 9 0 - = bspc del
;; tab q w e r t y u i o p [ ] \ pgup
;; @mo1 a s d f g left down up right ; ' ret pgdn
;; lsft z x c v b n m , . / rsft up ins
;; lctl lmet lalt spc ralt rctl left down right
;; )

68
tools/doom/calendar.el Normal file
View file

@ -0,0 +1,68 @@
;;; https://github.com/cnsunyour/.doom.d/blob/master/modules/cnsunyour/calendar/config.el
;;; ~/.doom.d/+calendar.el -*- lexical-binding: t; -*-
;; 日历及纪念日相关设置
;; 定义可以设置农历纪念日的函数
;; (defun cnsunyour/diary-chinese-anniversary (lunar-month lunar-day &optional year mark)
;; (if year
;; (let* ((d-date (diary-make-date lunar-month lunar-day year))
;; (a-date (calendar-absolute-from-gregorian d-date))
;; (c-date (calendar-chinese-from-absolute a-date))
;; (cycle (car c-date))
;; (yy (cadr c-date))
;; (y (+ (* 100 cycle) yy)))
;; (diary-chinese-anniversary lunar-month lunar-day y mark))
;; (diary-chinese-anniversary lunar-month lunar-day year mark)))
(setq calendar-mark-holidays-flag t
calendar-week-start-day 1)
(use-package! cal-china-x
:custom
(cal-china-x-important-holidays '((holiday-chinese-new-year)
(holiday-lunar 12 23 "小年(北)" 1)
(holiday-lunar 12 24 "小年(南)" 1)
(holiday-lunar 12 30 "除夕" 1)
(holiday-lunar 1 1 "春节" 0)
(holiday-lunar 1 2 "春节" 0)
(holiday-lunar 1 3 "春节" 0)
(holiday-lunar 1 4 "春节" 0)
(holiday-lunar 1 5 "春节(破五)" 0)
(holiday-lunar 1 15 "元宵节" 0)
(holiday-lunar 2 2 "龙抬头" 0)
(holiday-solar-term "清明" "清明节")
(holiday-fixed 5 1 "劳动节")
(holiday-lunar 5 5 "端午节" 0)
(holiday-lunar 7 7 "七夕节" 0)
(holiday-lunar 7 15 "中元节" 0)
(holiday-lunar 8 15 "中秋节" 0)
(holiday-fixed 10 1 "国庆节")
(holiday-fixed 10 2 "国庆节")
(holiday-fixed 10 3 "国庆节")
(holiday-lunar 9 9 "重阳节" 0)
(holiday-lunar 10 1 "寒衣节" 0)
(holiday-lunar 12 8 "腊八" 1)
(holiday-solar-term "立春" "立春")
(holiday-solar-term "立夏" "立夏")
(holiday-solar-term "立秋" "立秋")
(holiday-solar-term "立冬" "立冬")
(holiday-solar-term "春分" "春分")
(holiday-solar-term "夏至" "夏至")
(holiday-solar-term "秋分" "秋分")
(holiday-solar-term "冬至" "冬至")))
(cal-china-x-general-holidays '((holiday-fixed 1 1 "元旦")
(holiday-fixed 2 14 "情人节")
(holiday-fixed 3 8 "妇女节")
(holiday-fixed 4 1 "愚人节")
(holiday-fixed 5 4 "青年节")
(holiday-float 5 0 2 "母亲节")
(holiday-fixed 6 1 "儿童节")
(holiday-float 6 0 3 "父亲节")
(holiday-fixed 9 10 "教师节")
(holiday-float 11 4 4 "感恩节")
(holiday-fixed 12 25 "圣诞节")))
:config
(setq calendar-holidays (append cal-china-x-important-holidays
cal-china-x-general-holidays)))

View file

@ -119,3 +119,5 @@
(setq default-input-method "rime") (setq default-input-method "rime")
(add-hook! (org-mode markdown-mode) (activate-input-method default-input-method)) (add-hook! (org-mode markdown-mode) (activate-input-method default-input-method))
) )
(load! "calendar.el")

View file

@ -184,12 +184,12 @@
;;zig ; C, but simpler ;;zig ; C, but simpler
:email :email
;;(mu4e +org +gmail) (mu4e +org +gmail)
;;notmuch ;;notmuch
;;(wanderlust +gmail) ;;(wanderlust +gmail)
:app :app
;;calendar calendar
;;emms ;;emms
;;everywhere ; *leave* Emacs!? You must be joking ;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize ;;irc ; how neckbeards socialize

View file

@ -45,6 +45,26 @@
("n" "Note" entry (file+headline "~/OrgFiles/tasks/inbox.org" "Notes")) ("n" "Note" entry (file+headline "~/OrgFiles/tasks/inbox.org" "Notes"))
)) ))
;; 处理 Zotero 链接
(org-link-set-parameters
"zotero"
:follow (lambda (path) (browse-url (concat "zotero://" path)))
:export (lambda (path desc format)
(cond
((eq format 'html) (format "<a href=\"zotero://%s\">%s</a>" path (or desc path)))
((eq format 'latex) (format "\\href{zotero://%s}{%s}" path (or desc path)))
(t path))))
;; 处理 Obsidian 链接
(org-link-set-parameters
"obsidian"
:follow (lambda (path) (browse-url (concat "obsidian://" path)))
:export (lambda (path desc format)
(cond
((eq format 'html) (format "<a href=\"obsidian://%s\">%s</a>" path (or desc path)))
((eq format 'latex) (format "\\href{obsidian://%s}{%s}" path (or desc path)))
(t path))))
) )
(after! evil-org (after! evil-org
@ -71,3 +91,9 @@
:m "E" #'org-agenda-priority-down :m "E" #'org-agenda-priority-down
:m "i" #'evil-forward-char) :m "i" #'evil-forward-char)
(after! org-pomodoro
(setq org-pomodoro-format "🍅~%s")
(setq org-pomodoro-short-break-format "摸~%s")
(setq org-pomodoro-long-break-format "猛摸~%s")
)

View file

@ -54,3 +54,4 @@
(package! evil-matchit) (package! evil-matchit)
(package! rime) (package! rime)
(package! ox-typst) (package! ox-typst)
(package! cal-china-x)