Backup 2025-04-18

This commit is contained in:
js0ny 2025-04-18 20:19:25 +01:00
parent e167d883a0
commit d0f1044013
11 changed files with 157 additions and 30 deletions

View file

@ -80,3 +80,9 @@ windowrulev2 = size 50%, title:^(图片查看器)(.*)$
# Pin: Rofi will display in all wsps
windowrulev2 = pin, class:^(Rofi)$
windowrulev2 = stayfocused, class:^(Rofi)$
windowrulev2 = float, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = move 73% 5%, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = size 25%, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = float, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = pin, class:^(org.pulseaudio.pavucontrol)$

View file

@ -4,7 +4,7 @@ Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStart=/usr/local/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure

View file

@ -16,11 +16,45 @@
:if (display-graphic-p))
(defun js0ny/get-system-theme ()
" Get the current system theme. Returns 'light' or 'dark'."
;; Default
(let ((background 'dark))
(if (string= system-type "darwin")
(progn
;; Check if 'defaults' command is available
(when (executable-find "defaults")
;; Check if the system is in dark mode
(let ((apple-interface-style
(shell-command-to-string "defaults read -g AppleInterfaceStyle")))
(when (string-match-p "Light" apple-interface-style)
(setq background 'light)))))
;; Using systemd to check the current theme
(when (executable-find "busctl")
(let ((result
(shell-command-to-string
(concat "busctl --user call org.freedesktop.portal.Desktop "
"/org/freedesktop/portal/desktop "
"org.freedesktop.portal.Settings ReadOne ss "
"org.freedesktop.appearance color-scheme"))))
;; 结果格式为浅色模式是 "v u 0",暗色模式是 "v u 1"
;; v u 0 -> light, v u 1 -> dark
(when (string-match "u\\s+\\([0-9]\\)" result)
(let ((color-scheme (match-string 1 result)))
(when (string= color-scheme "0")
(setq background 'light)))))))
background))
(use-package catppuccin-theme
:custom
(catppuccin-flavor 'mocha)
:config
(setq catppuccin-flavor 'mocha) ; This looks like shit in terminal mode
(load-theme 'catppuccin t)
)
(if (string-equal (js0ny/get-system-theme) "light")
(setq catppuccin-flavor 'latte)
(setq catppuccin-flavor 'mocha))
(load-theme 'catppuccin t))
;; (use-package doom-themes
;; :ensure t
@ -29,12 +63,12 @@
;; :custom
;; (doom-themes-enable-bold t) ; if nil, bold is universally disabled
;; (doom-themes-enable-italic t) ; if nil, italics is universally disabled
;; (doom-themes-treemacs-theme "doom-nord-aurora") ; use "doom-colors" for less minimal icon theme
;; ; (doom-themes-treemacs-theme "doom-nord-aurora") ; use "doom-colors" for less minimal icon theme
;; :config
;; ;; (load-theme 'doom-nord-aurora t)
;; (load-theme 'doom-nord-aurora t)
;; ;; Enable flashing mode-line on errors
;; ;; (doom-themes-visual-bell-config)
;; (doom-themes-visual-bell-config)
;; ;; Enable custom neotree theme (nerd-icons must be installed!)
;; ;; (doom-themes-neotree-config)

View file

@ -14,6 +14,9 @@
:hook
(prog-mode . display-line-numbers-mode))
(when (eq system-type 'darwin)
(setq mac-option-modifier 'meta)
(setq mac-command-modifier 'super))
;; https://book.emacs-china.org/#orgcfd105e Open with Emacs
@ -60,6 +63,7 @@
;; TRAMP 远程文件的备份设置
(setq tramp-backup-directory-alist (copy-tree backup-directory-alist))
(setq tramp-persistency-file-name (expand-file-name "tramp" user-emacs-state))
;; 备份设置(可选)

View file

@ -3,7 +3,7 @@
"Open `user-emacs-directory` using `counsel-find-file`."
(interactive)
(let ((default-directory user-emacs-directory))
(counsel-find-file)))
(counsel-file-jump)))
(use-package counsel
@ -18,8 +18,7 @@
"/" #'counsel-rg
";" #'counsel-M-x
"fc" #'js0ny/open-config-directory
)
)
"fh" #'counsel-recentf))
(provide 'init-counsel)

View file

@ -6,6 +6,9 @@
;; Auto input pairred brackets
(electric-pair-mode 1)
;; Enable Folding
(add-hook 'prog-mode-hook #'hs-minor-mode)
;; Company - Complete Anything
(use-package company
:ensure t
@ -83,4 +86,13 @@
(yas-reload-all)
)
(use-package diff-hl
:straight t
:hook ((prog-mode . diff-hl-mode)
(vc-dir-mode . diff-hl-dir-mode)
(magit-post-refresh . diff-hl-magit-post-refresh))
:config
(setq diff-hl-margin-mode nil)
(diff-hl-flydiff-mode))
(provide 'init-edit)

View file

@ -3,6 +3,8 @@
;; Evil - Extensible VI Layer
;; (defvar evil-colemak-state-map (make-sparse-keymap))
(use-package evil
:ensure t
:config
@ -24,7 +26,10 @@
"E" '(lambda () (interactive) (evil-previous-line 5)) ; 5e
(kbd "C-w n") 'evil-window-down
(kbd "C-w e") 'evil-window-up
(kbd "C-w i") 'evil-window-right)
(kbd "C-w i") 'evil-window-right
(kbd "C-w C-n") 'evil-window-down
(kbd "C-w C-e") 'evil-window-up
(kbd "C-w C-i") 'evil-window-right)
(evil-define-key '(normal visual) 'global
"l" 'evil-insert
"L" 'evil-insert-0-line)
@ -32,8 +37,8 @@
"H" #'tab-line-switch-to-prev-tab
"I" #'tab-line-switch-to-next-tab)
(evil-define-key '(visual operator) 'global
"H" #'evil-beginning-of-visual-line
"I" #'evil-end-of-visual-line)
"H" #'evil-beginning-of-line
"I" #'evil-end-of-line)
(evil-ex-define-cmd "bn" #'tab-line-switch-to-next-tab)
(evil-ex-define-cmd "bp" #'tab-line-switch-to-prev-tab))
@ -51,9 +56,7 @@
(evil-leader/set-leader "<SPC>")
(evil-leader/set-key
"ft" #'treemacs
"fc" #'(counsel-find-file user-emacs-directory)
"b" 'buffer-menu
))
"bb" #'buffer-menu))
;; Evil Commentary: Use gc<action> to toggle comments
(use-package evil-commentary
@ -67,6 +70,10 @@
:config
(global-evil-surround-mode 1))
(use-package evil-mc
:config
(global-evil-mc-mode 1))
;; Evil-goggles: Highlight-yank (and more)
(use-package evil-goggles

View file

@ -38,15 +38,14 @@
("C-x t M-t" . treemacs-find-tag)
)
:config
(setq treemacs-persist-file (expand-file-name "treemacs-persist" user-emacs-data))
)
(setq treemacs-persist-file (expand-file-name "treemacs-persist" user-emacs-data)))
(use-package treemacs-evil
:after (treemacs evil)
:ensure t
:config
;; Evil treemacs state bindings
(evil-define-key 'treemacs evil-treemacs-state-map
(evil-define-key '(normal motion) evil-treemacs-state-map
(kbd "n") #'treemacs-next-line
(kbd "e") #'treemacs-previous-line
(kbd "N") #'treemacs-next-neighbour
@ -68,6 +67,8 @@
;; Treemacs mode specific binding
(evil-define-key 'treemacs treemacs-mode-map (kbd "i") #'treemacs-RET-action))
(use-package dirvish)
;; magit - Git Client
(use-package magit

View file

@ -24,6 +24,7 @@
(org-persist-directory (expand-file-name "org-persist" user-emacs-data))
(org-archive-location "~/OrgFiles/.archive/%s_archive::")
(org-default-notes-file "~/OrgFiles/tasks/inbox.org")
(org-id-locations-file (expand-file-name ".org-id-locations" org-directory))
(org-startup-folded "show2levels")
(org-log-into-drawer "LOGBOOK")
(org-pretty-entities t)
@ -36,11 +37,6 @@
(define-key org-mode-map (kbd "C-j") 'org-return-indent)
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle))
(evil-define-key 'normal org-mode-map (kbd "SPC a") 'org-agenda-list) ; TODO: Here Simulates the leader
)
;; Org Styling
;; Set Org Styles
(setq org-emphasis-alist
'(("*" (bold :foreground "cyan" ))
("/" (italic :foreground "green"))
@ -49,6 +45,23 @@
("~" (org-code verbatim :background "deep sky blue" :foreground "MidnightBlue"))
("+" (:strike-through t))))
(dolist (face '((org-level-1 . 1.6)
(org-level-2 . 1.4)
(org-level-3 . 1.2)
(org-level-4 . 1.1)
(org-level-5 . 1.0)
(org-level-6 . 1.0)
(org-level-7 . 1.0)
(org-level-8 . 1.0)))
(set-face-attribute (car face) nil :height (cdr face)))
)
;; Org Styling
;; Set Org Styles
;; Org Preview
@ -248,6 +261,10 @@
(format "开始计时任务: %s\n预计用时: %s"
(org-get-heading t t t t)
effort))))))
(use-package org-node
:after org
:config (org-node-cache-mode))
(provide 'init-org)

View file

@ -16,5 +16,13 @@
(python-mode . python-ts-mode)
(js-json-mode . json-ts-mode)))
(add-to-list 'treesit-language-source-alist
'(hyprlang "https://github.com/tree-sitter-grammars/tree-sitter-hyprlang"))
(use-package hyprlang-ts-mode
:ensure t
:custom
(hyprlang-ts-mode-indent-offset 4))
(provide 'init-treesitter)

View file

@ -22,6 +22,44 @@ return {
},
{ key = "q", icon = "󱊷 ", desc = "退出", action = "<cmd>qa<CR>" },
},
--[[header = [[
================= =============== =============== ======== ========
\\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . //
||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . . .||
|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||
||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||
|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . ||
||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\_ . .|. .||
|| . _|| || || || || ||_ . || || . _|| || || || |\ `-_/| . ||
||_-' || .|/ || || \|. || `-_|| ||_-' || .|/ || || | \ / |-_.||
|| ||_-' || || `-_|| || || ||_-' || || | \ / | `||
|| `' || || `' || || `' || || | \ / | ||
|| .===' `===. .==='.`===. .===' /==. | \/ | ||
|| .==' \_|-_ `===. .===' _|_ `===. .===' _-|/ `== \/ | ||
|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \/ | ||
|| .==' _-' '-__\._-' '-_./__-' `' |. /| | ||
||.==' _-' `' | /==.||
==' _-' N E O V I M \/ `==
\ _-' `-_ /
`'' ``'
--]]
header = [[
]]
},
sections = {
{ section = "header" },
@ -41,7 +79,8 @@ return {
-- scroll = { enabled = true },
statuscolumn = { enabled = true },
-- words = { enabled = true },
image = { enabled = true,
image = {
enabled = true,
img_dirs = { "_Global/Assets" }
},
},