diff --git a/Emacs.org b/Emacs.org index 94fb388..ace41f5 100644 --- a/Emacs.org +++ b/Emacs.org @@ -281,6 +281,50 @@ This function will check if a directory for which a file we want to open exists; +#+end_src + +** ispell + +#+begin_src emacs-lisp + + ;; set the NixOS wordlist by hand + (setq ispell-alternate-dictionary "/nix/store/gjmvnbs97cnw19wnqh9m075cdbhy8r8g-wordlist-WORDLIST") + +#+end_src + +** Inhibit Messages in Echo Area + +#+begin_src emacs-lisp + + (defun suppress-messages (old-fun &rest args) + (cl-flet ((silence (&rest args1) (ignore))) + (advice-add 'message :around #'silence) + (unwind-protect + (apply old-fun args) + (advice-remove 'message #'silence)))) + + (advice-add 'pixel-scroll-precision :around #'suppress-messages) + (advice-add 'mu4e--server-filter :around #'suppress-messages) + (advice-add 'org-unlogged-message :around #'suppress-messages) + (advice-add 'magit-auto-revert-mode--init-kludge :around #'suppress-messages) + + ;; to reenable + ;; (advice-remove 'timer-event-handler #'suppress-messages) + + (defun who-called-me? (old-fun format &rest args) + (let ((trace nil) (n 1) (frame nil)) + (while (setf frame (backtrace-frame n)) + (setf n (1+ n) + trace (cons (cadr frame) trace)) ) + (apply old-fun (concat "<<%S>>\n" format) (cons trace args)))) + + ;; enable to get message backtrace, the first function shown in backtrace calls the other functions + ;; (advice-add 'message :around #'who-called-me?) + + ;; disable to stop receiving backtrace + ;; (advice-remove 'message #'who-called-me?) + + #+end_src ** undo-tree @@ -407,11 +451,12 @@ Base emacs undo logic is very useful, but not easy to understand. I prefer undo- (general-define-key "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card ;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist - ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetye for new anki cards + ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards ;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot "C-c d" 'duplicate-line ; duplicate line on CURSOR "C-M-j" 'consult-buffer "C-s" 'consult-line + "M-o" 'avy-goto-char-timer "C-" 'my-python-shell-run ) @@ -543,7 +588,8 @@ Here I set up the modeline with some information that I find useful. Specficiall :init (doom-modeline-mode) :custom ((doom-modeline-height 22) - (doom-modeline-indent-info t))) + (doom-modeline-indent-info nil) + (doom-modeline-buffer-encoding nil))) ;; Generally show line numbers (column-number-mode) @@ -560,78 +606,82 @@ Soon I want to try out this new hot stuff - just at the moment there is too much #+begin_src emacs-lisp - (use-package vertico - :custom - (vertico-scroll-margin 0) - (vertico-count 10) - (vertico-resize t) - (vertico-cycle t) - :init - (vertico-mode) - (vertico-mouse-mode)) + (setq read-buffer-completion-ignore-case t + read-file-name-completion-ignore-case t + completion-ignore-case t) - (use-package vertico-directory - :ensure nil - :after vertico - :bind (:map vertico-map - ("RET" . vertico-directory-enter) - ("DEL" . vertico-directory-delete-char) - ("M-DEL" . vertico-directory-delete-word)) - ;; Tidy shadowed file names - :hook (rfn-eshadow-update-overlay . vertico-directory-tidy)) - - (use-package orderless - :custom - (completion-styles '(orderless flex basic)) - (completion-category-overrides '((file (styles . (partial-completion))) - (eglot (styles orderless))))) - - (use-package consult - :config - (setq consult-fontify-max-size 1024) - :bind - ("C-x b" . consult-buffer) - ("C-c " . consult-global-mark) - ("C-c C-a" . consult-org-agenda) - ("C-x O" . consult-outline) - ("M-g M-g" . consult-goto-line) - ("M-g i" . consult-imenu) - ("M-s s" . consult-line) - ("M-s M-s" . consult-line-multi)) - - (use-package embark - :bind - (("C-." . embark-act) - ("M-." . embark-dwim) - ("C-h B" . embark-bindings)) - :custom - (prefix-help-command #'embark-prefix-help-command) - (embark-quit-after-action '((t . nil))) - :config - (add-to-list 'display-buffer-alist - '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" - nil - (window-parameters (mode-line-format . none))))) - - (use-package embark-consult - :after (embark consult) - :demand t ; only necessary if you have the hook below - ;; if you want to have consult previews as you move around an - ;; auto-updating embark collect buffer - :hook - (embark-collect-mode . consult-preview-at-point-mode)) - - (use-package marginalia - :after vertico - :init - (marginalia-mode) - (setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))) - - (use-package nerd-icons-completion - :after (marginalia nerd-icons) - :hook (marginalia-mode . nerd-icons-completion-marginalia-setup) + (use-package vertico + :custom + (vertico-scroll-margin 0) + (vertico-count 10) + (vertico-resize t) + (vertico-cycle t) :init - (nerd-icons-completion-mode)) + (vertico-mode) + (vertico-mouse-mode)) + + (use-package vertico-directory + :ensure nil + :after vertico + :bind (:map vertico-map + ("RET" . vertico-directory-enter) + ("DEL" . vertico-directory-delete-word) + ("M-DEL" . vertico-directory-delete-char)) + ;; Tidy shadowed file names + :hook (rfn-eshadow-update-overlay . vertico-directory-tidy)) + + (use-package orderless + :custom + (completion-styles '(orderless flex basic)) + (completion-category-overrides '((file (styles . (partial-completion))) + (eglot (styles orderless))))) + + (use-package consult + :config + (setq consult-fontify-max-size 1024) + :bind + ("C-x b" . consult-buffer) + ("C-c " . consult-global-mark) + ("C-c C-a" . consult-org-agenda) + ("C-x O" . consult-outline) + ("M-g M-g" . consult-goto-line) + ("M-g i" . consult-imenu) + ("M-s s" . consult-line) + ("M-s M-s" . consult-line-multi)) + + (use-package embark + :bind + (("C-." . embark-act) + ("M-." . embark-dwim) + ("C-h B" . embark-bindings)) + :custom + (prefix-help-command #'embark-prefix-help-command) + (embark-quit-after-action '((t . nil))) + :config + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + + (use-package embark-consult + :after (embark consult) + :demand t ; only necessary if you have the hook below + ;; if you want to have consult previews as you move around an + ;; auto-updating embark collect buffer + :hook + (embark-collect-mode . consult-preview-at-point-mode)) + + (use-package marginalia + :after vertico + :init + (marginalia-mode) + (setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))) + + (use-package nerd-icons-completion + :after (marginalia nerd-icons) + :hook (marginalia-mode . nerd-icons-completion-marginalia-setup) + :init + (nerd-icons-completion-mode)) #+end_src @@ -1069,31 +1119,19 @@ Soon I want to try out this new hot stuff - just at the moment there is too much #+begin_src emacs-lisp - ;; (use-package auctex - ;; :ensure nil) - (setq TeX-auto-save t) - (setq TeX-save-query nil) - (setq TeX-parse-self t) - (setq-default TeX-master nil) + (use-package auctex + :ensure nil) + (setq TeX-auto-save t) + (setq TeX-save-query nil) + (setq TeX-parse-self t) + (setq-default TeX-master nil) - ;; (add-hook 'LaTeX-mode-hook 'visual-line-mode) - ;; (add-hook 'LaTeX-mode-hook 'flyspell-mode) - ;; (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) + (add-hook 'LaTeX-mode-hook 'visual-line-mode) + (add-hook 'LaTeX-mode-hook 'flyspell-mode) + (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) + (add-hook 'LaTeX-mode-hook 'reftex-mode) - ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) - ;; (setq reftex-plug-into-AUCTeX t) - -#+end_src - -** TeX - -#+begin_src emacs-lisp - - (add-hook 'markdown-mode-hook - (lambda () - (local-set-key (kbd "C-c C-x C-l") 'org-latex-preview) - (local-set-key (kbd "C-c C-x C-u") 'markdown-toggle-url-hiding) - )) + ;; (setq reftex-plug-into-AUCTeX t) #+end_src @@ -1297,6 +1335,18 @@ This is a section adapted from org-download to make some org-download functions #+end_src +** LaTeX in Markdown + +#+begin_src emacs-lisp + + (add-hook 'markdown-mode-hook + (lambda () + (local-set-key (kbd "C-c C-x C-l") 'org-latex-preview) + (local-set-key (kbd "C-c C-x C-u") 'markdown-toggle-url-hiding) + )) + +#+end_src + * Writing ** Olivetti @@ -1411,6 +1461,24 @@ In order to update the language grammars, run the next command below. #+end_src +** avy + +#+begin_src emacs-lisp + + (use-package avy + :config + (setq avy-all-windows 'all-frames)) + +#+end_src + +** crdt (Collaborative Editing) + +#+begin_src emacs-lisp + +(use-package crdt) + +#+end_src + ** devdocs #+begin_src emacs-lisp @@ -1569,115 +1637,115 @@ Currently unused #+begin_src emacs-lisp - ;; (use-package corfu - ;; :custom - ;; (corfu-cycle t) - ;; :init - ;; (global-corfu-mode)) + ;; (use-package corfu + ;; :custom + ;; (corfu-cycle t) + ;; :init + ;; (global-corfu-mode)) - (use-package corfu - :init - (global-corfu-mode) - (corfu-history-mode) - (corfu-popupinfo-mode) ; Popup completion info - :custom - (corfu-auto t) - (corfu-auto-prefix 3) - (corfu-auto-delay 0.3) - (corfu-cycle t) - (corfu-quit-no-match 'separator) - (corfu-separator ?\s) - ;; (corfu-quit-no-match t) - (corfu-popupinfo-max-height 70) - (corfu-popupinfo-delay '(0.5 . 0.2)) - ;; (corfu-preview-current 'insert) ; insert previewed candidate - (corfu-preselect 'prompt) - (corfu-on-exact-match nil) ; Don't auto expand tempel snippets - ;; Optionally use TAB for cycling, default is `corfu-complete'. - :bind (:map corfu-map - ("M-SPC" . corfu-insert-separator) - ("" . swarsel/corfu-normal-return) - ;; ("C-" . swarsel/corfu-complete) - ("S-" . corfu-popupinfo-scroll-down) - ("S-" . corfu-popupinfo-scroll-up) - ("C-" . corfu-previous) - ("C-" . corfu-next) - ("" . swarsel/corfu-quit-and-up) - ("" . swarsel/corfu-quit-and-down)) + (use-package corfu + :init + (global-corfu-mode) + (corfu-history-mode) + (corfu-popupinfo-mode) ; Popup completion info + :custom + (corfu-auto t) + (corfu-auto-prefix 3) + (corfu-auto-delay 0.3) + (corfu-cycle t) + (corfu-quit-no-match 'separator) + (corfu-separator ?\s) + ;; (corfu-quit-no-match t) + (corfu-popupinfo-max-height 70) + (corfu-popupinfo-delay '(0.5 . 0.2)) + ;; (corfu-preview-current 'insert) ; insert previewed candidate + (corfu-preselect 'prompt) + (corfu-on-exact-match nil) ; Don't auto expand tempel snippets + ;; Optionally use TAB for cycling, default is `corfu-complete'. + :bind (:map corfu-map + ("M-SPC" . corfu-insert-separator) + ("" . swarsel/corfu-normal-return) + ;; ("C-" . swarsel/corfu-complete) + ("S-" . corfu-popupinfo-scroll-down) + ("S-" . corfu-popupinfo-scroll-up) + ("C-" . corfu-previous) + ("C-" . corfu-next) + (" " . swarsel/corfu-quit-and-up) + (" " . swarsel/corfu-quit-and-down)) + ) + + + ;; dont disrupt file navigation with completions + (defun swarsel/corfu-normal-return (&optional arg) + (interactive) + (corfu-quit) + (newline) ) + ;; (defun swarsel/corfu-complete (&optional arg) + ;; (interactive) + ;; (corfu-complete) + ;; (newline) + ;; ) - ;; dont disrupt file navigation with completions - (defun swarsel/corfu-normal-return (&optional arg) - (interactive) - (corfu-quit) - (newline) - ) + (defun swarsel/corfu-quit-and-up (&optional arg) + (interactive) + (corfu-quit) + (evil-previous-visual-line)) - ;; (defun swarsel/corfu-complete (&optional arg) - ;; (interactive) - ;; (corfu-complete) - ;; (newline) - ;; ) + (defun swarsel/corfu-quit-and-down (&optional arg) + (interactive) + (corfu-quit) + (evil-next-visual-line)) - (defun swarsel/corfu-quit-and-up (&optional arg) - (interactive) - (corfu-quit) - (evil-previous-visual-line)) + (use-package nerd-icons-corfu) - (defun swarsel/corfu-quit-and-down (&optional arg) - (interactive) - (corfu-quit) - (evil-next-visual-line)) + (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter) - (use-package nerd-icons-corfu) + (setq nerd-icons-corfu-mapping + '((array :style "cod" :icon "symbol_array" :face font-lock-type-face) + (boolean :style "cod" :icon "symbol_boolean" :face font-lock-builtin-face) + ;; ... + (t :style "cod" :icon "code" :face font-lock-warning-face))) - (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter) - - (setq nerd-icons-corfu-mapping - '((array :style "cod" :icon "symbol_array" :face font-lock-type-face) - (boolean :style "cod" :icon "symbol_boolean" :face font-lock-builtin-face) - ;; ... - (t :style "cod" :icon "code" :face font-lock-warning-face))) - - (use-package cape - ;; Bind dedicated completion commands - ;; Alternative prefix keys: C-c p, M-p, M-+, ... - ;; :bind (("C-c p p" . completion-at-point) ;; capf - ;; ("C-c p t" . complete-tag) ;; etags - ;; ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion - ;; ("C-c p h" . cape-history) - ;; ("C-c p f" . cape-file) - ;; ("C-c p k" . cape-keyword) - ;; ("C-c p s" . cape-elisp-symbol) - ;; ("C-c p e" . cape-elisp-block) - ;; ("C-c p a" . cape-abbrev) - ;; ("C-c p l" . cape-line) - ;; ("C-c p w" . cape-dict) - ;; ("C-c p :" . cape-emoji) - ;; ("C-c p \\" . cape-tex) - ;; ("C-c p _" . cape-tex) - ;; ("C-c p ^" . cape-tex) - ;; ("C-c p &" . cape-sgml) - ;; ("C-c p r" . cape-rfc1345)) - :init - ;; Add to the global default value of `completion-at-point-functions' which is - ;; used by `completion-at-point'. The order of the functions matters, the - ;; first function returning a result wins. Note that the list of buffer-local - ;; completion functions takes precedence over the global list. - (add-to-list 'completion-at-point-functions #'cape-dabbrev) - (add-to-list 'completion-at-point-functions #'cape-file) - (add-to-list 'completion-at-point-functions #'cape-elisp-block) - ;; (add-to-list 'completion-at-point-functions #'cape-history) - ;; (add-to-list 'completion-at-point-functions #'cape-keyword) - ;; (add-to-list 'completion-at-point-functions #'cape-tex) - ;; (add-to-list 'completion-at-point-functions #'cape-sgml) - ;; (add-to-list 'completion-at-point-functions #'cape-rfc1345) - ;; (add-to-list 'completion-at-point-functions #'cape-abbrev) - ;; (add-to-list 'completion-at-point-functions #'cape-dict) - (add-to-list 'completion-at-point-functions #'cape-elisp-symbol) - ;; (add-to-list 'completion-at-point-functions #'cape-line) - ) + (use-package cape + ;; Bind dedicated completion commands + ;; Alternative prefix keys: C-c p, M-p, M-+, ... + :bind + ("C-c p p" . completion-at-point) ;; capf + ("C-c p t" . complete-tag) ;; etags + ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion + ("C-c p h" . cape-history) + ("C-c p f" . cape-file) + ("C-c p k" . cape-keyword) + ("C-c p s" . cape-elisp-symbol) + ("C-c p e" . cape-elisp-block) + ("C-c p a" . cape-abbrev) + ("C-c p l" . cape-line) + ("C-c p w" . cape-dict) + ("C-c p :" . cape-emoji) + ("C-c p \\" . cape-tex) + ("C-c p _" . cape-tex) + ("C-c p ^" . cape-tex) + ("C-c p &" . cape-sgml) + ("C-c p r" . cape-rfc1345) + ;; Add to the global default value of `completion-at-point-functions' which is + ;; used by `completion-at-point'. The order of the functions matters, the + ;; first function returning a result wins. Note that the list of buffer-local + ;; completion functions takes precedence over the global list. + ;; (add-to-list 'completion-at-point-functions #'cape-dabbrev) + ;; (add-to-list 'completion-at-point-functions #'cape-file) + ;; (add-to-list 'completion-at-point-functions #'cape-elisp-block) + ;; (add-to-list 'completion-at-point-functions #'cape-history) + ;; (add-to-list 'completion-at-point-functions #'cape-keyword) + ;; (add-to-list 'completion-at-point-functions #'cape-tex) + ;; (add-to-list 'completion-at-point-functions #'cape-sgml) + ;; (add-to-list 'completion-at-point-functions #'cape-rfc1345) + ;; (add-to-list 'completion-at-point-functions #'cape-abbrev) + ;; (add-to-list 'completion-at-point-functions #'cape-dict) + ;; (add-to-list 'completion-at-point-functions #'cape-elisp-symbol) + ;; (add-to-list 'completion-at-point-functions #'cape-line) + ) #+end_src @@ -1809,6 +1877,19 @@ Currently unused #+end_src +*** diff-hl +#+begin_src emacs-lisp + + (use-package diff-hl + :hook + ((prog-mode + org-mode) . diff-hl-mode) + :init + (diff-fl-flydiff-mode) + (diff-hl-margin-mode) + (diff-hl-show-hunk-mouse-mode)) + +#+end_src *** Commenting #+begin_src emacs-lisp @@ -1852,7 +1933,7 @@ The following block is 100% stolen from Dominik :P ("e" . "\\epsilon") ("z" . "\\zeta") ("h" . "\\eta") - ("t" . "\\theta") + ("th" . "\\theta") ("i" . "\\iota") ("k" . "\\kappa") ("l" . "\\lambda") @@ -2051,30 +2132,33 @@ The following block is 100% stolen from Dominik :P #+begin_src emacs-lisp - (use-package eglot - :ensure nil - :hook - ((python-mode - c-mode - c++-mode - ) . (lambda () (progn - (eglot-ensure) - (add-hook 'before-save-hook 'eglot-format nil 'local)))) - :custom - (eldoc-echo-area-use-multiline-p nil) - (completion-category-defaults nil) - :config - ;; (push '(rustic-ts-mode . eglot-rust-analyzer) eglot-server-programs) - (push '(rustic-mode . eglot-rust-analyzer) eglot-server-programs) - (add-to-list 'eglot-server-programs '((rust-mode) . (eglot-rust-analyzer "rust-analyzer"))) - ;; (add-to-list 'eglot-server-programs '((python-mode) . ("pylsp"))) - ;; (add-to-list 'eglot-server-programs '((c-mode) . ("clangd"))) - :bind (:map eglot-mode-map - ("M-(" . flymake-goto-next-error) - ("C-c ," . eglot-code-actions))) + (use-package eglot + :ensure nil + :hook + ((python-mode + c-mode + c++-mode + tex-mode + ) . (lambda () (progn + (eglot-ensure) + (add-hook 'before-save-hook 'eglot-format nil 'local)))) + :custom + (eldoc-echo-area-use-multiline-p nil) + (completion-category-defaults nil) + :config + ;; (push '(rustic-ts-mode . eglot-rust-analyzer) eglot-server-programs) + (push '(rustic-mode . eglot-rust-analyzer) eglot-server-programs) + (add-to-list 'eglot-server-programs '((rust-mode) . (eglot-rust-analyzer "rust-analyzer"))) + ;; (add-to-list 'eglot-server-programs '((python-mode) . ("pylsp"))) + ;; (add-to-list 'eglot-server-programs '((c-mode) . ("clangd"))) + :bind (:map eglot-mode-map + ("M-(" . flymake-goto-next-error) + ("C-c ," . eglot-code-actions))) - (use-package breadcrumb - :config (breadcrumb-mode)) + (defalias 'start-lsp-server #'eglot) + + (use-package breadcrumb + :config (breadcrumb-mode)) #+end_src @@ -2350,43 +2434,45 @@ The following block is 100% stolen from Dominik :P #+begin_src emacs-lisp - (use-package mu4e - :ensure nil - ;; :load-path "/usr/share/emacs/site-lisp/mu4e/" - ;;:defer 20 ; Wait until 20 seconds after startup - :config + (use-package mu4e + :ensure nil + ;; :load-path "/usr/share/emacs/site-lisp/mu4e/" + ;;:defer 20 ; Wait until 20 seconds after startup + :config - ;; This is set to 't' to avoid mail syncing issues when using mbsync - (setq send-mail-function 'sendmail-send-it) - (setq mu4e-change-filenames-when-moving t) - (setq mu4e-mu-binary (executable-find "mu")) + ;; This is set to 't' to avoid mail syncing issues when using mbsync + (setq send-mail-function 'sendmail-send-it) + (setq mu4e-change-filenames-when-moving t) + (setq mu4e-mu-binary (executable-find "mu")) - (setq mu4e-update-interval 180) - (setq mu4e-get-mail-command "mbsync -a") - (setq mu4e-maildir "~/Mail") + (setq mu4e-update-interval 180) + (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-maildir "~/Mail") - ;; enable inline images - (setq mu4e-view-show-images t) - ;; use imagemagick, if available - (when (fboundp 'imagemagick-register-types) - (imagemagick-register-types)) + ;; enable inline images + (setq mu4e-view-show-images t) + ;; use imagemagick, if available + (when (fboundp 'imagemagick-register-types) + (imagemagick-register-types)) - (setq mu4e-drafts-folder "/Drafts") - (setq mu4e-sent-folder "/Sent Mail") - (setq mu4e-refile-folder "/All Mail") - (setq mu4e-trash-folder "/Trash") + (setq mu4e-drafts-folder "/Drafts") + (setq mu4e-sent-folder "/Sent Mail") + (setq mu4e-refile-folder "/All Mail") + (setq mu4e-trash-folder "/Trash") - (setq mu4e-maildir-shortcuts - '((:maildir "/leon/Inbox" :key ?1) - (:maildir "/nautilus/Inbox" :key ?2) - (:maildir "/mrswarsel/Inbox" :key ?3) - (:maildir "/Sent Mail" :key ?s) - (:maildir "/Trash" :key ?t) - (:maildir "/Drafts" :key ?d) - (:maildir "/All Mail" :key ?a)))) + (setq mu4e-maildir-shortcuts + '((:maildir "/leon/Inbox" :key ?1) + (:maildir "/nautilus/Inbox" :key ?2) + (:maildir "/mrswarsel/Inbox" :key ?3) + (:maildir "/Sent Mail" :key ?s) + (:maildir "/Trash" :key ?t) + (:maildir "/Drafts" :key ?d) + (:maildir "/All Mail" :key ?a)))) - (setq user-mail-address "leon.schwarzaeugl@gmail.com" - user-full-name "Leon Schwarzäugl") + (setq user-mail-address "leon.schwarzaeugl@gmail.com" + user-full-name "Leon Schwarzäugl") + + (setq mu4e-hide-index-messages t) #+end_src @@ -2491,6 +2577,15 @@ Yep, none currently. dashboard-startup-banner "~/.dotfiles/wallpaper/swarsel.png" dashboard-projects-backend 'projectile dashboard-set-navigator t + dashboard-startupify-list '(dashboard-insert-banner + dashboard-insert-newline + dashboard-insert-banner-title + dashboard-insert-newline + dashboard-insert-navigator + dashboard-insert-newline + dashboard-insert-init-info + dashboard-insert-items + ) dashboard-navigator-buttons `(;; line1 ((,"" @@ -2522,7 +2617,7 @@ Yep, none currently. (lambda (&rest _) (browse-url "swarsel.win"))) ) ))) - (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) + (setq dashboard-projects-switch-function 'project-switch-project) #+end_src diff --git a/Nix.org b/Nix.org index 4469262..214b234 100644 --- a/Nix.org +++ b/Nix.org @@ -135,6 +135,8 @@ This is where the theme for the whole OS is defined. This noweb-ref section cann services.gpg-agent = { enable = true; enableSshSupport = true; + enableExtraSocket = true; + pinentryPackage = pkgs.pinentry-gtk2; }; #+end_src @@ -1313,15 +1315,9 @@ New setup for the SP3, this time using NixOS - another machine will take over th # <> imports = [ - inputs.nix-gaming.nixosModules.steamCompat ./hardware-configuration.nix ]; - nix.settings = { - substituters = ["https://nix-gaming.cachix.org"]; - trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="]; - }; - services = { getty.autologinUser = "swarsel"; greetd.settings.initial_session.user="swarsel"; @@ -1330,7 +1326,7 @@ New setup for the SP3, this time using NixOS - another machine will take over th boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; - kernelPackages = pkgs.linuxPackages_latest; + # kernelPackages = pkgs.linuxPackages_latest; }; networking = { @@ -1358,7 +1354,6 @@ New setup for the SP3, this time using NixOS - another machine will take over th }; guest = { enable = true; - x11 = true; }; }; @@ -1382,15 +1377,11 @@ New setup for the SP3, this time using NixOS - another machine will take over th programs.steam = { enable = true; extraCompatPackages = [ - inputs.nix-gaming.packages.${pkgs.system}.proton-ge + pkgs.proton-ge-bin ]; }; # Configure keymap in X11 (only used for login) - services.xserver = { - layout = "us"; - xkbVariant = "altgr-intl"; - }; services.thinkfan = { enable = false; @@ -1400,7 +1391,7 @@ New setup for the SP3, this time using NixOS - another machine will take over th users.users.swarsel = { isNormalUser = true; description = "Leon S"; - extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" ]; + extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ]; packages = with pkgs; []; }; @@ -1443,7 +1434,8 @@ New setup for the SP3, this time using NixOS - another machine will take over th programs.waybar.settings.mainBar = { cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}"; # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input"; - temperature.hwmon-path = "/sys/class/hwmon/hwmon4/temp1_input"; + temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; + temperature.input-filename = "temp1_input"; }; <> @@ -1474,7 +1466,7 @@ New setup for the SP3, this time using NixOS - another machine will take over th DP-1 = { mode = "2560x1440"; # TEMPLATE scale = "1"; - bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; + #bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; }; }; @@ -4377,25 +4369,27 @@ Section for all settings that are not really deserving of their own section. # login keymap services.xserver = { - layout = "us"; - xkbVariant = "altgr-intl"; + xkb.layout = "us"; + xkb.variant = "altgr-intl"; }; # mount NAS drive # works only at home, but w/e - fileSystems."/mnt/smb" = { - device = "//192.168.1.3/Eternor"; - fsType = "cifs"; - options = let - # this line prevents hanging on network split - automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; - in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"]; - }; + # fileSystems."/mnt/smb" = { + # device = "//192.168.1.3/Eternor"; + # fsType = "cifs"; + # options = let + # # this line prevents hanging on network split + # automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; + # in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"]; + # }; - # enable flakes - urgent line!! + # # enable flakes - urgent line!! nix.settings.experimental-features = ["nix-command" "flakes"]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; + # wordlist for look + environment.wordlist.enable = true; # gstreamer plugins for nautilus (used for file metadata) environment.sessionVariables.GST_PLUGIN_SYSTEM_PATH_1_0 = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with pkgs.gst_all_1; [ gst-plugins-good @@ -4477,11 +4471,11 @@ Mostly used to install some compilers and lps's that I want to have available wh yubikey-personalization yubikey-personalization-gui yubico-pam - yubioath-flutter - yubikey-manager - yubikey-manager-qt + # yubioath-flutter + # yubikey-manager + # yubikey-manager-qt yubico-piv-tool - pinentry + # pinentry # theme related gnome.adwaita-icon-theme @@ -4494,7 +4488,6 @@ Mostly used to install some compilers and lps's that I want to have available wh # lsp-related ------------------------------- # nix - rnix-lsp # latex texlab ghostscript_headless @@ -4544,43 +4537,61 @@ Setting up some hardware services as well as keyboard related settings. Here we #+begin_src nix :tangle profiles/common/nixos.nix - services.blueman.enable = true; + services.blueman.enable = true; - # enable discovery and usage of network devices (esp. printers) - services.printing.enable = true; - services.avahi = { - enable = true; - nssmdns = true; - openFirewall = true; - }; + # enable scanners over network + hardware.sane = { + enable = true; + extraBackends = [ pkgs.sane-airscan ]; + }; - # nautilus file manager - services.gvfs.enable = true; + # enable discovery and usage of network devices (esp. printers) + services.printing.enable = true; + services.printing.drivers = [ + pkgs.gutenprint + pkgs.gutenprintBin + ]; + services.printing.browsedConf = '' + BrowseDNSSDSubTypes _cups,_print + BrowseLocalProtocols all + BrowseRemoteProtocols all + CreateIPPPrinterQueues All - # Make CAPS work as a dual function ESC/CTRL key - services.interception-tools = { - enable = true; - udevmonConfig = let - dualFunctionKeysConfig = builtins.toFile "dual-function-keys.yaml" '' - TIMING: - TAP_MILLISEC: 200 - DOUBLE_TAP_MILLISEC: 0 - - MAPPINGS: - - KEY: KEY_CAPSLOCK - TAP: KEY_ESC - HOLD: KEY_LEFTCTRL + BrowseProtocols all ''; - in '' - - JOB: | - ${pkgs.interception-tools}/bin/intercept -g $DEVNODE \ - | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c ${dualFunctionKeysConfig} \ - | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE - DEVICE: - EVENTS: - EV_KEY: [KEY_CAPSLOCK] - ''; - }; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + # nautilus file manager + services.gvfs.enable = true; + + # Make CAPS work as a dual function ESC/CTRL key + services.interception-tools = { + enable = true; + udevmonConfig = let + dualFunctionKeysConfig = builtins.toFile "dual-function-keys.yaml" '' + TIMING: + TAP_MILLISEC: 200 + DOUBLE_TAP_MILLISEC: 0 + + MAPPINGS: + - KEY: KEY_CAPSLOCK + TAP: KEY_ESC + HOLD: KEY_LEFTCTRL + ''; + in '' + - JOB: | + ${pkgs.interception-tools}/bin/intercept -g $DEVNODE \ + | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c ${dualFunctionKeysConfig} \ + | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE + DEVICE: + EVENTS: + EV_KEY: [KEY_CAPSLOCK] + ''; + }; #+end_src @@ -4658,6 +4669,17 @@ Also, I define some useful shell scripts here. audacity sox + # printing + cups + gnome.simple-scan + + # dict + (aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ])) + + # utilities + util-linux + nmap + # b2 backup @backblaze restic @@ -4717,7 +4739,6 @@ Also, I define some useful shell scripts here. networkmanagerapplet psmisc # kill etc lm_sensors - # syncthingtray # jq # used for searching the i3 tree in check.sh files # specifically needed for anki @@ -4754,7 +4775,7 @@ Also, I define some useful shell scripts here. # gnome.gnome-clocks # wlogout # jdiskreport - # syncthingtray + syncthingtray # monitor #keychain @@ -4874,6 +4895,36 @@ Also, I define some useful shell scripts here. ''; }) + (pkgs.writeShellApplication { + name = "pass-fuzzel-otp"; + runtimeInputs = [ pkgs.fuzzel (pkgs.pass.withExtensions (exts: [exts.pass-otp]))]; + text = '' + shopt -s nullglob globstar + + typeit=0 + if [[ $# -ge 1 && $1 == "--type" ]]; then + typeit=1 + shift + fi + + export PASSWORD_STORE_DIR=~/.local/share/password-store + prefix=''${PASSWORD_STORE_DIR-~/.local/share/password-store} + password_files=( "$prefix"/otp/**/*.gpg ) + password_files=( "''${password_files[@]#"$prefix"/}" ) + password_files=( "''${password_files[@]%.gpg}" ) + + password=$(printf '%s\n' "''${password_files[@]}" | fuzzel --dmenu "$@") + + [[ -n $password ]] || exit + + if [[ $typeit -eq 0 ]]; then + pass otp -c "$password" &>/tmp/pass-fuzzel + else + pass otp "$password" | { IFS= read -r pass; printf %s "$pass"; } | wtype - + fi + notify-send -u critical -a pass -t 1000 "Copied/Typed OTPassword" + ''; + }) ]; @@ -5155,6 +5206,11 @@ As for the `home.sessionVariables`, it should be noted that environment variable source = ../../programs/emacs/early-init.el; target = ".emacs.d/early-init.el"; }; + # on NixOS, Emacs does not find the aspell dicts easily. Write the configuration manually + ".aspell.conf" = { + source = ../../programs/config/.aspell.conf; + target = ".aspell.conf"; + }; }; home.sessionVariables = { @@ -5196,7 +5252,6 @@ As for the `home.sessionVariables`, it should be noted that environment variable programs.zoxide.enable = true; programs.eza = { enable = true; - enableAliases = true; icons = true; git = true; extraOptions = [ @@ -5406,8 +5461,9 @@ zsh is clearly the most convenient shell for me and it happens to be super neat c="git --git-dir=$HOME/.dotfiles/.git --work-tree=$HOME/.dotfiles/"; passpush = "cd ~/.local/share/password-store; git add .; git commit -m 'pass file changes'; git push; cd -;"; passpull = "cd ~/.local/share/password-store; git pull; cd -;"; + hotspot = "nmcli connection up local; nmcli device wifi hotspot password 12345678;"; }; - enableAutosuggestions = true; + autosuggestion.enable = true; enableCompletion = true; syntaxHighlighting.enable = true; autocd = false; @@ -5604,411 +5660,427 @@ Again I am just using the first bar option here that I was able to find good und #+begin_src nix :tangle profiles/common/home.nix - programs.waybar = { + programs.waybar = { - enable = true; - # systemd.enable = true; - settings = { - mainBar = { - layer = "top"; - position = "top"; - modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window"]; - modules-center = [ "sway/mode" "custom/configwarn" ]; - "sway/mode" = { - format = "{}"; - }; + enable = true; + # systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window"]; + modules-center = [ "sway/mode" "custom/configwarn" ]; + "sway/mode" = { + format = "{}"; + }; - "custom/configwarn" = { - exec= "bash ~/.dotfiles/scripts/checkconfigstatus.sh"; - interval= 60; - }; + "custom/configwarn" = { + exec= "bash ~/.dotfiles/scripts/checkconfigstatus.sh"; + interval= 60; + }; - "group/hardware" = { - orientation = "inherit"; - drawer = { - "transition-left-to-right" = true; - }; - modules = [ - "tray" - "temperature" - "custom/left-arrow-light" - "disk" - "custom/left-arrow-dark" - "memory" - "custom/left-arrow-light" - "cpu" - "custom/left-arrow-dark" - ]; - }; + "group/hardware" = { + orientation = "inherit"; + drawer = { + "transition-left-to-right" = false; + }; + modules = [ + "tray" + "temperature" + "power-profiles-daemon" + "custom/left-arrow-light" + "disk" + "custom/left-arrow-dark" + "memory" + "custom/left-arrow-light" + "cpu" + "custom/left-arrow-dark" + ]; + }; - temperature = { - critical-threshold = 80; - format-critical = " {temperatureC}°C"; - format = " {temperatureC}°C"; + power-profiles-daemon = { + format= "{icon}"; + tooltip-format= "Power profile: {profile}\nDriver: {driver}"; + tooltip= true; + format-icons= { + "default"= ""; + "performance"= ""; + "balanced"= ""; + "power-saver"= ""; + }; + }; - }; + temperature = { + critical-threshold = 80; + format-critical = " {temperatureC}°C"; + format = " {temperatureC}°C"; - mpris = { - format= "{player_icon} {title} [{position}/{length}]"; - format-paused= "{player_icon} {title} [{position}/{length}]"; - player-icons= { - "default" = "▶ "; - "mpv" = "🎵 "; - "spotify" = " "; - }; - status-icons= { - "paused"= " "; - }; - interval = 1; - title-len = 20; - artist-len = 20; - album-len = 10; - }; - "custom/left-arrow-dark" = { - format = ""; - tooltip = false; - }; - "custom/outer-left-arrow-dark"= { - format = ""; - tooltip = false; - }; - "custom/left-arrow-light"= { - format= ""; - tooltip= false; - }; - "custom/right-arrow-dark"= { - format= ""; - tooltip= false; - }; - "custom/outer-right-arrow-dark"= { - format= ""; - tooltip= false; - }; - "custom/right-arrow-light"= { - format= ""; - tooltip= false; - }; - "sway/workspaces"= { - disable-scroll= true; - format= "{name}"; - }; + }; - "clock#1"= { - min-length= 8; - interval= 1; - format= "{:%H:%M:%S}"; - # on-click-right= "gnome-clocks"; - tooltip-format= "{:%Y %B}\n{calendar}"; - }; + mpris = { + format= "{player_icon} {title} [{position}/{length}]"; + format-paused= "{player_icon} {title} [{position}/{length}]"; + player-icons= { + "default" = "▶ "; + "mpv" = "🎵 "; + "spotify" = " "; + }; + status-icons= { + "paused"= " "; + }; + interval = 1; + title-len = 20; + artist-len = 20; + album-len = 10; + }; + "custom/left-arrow-dark" = { + format = ""; + tooltip = false; + }; + "custom/outer-left-arrow-dark"= { + format = ""; + tooltip = false; + }; + "custom/left-arrow-light"= { + format= ""; + tooltip= false; + }; + "custom/right-arrow-dark"= { + format= ""; + tooltip= false; + }; + "custom/outer-right-arrow-dark"= { + format= ""; + tooltip= false; + }; + "custom/right-arrow-light"= { + format= ""; + tooltip= false; + }; + "sway/workspaces"= { + disable-scroll= true; + format= "{name}"; + }; - "clock#2"= { - format= "{:%d. %B %Y}"; - # on-click-right= "gnome-clocks"; - tooltip-format= "{:%Y %B}\n{calendar}"; - }; + "clock#1"= { + min-length= 8; + interval= 1; + format= "{:%H:%M:%S}"; + # on-click-right= "gnome-clocks"; + tooltip-format= "{:%Y %B}\n{calendar}"; + }; + + "clock#2"= { + format= "{:%d. %B %Y}"; + # on-click-right= "gnome-clocks"; + tooltip-format= "{:%Y %B}\n{calendar}"; + }; - pulseaudio= { - format= "{icon} {volume:2}%"; - format-bluetooth= "{icon} {volume}%"; - format-muted= "MUTE"; - format-icons= { - headphones= ""; - default= [ - "" - "" - ]; - }; - scroll-step= 1; - on-click= "pamixer -t"; - on-click-right= "pavucontrol"; - }; - memory= { - interval= 5; - format= " {}%"; - tooltip-format= "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; - }; - cpu= { - min-length= 6; - interval= 5; - format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; - # on-click-right= "com.github.stsdc.monitor"; - on-click-right= "kitty -o confirm_os_window_close=0 btm"; + pulseaudio= { + format= "{icon} {volume:2}%"; + format-bluetooth= "{icon} {volume}%"; + format-muted= "MUTE"; + format-icons= { + headphones= ""; + default= [ + "" + "" + ]; + }; + scroll-step= 1; + on-click= "pamixer -t"; + on-click-right= "pavucontrol"; + }; + memory= { + interval= 5; + format= " {}%"; + tooltip-format= "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; + }; + cpu= { + min-length= 6; + interval= 5; + format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; + # on-click-right= "com.github.stsdc.monitor"; + on-click-right= "kitty -o confirm_os_window_close=0 btm"; - }; - battery= { - states= { - "warning"= 60; - "error"= 30; - "critical"= 15; - }; - interval=5; - format= "{icon} {capacity}%"; - format-charging= "{capacity}% "; - format-plugged= "{capacity}% "; - format-icons= [ - "" - "" - "" - "" - "" - ]; - on-click-right= "wlogout -p layer-shell"; - }; - disk= { - interval= 30; - format= "Disk {percentage_used:2}%"; - path= "/"; - states= { - "warning"= 80; - "critical"= 90; - }; - tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)"; - }; - tray= { - icon-size= 20; - }; - network= { - interval = 5; - format-wifi= "{signalStrength}% "; - format-ethernet= ""; - format-linked= "{ifname} (No IP) "; - format-disconnected= "Disconnected ⚠"; - format-alt= "{ifname}: {ipaddr}/{cidr}"; - tooltip-format-ethernet= "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; - tooltip-format-wifi= "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; - }; - }; - }; + }; + battery= { + states= { + "warning"= 60; + "error"= 30; + "critical"= 15; + }; + interval=5; + format= "{icon} {capacity}%"; + format-charging= "{capacity}% "; + format-plugged= "{capacity}% "; + format-icons= [ + "" + "" + "" + "" + "" + ]; + on-click-right= "wlogout -p layer-shell"; + }; + disk= { + interval= 30; + format= "Disk {percentage_used:2}%"; + path= "/"; + states= { + "warning"= 80; + "critical"= 90; + }; + tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)"; + }; + tray= { + icon-size= 20; + }; + network= { + interval = 5; + format-wifi= "{signalStrength}% "; + format-ethernet= ""; + format-linked= "{ifname} (No IP) "; + format-disconnected= "Disconnected ⚠"; + format-alt= "{ifname}: {ipaddr}/{cidr}"; + tooltip-format-ethernet= "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; + tooltip-format-wifi= "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}"; + }; + }; + }; - style = '' - @define-color foreground #fdf6e3; - @define-color background #1a1a1a; - @define-color background-alt #292b2e; - @define-color foreground-warning #268bd2; - @define-color background-warning @background; - @define-color foreground-error red; - @define-color background-error @background; - @define-color foreground-critical gold; - @define-color background-critical blue; + style = '' + @define-color foreground #fdf6e3; + @define-color background #1a1a1a; + @define-color background-alt #292b2e; + @define-color foreground-warning #268bd2; + @define-color background-warning @background; + @define-color foreground-error red; + @define-color background-error @background; + @define-color foreground-critical gold; + @define-color background-critical blue; - ,* { - border: none; - border-radius: 0; - font-family: "FiraCode Nerd Font Propo", "Font Awesome 5 Free"; - font-size: 14px; - min-height: 0; - margin: -1px 0px; - } + ,* { + border: none; + border-radius: 0; + font-family: "FiraCode Nerd Font Propo", "Font Awesome 5 Free"; + font-size: 14px; + min-height: 0; + margin: -1px 0px; + } - window#waybar { - background: transparent; - color: @foreground; - transition-duration: .5s; - } + window#waybar { + background: transparent; + color: @foreground; + transition-duration: .5s; + } - window#waybar.hidden { - opacity: 0.2; - } + window#waybar.hidden { + opacity: 0.2; + } - #mpris { - padding: 0 10px; - background-color: transparent; - color: #1DB954; - font-family: Monospace; - font-size: 12px; - } + #mpris { + padding: 0 10px; + background-color: transparent; + color: #1DB954; + font-family: Monospace; + font-size: 12px; + } - #custom-right-arrow-dark, - #custom-left-arrow-dark { - color: @background; - background: @background-alt; - font-size: 24px; - } + #custom-right-arrow-dark, + #custom-left-arrow-dark { + color: @background; + background: @background-alt; + font-size: 24px; + } - #window { - font-size: 12px; - padding: 0 20px; - } + #window { + font-size: 12px; + padding: 0 20px; + } - #mode { - background: @background-critical; - color: @foreground-critical; - padding: 0 3px; - } + #mode { + background: @background-critical; + color: @foreground-critical; + padding: 0 3px; + } - #custom-configwarn { - color: black; - padding: 0 3px; - animation-name: configblink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } + #custom-configwarn { + color: black; + padding: 0 3px; + animation-name: configblink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } - #custom-outer-right-arrow-dark, - #custom-outer-left-arrow-dark { - color: @background; - font-size: 24px; - } + #custom-outer-right-arrow-dark, + #custom-outer-left-arrow-dark { + color: @background; + font-size: 24px; + } - #custom-outer-left-arrow-dark, - #custom-left-arrow-dark, - #custom-left-arrow-light { - margin: 0 -1px; - } + #custom-outer-left-arrow-dark, + #custom-left-arrow-dark, + #custom-left-arrow-light { + margin: 0 -1px; + } - #custom-right-arrow-light, - #custom-left-arrow-light { - color: @background-alt; - background: @background; - font-size: 24px; - } + #custom-right-arrow-light, + #custom-left-arrow-light { + color: @background-alt; + background: @background; + font-size: 24px; + } - #workspaces, - #clock.1, - #clock.2, - #clock.3, - #pulseaudio, - #memory, - #cpu, - #temperature, - #mpris, - #tray { - background: @background; - } + #workspaces, + #clock.1, + #clock.2, + #clock.3, + #pulseaudio, + #memory, + #cpu, + #temperature, + #power-profiles-daemon, + #mpris, + #tray { + background: @background; + } - #network, - #clock.2, - #battery, - #cpu, - #custom-pseudobat, - #disk { - background: @background-alt; - } + #network, + #clock.2, + #battery, + #cpu, + #custom-pseudobat, + #disk { + background: @background-alt; + } - #workspaces button { - padding: 0 2px; - color: #fdf6e3; - } - #workspaces button.focused { - color: @foreground-warning; - } + #workspaces button { + padding: 0 2px; + color: #fdf6e3; + } + #workspaces button.focused { + color: @foreground-warning; + } - #workspaces button:hover { - background: @foreground; - color: @background; - border: @foreground; - padding: 0 2px; - box-shadow: inherit; - text-shadow: inherit; - } + #workspaces button:hover { + background: @foreground; + color: @background; + border: @foreground; + padding: 0 2px; + box-shadow: inherit; + text-shadow: inherit; + } - #workspaces button.urgent { - color: @background-critical; - background: @foreground-critical; - } + #workspaces button.urgent { + color: @background-critical; + background: @foreground-critical; + } - #network { - color: #cc99c9; - } + #network { + color: #cc99c9; + } - #temperature { - color: #9ec1cf; - } + #temperature, + #power-profiles-daemon { + color: #9ec1cf; + } - #disk { - /*color: #b58900;*/ - color: #9ee09e; - } + #disk { + /*color: #b58900;*/ + color: #9ee09e; + } - #disk.warning { - color: @foreground-error; - background-color: @background-error; - } - #disk.critical, - #temperature.critical { - color: @foreground-critical; - background-color: @background-critical; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - #pulseaudio.muted { - color: @foreground-error; - } - #memory { - /*color: #2aa198;*/ - color: #fdfd97; - } - #cpu { - /*color: #6c71c4;*/ - color: #feb144; - } + #disk.warning { + color: @foreground-error; + background-color: @background-error; + } + #disk.critical, + #temperature.critical { + color: @foreground-critical; + background-color: @background-critical; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + #pulseaudio.muted { + color: @foreground-error; + } + #memory { + /*color: #2aa198;*/ + color: #fdfd97; + } + #cpu { + /*color: #6c71c4;*/ + color: #feb144; + } - #pulseaudio { - /*color: #268bd2;*/ - color: #ff6663; - } + #pulseaudio { + /*color: #268bd2;*/ + color: #ff6663; + } - #battery, - #custom-pseudobat { - color: cyan; - } - #battery.discharging { - color: #859900; - } + #battery, + #custom-pseudobat { + color: cyan; + } + #battery.discharging { + color: #859900; + } - @keyframes blink { - to { - color: @foreground-error; - background-color: @background-error; - } - } - @keyframes configblink { - to { - color: @foreground-error; - background-color: transparent; - } - } + @keyframes blink { + to { + color: @foreground-error; + background-color: @background-error; + } + } + @keyframes configblink { + to { + color: @foreground-error; + background-color: transparent; + } + } - #battery.critical:not(.charging) { - color: @foreground-critical; - background-color: @background-critical; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } + #battery.critical:not(.charging) { + color: @foreground-critical; + background-color: @background-critical; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } - #clock.1, - #clock.2, - #clock.3 { - font-family: Monospace; - } + #clock.1, + #clock.2, + #clock.3 { + font-family: Monospace; + } - #clock, - #pulseaudio, - #memory, - #cpu, - #tray, - #temperature, - #network, - #mpris, - #battery, - #custom-pseudobat, - #disk { - padding: 0 3px; - } - ''; - }; + #clock, + #pulseaudio, + #memory, + #cpu, + #tray, + #temperature, + #power-profiles-daemon, + #network, + #mpris, + #battery, + #custom-pseudobat, + #disk { + padding: 0 3px; + } + ''; + }; #+end_src @@ -6134,14 +6206,14 @@ Again I am just using the first bar option here that I was able to find good und }; "Home Manager Options" = { - urls = [{ template = "https://mipmip.github.io/home-manager-option-search/"; + urls = [{ template = "https://home-manager-options.extranix.com/"; params = [ { name = "query"; value = "{searchTerms}"; } ]; }]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@hm" ]; + definedAliases = [ "@hm" "@ho" "@hmo" ]; }; "Google".metaData.alias = "@g"; @@ -6178,7 +6250,7 @@ Services that can be defined through home-manager should be defined here. }; services.mbsync = { - enable = false; + enable = true; }; @@ -6190,13 +6262,16 @@ Services that can be defined through home-manager should be defined here. services.syncthing = { enable = true; tray = { - enable = false; + enable = false; # we enable this by installing the syncthingtray package instead, it works better. }; }; # this enables the emacs server - services.emacs.enable = true; - + services.emacs = { + enable = true; + # socketActivation.enable = false; + # startWithUserSession = "graphical"; + }; #+end_src *** Mako @@ -6243,7 +6318,8 @@ I am currently using SwayFX, which adds some nice effects to sway, like rounded wayland.windowManager.sway = { enable = true; - package = pkgs.swayfx; + # package = pkgs.swayfx; + package = pkgs.sway; systemd.enable = true; systemd.xdgAutostart = true; wrapperFeatures.gtk = true; @@ -6271,7 +6347,9 @@ I am currently using SwayFX, which adds some nice effects to sway, like rounded "${modifier}+F12" = "scratchpad show"; "${modifier}+c" = "exec qalculate-gtk"; "${modifier}+p" = "exec pass-fuzzel"; + "${modifier}+o" = "exec pass-fuzzel-otp"; "${modifier}+Shift+p" = "exec pass-fuzzel --type"; + "${modifier}+Shift+o" = "exec pass-fuzzel-otp --type"; "${modifier}+Escape" = "mode $exit"; # "${modifier}+Shift+Escape" = "exec com.github.stsdc.monitor"; "${modifier}+Shift+Escape" = "exec kitty -o confirm_os_window_close=0 btm"; @@ -6400,6 +6478,12 @@ I am currently using SwayFX, which adds some nice effects to sway, like rounded app_id = ".*"; }; } + { + command = "opacity 1"; + criteria = { + app_id = "Gimp-2.10"; + }; + } { command = "opacity 0.99"; criteria = { @@ -6479,6 +6563,17 @@ I am currently using SwayFX, which adds some nice effects to sway, like rounded # "; extraConfig =let modifier = config.wayland.windowManager.sway.config.modifier; + swayfxSettings = " + blur enable + blur_xray disable + blur_passes 1 + blur_radius 1 + shadows enable + corner_radius 2 + titlebar_separator disable + default_dim_inactive 0.02 + "; + swayfxSettingsOff = ""; in " exec_always autotiling set $exit \"exit: [s]leep, [p]oweroff, [r]eboot, [l]ogout\" @@ -6498,14 +6593,7 @@ I am currently using SwayFX, which adds some nice effects to sway, like rounded exec systemctl --user import-environment - blur enable - blur_xray disable - blur_passes 1 - blur_radius 1 - shadows enable - corner_radius 2 - titlebar_separator disable - default_dim_inactive 0.02 + ${swayfxSettingsOff} "; }; diff --git a/flake.lock b/flake.lock index 85a301b..8b1a1c3 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1689633990, - "narHash": "sha256-iwvQg2Vx0IIDWZaKo8Xmzxlv1YPHg+Kp/QSv8dRv0RY=", + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "dddf2e1c04845d43c89a8e9e37d574519649a404", + "rev": "665b3c6748534eb766c777298721cece9453fdae", "type": "github" }, "original": { @@ -18,22 +18,6 @@ "type": "github" } }, - "base16-alacritty": { - "flake": false, - "locked": { - "lastModified": 1674275109, - "narHash": "sha256-Adwx9yP70I6mJrjjODOgZJjt4OPPe8gJu7UuBboXO4M=", - "owner": "aarowill", - "repo": "base16-alacritty", - "rev": "63d8ae5dfefe5db825dd4c699d0cdc2fc2c3eaf7", - "type": "github" - }, - "original": { - "owner": "aarowill", - "repo": "base16-alacritty", - "type": "github" - } - }, "base16-fish": { "flake": false, "locked": { @@ -138,11 +122,11 @@ ] }, "locked": { - "lastModified": 1699218802, - "narHash": "sha256-5l0W4Q7z7A4BCstaF5JuBqXOVrZ3Vqst5+hUnP7EdUc=", + "lastModified": 1711299236, + "narHash": "sha256-6/JsyozOMKN8LUGqWMopKTSiK8N79T8Q+hcxu2KkTXg=", "owner": "ipetkov", "repo": "crane", - "rev": "2d6c2aaff5a05e443eb15efddc21f9c73720340c", + "rev": "880573f80d09e18a11713f402b9e6172a085449f", "type": "github" }, "original": { @@ -160,11 +144,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1702175135, - "narHash": "sha256-oiXRVftJwABfQ85KucnUp35RN8F4jxGDg3kXMURspXo=", + "lastModified": 1715101438, + "narHash": "sha256-xd5lymHwykYlqCPap6m7QG71Xuv0ShMjulQOLT8Hg6A=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "956b70d64d5ff36c53242cd335fe8274c0cfa2e7", + "rev": "2fd9e33a0e73cd390f35ecefe89ec9e271e4c2cb", "type": "github" }, "original": { @@ -212,24 +196,6 @@ "nixpkgs" ] }, - "locked": { - "lastModified": 1698882062, - "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, "locked": { "lastModified": 1709336216, "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", @@ -244,16 +210,34 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1714641030, + "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -267,11 +251,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -320,11 +304,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -333,6 +317,23 @@ "type": "github" } }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1698794309, + "narHash": "sha256-/TIkZ8y5Wv3QHLFp79Poao9fINurKs5pa4z0CRe+F8s=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "a7c169c6c29cf02a4c392fa0acbbc5f5072823e7", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "45.1", + "repo": "gnome-shell", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -340,11 +341,11 @@ ] }, "locked": { - "lastModified": 1702159252, - "narHash": "sha256-4mYOL1EhOmt92OtYsHXRViWrSHvR5obLfCllMmQsUzY=", + "lastModified": 1715077503, + "narHash": "sha256-AfHQshzLQfUqk/efMtdebHaQHqVntCMjhymQzVFLes0=", "owner": "nix-community", "repo": "home-manager", - "rev": "e6b7303bd149723c57ca23f5a9428482d6b07306", + "rev": "6e277d9566de9976f47228dd8c580b97488734d4", "type": "github" }, "original": { @@ -383,11 +384,11 @@ ] }, "locked": { - "lastModified": 1700847865, - "narHash": "sha256-uWaOIemGl9LF813MW0AEgCBpKwFo2t1Wv3BZc6e5Frw=", + "lastModified": 1711915616, + "narHash": "sha256-co6LoFA+j6BZEeJNSR8nZ4oOort5qYPskjrDHBaJgmo=", "owner": "nix-community", "repo": "home-manager", - "rev": "8cedd63eede4c22deb192f1721dd67e7460e1ebe", + "rev": "820be197ccf3adaad9a8856ef255c13b6cc561a6", "type": "github" }, "original": { @@ -407,11 +408,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1701686621, - "narHash": "sha256-OAR4jhfldEGuXH8DB9w8YrFLcEsZsApWdYPsmJHwM/E=", + "lastModified": 1713369831, + "narHash": "sha256-G4OGxvlIIjphpkxcRAkf1QInYsAeqbfNh6Yl1JLy2uM=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "5655251a38f2a31f26aebae3e0d7fe0f5bd74683", + "rev": "850f27322239f8cfa56b122cc9a278ab99a49015", "type": "github" }, "original": { @@ -449,11 +450,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1710033370, - "narHash": "sha256-f44y3CIkskEbs6rnMU+QQfLvqPkM3JuVaiKrtnX/we8=", + "lastModified": 1714872073, + "narHash": "sha256-Gybo6MqJ2tva9vMaSxOgie8uVObiP0LxD2FMokiR0X4=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "7ad732aefc2c5187d63d1d171294f03fae9d4445", + "rev": "b85b9c3afa1bfee0150580eb76c52e572a85a6a9", "type": "github" }, "original": { @@ -493,11 +494,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1685908677, - "narHash": "sha256-E4zUPEUFyVWjVm45zICaHRpfGepfkE9Z2OECV9HXfA4=", + "lastModified": 1713543440, + "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", "owner": "guibou", "repo": "nixGL", - "rev": "489d6b095ab9d289fe11af0219a9ff00fe87c7c5", + "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", "type": "github" }, "original": { @@ -508,11 +509,11 @@ }, "nixlib": { "locked": { - "lastModified": 1693701915, - "narHash": "sha256-waHPLdDYUOHSEtMKKabcKIMhlUOHPOOPQ9UyFeEoovs=", + "lastModified": 1712450863, + "narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "f5af57d3ef9947a70ac86e42695231ac1ad00c25", + "rev": "3c62b6a12571c9a7f65ab037173ee153d539905f", "type": "github" }, "original": { @@ -529,11 +530,11 @@ ] }, "locked": { - "lastModified": 1701689616, - "narHash": "sha256-ewnfgvRy73HoP5KnYmy1Rcr4m4yShvsb6TCCaKoW8pc=", + "lastModified": 1713783234, + "narHash": "sha256-3yh0nqI1avYUmmtqqTW3EVfwaLE+9ytRWxsA5aWtmyI=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "246219bc21b943c6f6812bb7744218ba0df08600", + "rev": "722b512eb7e6915882f39fff0e4c9dd44f42b77e", "type": "github" }, "original": { @@ -544,11 +545,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1709410583, - "narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=", + "lastModified": 1715010655, + "narHash": "sha256-FmdhvR/hgBkPDvIv/HOEIQsSMaVXh8wvTrnep8dF3Jc=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc", + "rev": "d1659c9eb8af718118fb4bbe2c86797c8b8623eb", "type": "github" }, "original": { @@ -560,11 +561,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1699354722, - "narHash": "sha256-abmqUReg4PsyQSwv4d0zjcWpMHrd3IFJiTb2tZpfF04=", + "lastModified": 1711297276, + "narHash": "sha256-KtHBr73Z729krfueBV6pUsEyq/4vILGP77DPmrKOTrI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cfbb29d76949ae53c457f152c52c173ea4bdd862", + "rev": "3d41d1087707826b3a90685ab69147f8dc8145d5", "type": "github" }, "original": { @@ -592,29 +593,23 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", - "type": "github" + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" } }, "nixpkgs-mautrix-signal": { "locked": { - "lastModified": 1703864075, - "narHash": "sha256-0TtwnLaBydIjpugK1kIIL18dRXZ9KaECfQmkJVBFEa0=", + "lastModified": 1704022861, + "narHash": "sha256-jiNWj17KcjnaUHpIcv20i0X68Jy8isa13I1QKTvUwUk=", "owner": "niklaskorz", "repo": "nixpkgs", - "rev": "d5ba4fc361fbdd71300b190d4fdb82d3c9e46938", + "rev": "104113a9fa1d330e024f7f2eab1f7d861f0cda3f", "type": "github" }, "original": { @@ -626,59 +621,59 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1701805708, - "narHash": "sha256-hh0S14E816Img0tPaNQSEKFvSscSIrvu1ypubtfh6M4=", + "lastModified": 1714971268, + "narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0561103cedb11e7554cf34cea81e5f5d578a4753", + "rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1702148972, - "narHash": "sha256-h2jODFP6n+ABrUWcGRSVPRFfLOkM9TJ2pO+h+9JcaL0=", + "lastModified": 1714858427, + "narHash": "sha256-tCxeDP4C1pWe2rYY3IIhdA40Ujz32Ufd4tcrHPSKx2M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b8f33c044e51de6dde3ad80a9676945e0e4e3227", + "rev": "b980b91038fc4b09067ef97bbe5ad07eecca1e76", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.05", + "ref": "release-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1709968316, - "narHash": "sha256-4rZEtEDT6jcgRaqxsatBeds7x1PoEiEjb6QNGb4mNrk=", + "lastModified": 1714809261, + "narHash": "sha256-hfBmnYFyz9I1mdrC3tX1A+dF9cOUcds5PIMPxrT+cRk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0e7f98a5f30166cbed344569426850b21e4091d4", + "rev": "d32560238207b8e26d88b265207b216ee46b8450", "type": "github" }, "original": { @@ -705,11 +700,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1701718080, - "narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", + "lastModified": 1714906307, + "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", + "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588", "type": "github" }, "original": { @@ -721,11 +716,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1702029940, - "narHash": "sha256-qM3Du0perpLesh5hr87mVPZ79McMUKIWUH7EQMh2kWo=", + "lastModified": 1714809261, + "narHash": "sha256-hfBmnYFyz9I1mdrC3tX1A+dF9cOUcds5PIMPxrT+cRk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e9ef8a102c555da4f8f417fe5cf5bd539d8a38b7", + "rev": "d32560238207b8e26d88b265207b216ee46b8450", "type": "github" }, "original": { @@ -737,11 +732,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1700856099, - "narHash": "sha256-RnEA7iJ36Ay9jI0WwP+/y4zjEhmeN6Cjs9VOFBH7eVQ=", + "lastModified": 1713596654, + "narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0bd59c54ef06bc34eca01e37d689f5e46b3fe2f1", + "rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be", "type": "github" }, "original": { @@ -801,11 +796,11 @@ }, "nur": { "locked": { - "lastModified": 1702190088, - "narHash": "sha256-TpNx/FtOHakBT29LOaG9Cd73lF+4PLzEadPGnkExHrM=", + "lastModified": 1715119845, + "narHash": "sha256-F95GvBNyRS0FBiSO/y9MrFJ8Xbwl4D88/iyLgaAfa2M=", "owner": "nix-community", "repo": "NUR", - "rev": "d4924c10dd9ea639e32cee3761adfa0461c5130a", + "rev": "e771528ea78a7dd751904f909790956f2b0fde66", "type": "github" }, "original": { @@ -853,11 +848,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1699271226, - "narHash": "sha256-8Jt1KW3xTjolD6c6OjJm9USx/jmL+VVmbooADCkdDfU=", + "lastModified": 1710923068, + "narHash": "sha256-6hOpUiuxuwpXXc/xfJsBUJeqqgGI+JMJuLo45aG3cKc=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ea758da1a6dcde6dc36db348ed690d09b9864128", + "rev": "e611897ddfdde3ed3eaac4758635d7177ff78673", "type": "github" }, "original": { @@ -896,11 +891,11 @@ ] }, "locked": { - "lastModified": 1699409596, - "narHash": "sha256-L3g1smIol3dGTxkUQOlNShJtZLvjLzvtbaeTRizwZBU=", + "lastModified": 1711246447, + "narHash": "sha256-g9TOluObcOEKewFo2fR4cn51Y/jSKhRRo4QZckHLop0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "58240e1ac627cef3ea30c7732fedfb4f51afd8e7", + "rev": "dcc802a6ec4e9cc6a1c8c393327f0c42666f22e4", "type": "github" }, "original": { @@ -915,11 +910,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1702177193, - "narHash": "sha256-J2409SyXROoUHYXVy9h4Pj0VU8ReLuy/mzBc9iK4DBg=", + "lastModified": 1715035358, + "narHash": "sha256-RY6kqhpCPa/q3vbqt3iYRyjO3hJz9KZnshMjbpPon8o=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d806e546f96c88cd9f7d91c1c19ebc99ba6277d9", + "rev": "893e3df091f6838f4f9d71c61ab079d5c5dedbd1", "type": "github" }, "original": { @@ -931,7 +926,6 @@ "stylix": { "inputs": { "base16": "base16", - "base16-alacritty": "base16-alacritty", "base16-fish": "base16-fish", "base16-foot": "base16-foot", "base16-helix": "base16-helix", @@ -939,15 +933,16 @@ "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", "flake-compat": "flake-compat_2", + "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1701532764, - "narHash": "sha256-Jrizp/nITbul2HBIraQRDw5lyJnzTsj0K9wZUFYX2gg=", + "lastModified": 1715108364, + "narHash": "sha256-6AlOCZCSEpdHEpRQ8pwaGkbfSHVx11+e1+1CMp8+Huc=", "owner": "danth", "repo": "stylix", - "rev": "17a452c5d58bb90057d49c7e3e613b5e6dc1c0f4", + "rev": "8f7abd2252d0d773ca202cf2c190b47d439f045d", "type": "github" }, "original": { diff --git a/profiles/TEMPLATE/home.nix b/profiles/TEMPLATE/home.nix index 8b0f895..c57eb60 100644 --- a/profiles/TEMPLATE/home.nix +++ b/profiles/TEMPLATE/home.nix @@ -6,6 +6,8 @@ services.gpg-agent = { enable = true; enableSshSupport = true; + enableExtraSocket = true; + pinentryPackage = pkgs.pinentry-gtk2; }; home = { diff --git a/profiles/common/home.nix b/profiles/common/home.nix index 2718a34..303db04 100644 --- a/profiles/common/home.nix +++ b/profiles/common/home.nix @@ -13,6 +13,17 @@ audacity sox + # printing + cups + gnome.simple-scan + + # dict + (aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ])) + + # utilities + util-linux + nmap + # b2 backup @backblaze restic @@ -72,7 +83,6 @@ networkmanagerapplet psmisc # kill etc lm_sensors - # syncthingtray # jq # used for searching the i3 tree in check.sh files # specifically needed for anki @@ -109,7 +119,7 @@ # gnome.gnome-clocks # wlogout # jdiskreport - # syncthingtray + syncthingtray # monitor #keychain @@ -229,6 +239,36 @@ ''; }) + (pkgs.writeShellApplication { + name = "pass-fuzzel-otp"; + runtimeInputs = [ pkgs.fuzzel (pkgs.pass.withExtensions (exts: [exts.pass-otp]))]; + text = '' + shopt -s nullglob globstar + + typeit=0 + if [[ $# -ge 1 && $1 == "--type" ]]; then + typeit=1 + shift + fi + + export PASSWORD_STORE_DIR=~/.local/share/password-store + prefix=''${PASSWORD_STORE_DIR-~/.local/share/password-store} + password_files=( "$prefix"/otp/**/*.gpg ) + password_files=( "''${password_files[@]#"$prefix"/}" ) + password_files=( "''${password_files[@]%.gpg}" ) + + password=$(printf '%s\n' "''${password_files[@]}" | fuzzel --dmenu "$@") + + [[ -n $password ]] || exit + + if [[ $typeit -eq 0 ]]; then + pass otp -c "$password" &>/tmp/pass-fuzzel + else + pass otp "$password" | { IFS= read -r pass; printf %s "$pass"; } | wtype - + fi + notify-send -u critical -a pass -t 1000 "Copied/Typed OTPassword" + ''; + }) ]; @@ -459,6 +499,11 @@ home.file = { source = ../../programs/emacs/early-init.el; target = ".emacs.d/early-init.el"; }; + # on NixOS, Emacs does not find the aspell dicts easily. Write the configuration manually + ".aspell.conf" = { + source = ../../programs/config/.aspell.conf; + target = ".aspell.conf"; + }; }; home.sessionVariables = { @@ -493,7 +538,6 @@ programs.direnv = { programs.zoxide.enable = true; programs.eza = { enable = true; - enableAliases = true; icons = true; git = true; extraOptions = [ @@ -674,8 +718,9 @@ programs.zsh = { c="git --git-dir=$HOME/.dotfiles/.git --work-tree=$HOME/.dotfiles/"; passpush = "cd ~/.local/share/password-store; git add .; git commit -m 'pass file changes'; git push; cd -;"; passpull = "cd ~/.local/share/password-store; git pull; cd -;"; + hotspot = "nmcli connection up local; nmcli device wifi hotspot password 12345678;"; }; - enableAutosuggestions = true; + autosuggestion.enable = true; enableCompletion = true; syntaxHighlighting.enable = true; autocd = false; @@ -874,11 +919,12 @@ programs.waybar = { "group/hardware" = { orientation = "inherit"; drawer = { - "transition-left-to-right" = true; + "transition-left-to-right" = false; }; modules = [ "tray" "temperature" + "power-profiles-daemon" "custom/left-arrow-light" "disk" "custom/left-arrow-dark" @@ -889,6 +935,18 @@ programs.waybar = { ]; }; + power-profiles-daemon = { + format= "{icon}"; + tooltip-format= "Power profile: {profile}\nDriver: {driver}"; + tooltip= true; + format-icons= { + "default"= ""; + "performance"= ""; + "balanced"= ""; + "power-saver"= ""; + }; + }; + temperature = { critical-threshold = 80; format-critical = " {temperatureC}°C"; @@ -1124,6 +1182,7 @@ programs.waybar = { #memory, #cpu, #temperature, + #power-profiles-daemon, #mpris, #tray { background: @background; @@ -1165,7 +1224,8 @@ programs.waybar = { color: #cc99c9; } - #temperature { + #temperature, + #power-profiles-daemon { color: #9ec1cf; } @@ -1248,6 +1308,7 @@ programs.waybar = { #cpu, #tray, #temperature, + #power-profiles-daemon, #network, #mpris, #battery, @@ -1376,14 +1437,14 @@ programs.firefox = { }; "Home Manager Options" = { - urls = [{ template = "https://mipmip.github.io/home-manager-option-search/"; + urls = [{ template = "https://home-manager-options.extranix.com/"; params = [ { name = "query"; value = "{searchTerms}"; } ]; }]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@hm" ]; + definedAliases = [ "@hm" "@ho" "@hmo" ]; }; "Google".metaData.alias = "@g"; @@ -1404,7 +1465,7 @@ services.gnome-keyring = { }; services.mbsync = { - enable = false; + enable = true; }; @@ -1416,12 +1477,16 @@ services.kdeconnect = { services.syncthing = { enable = true; tray = { - enable = false; + enable = false; # we enable this by installing the syncthingtray package instead, it works better. }; }; # this enables the emacs server -services.emacs.enable = true; +services.emacs = { + enable = true; + # socketActivation.enable = false; + # startWithUserSession = "graphical"; +}; services.mako = { enable = true; @@ -1453,7 +1518,8 @@ group-by=category wayland.windowManager.sway = { enable = true; - package = pkgs.swayfx; + # package = pkgs.swayfx; + package = pkgs.sway; systemd.enable = true; systemd.xdgAutostart = true; wrapperFeatures.gtk = true; @@ -1481,7 +1547,9 @@ wayland.windowManager.sway = { "${modifier}+F12" = "scratchpad show"; "${modifier}+c" = "exec qalculate-gtk"; "${modifier}+p" = "exec pass-fuzzel"; + "${modifier}+o" = "exec pass-fuzzel-otp"; "${modifier}+Shift+p" = "exec pass-fuzzel --type"; + "${modifier}+Shift+o" = "exec pass-fuzzel-otp --type"; "${modifier}+Escape" = "mode $exit"; # "${modifier}+Shift+Escape" = "exec com.github.stsdc.monitor"; "${modifier}+Shift+Escape" = "exec kitty -o confirm_os_window_close=0 btm"; @@ -1610,6 +1678,12 @@ wayland.windowManager.sway = { app_id = ".*"; }; } + { + command = "opacity 1"; + criteria = { + app_id = "Gimp-2.10"; + }; + } { command = "opacity 0.99"; criteria = { @@ -1689,6 +1763,17 @@ wayland.windowManager.sway = { # "; extraConfig =let modifier = config.wayland.windowManager.sway.config.modifier; + swayfxSettings = " + blur enable + blur_xray disable + blur_passes 1 + blur_radius 1 + shadows enable + corner_radius 2 + titlebar_separator disable + default_dim_inactive 0.02 + "; + swayfxSettingsOff = ""; in " exec_always autotiling set $exit \"exit: [s]leep, [p]oweroff, [r]eboot, [l]ogout\" @@ -1708,14 +1793,7 @@ wayland.windowManager.sway = { exec systemctl --user import-environment - blur enable - blur_xray disable - blur_passes 1 - blur_radius 1 - shadows enable - corner_radius 2 - titlebar_separator disable - default_dim_inactive 0.02 + ${swayfxSettingsOff} "; }; diff --git a/profiles/common/nixos.nix b/profiles/common/nixos.nix index 2408c48..73d684e 100644 --- a/profiles/common/nixos.nix +++ b/profiles/common/nixos.nix @@ -7,25 +7,27 @@ # login keymap services.xserver = { - layout = "us"; - xkbVariant = "altgr-intl"; + xkb.layout = "us"; + xkb.variant = "altgr-intl"; }; # mount NAS drive # works only at home, but w/e - fileSystems."/mnt/smb" = { - device = "//192.168.1.3/Eternor"; - fsType = "cifs"; - options = let - # this line prevents hanging on network split - automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; - in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"]; - }; + # fileSystems."/mnt/smb" = { + # device = "//192.168.1.3/Eternor"; + # fsType = "cifs"; + # options = let + # # this line prevents hanging on network split + # automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; + # in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"]; + # }; - # enable flakes - urgent line!! + # # enable flakes - urgent line!! nix.settings.experimental-features = ["nix-command" "flakes"]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; + # wordlist for look + environment.wordlist.enable = true; # gstreamer plugins for nautilus (used for file metadata) environment.sessionVariables.GST_PLUGIN_SYSTEM_PATH_1_0 = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with pkgs.gst_all_1; [ gst-plugins-good @@ -99,11 +101,11 @@ environment.systemPackages = with pkgs; [ yubikey-personalization yubikey-personalization-gui yubico-pam - yubioath-flutter - yubikey-manager - yubikey-manager-qt + # yubioath-flutter + # yubikey-manager + # yubikey-manager-qt yubico-piv-tool - pinentry + # pinentry # theme related gnome.adwaita-icon-theme @@ -116,7 +118,6 @@ environment.systemPackages = with pkgs; [ # lsp-related ------------------------------- # nix - rnix-lsp # latex texlab ghostscript_headless @@ -152,41 +153,59 @@ environment.pathsToLink = [ "/share/zsh" ]; services.blueman.enable = true; -# enable discovery and usage of network devices (esp. printers) -services.printing.enable = true; -services.avahi = { - enable = true; - nssmdns = true; - openFirewall = true; -}; + # enable scanners over network + hardware.sane = { + enable = true; + extraBackends = [ pkgs.sane-airscan ]; + }; -# nautilus file manager -services.gvfs.enable = true; + # enable discovery and usage of network devices (esp. printers) + services.printing.enable = true; + services.printing.drivers = [ + pkgs.gutenprint + pkgs.gutenprintBin + ]; + services.printing.browsedConf = '' +BrowseDNSSDSubTypes _cups,_print +BrowseLocalProtocols all +BrowseRemoteProtocols all +CreateIPPPrinterQueues All -# Make CAPS work as a dual function ESC/CTRL key -services.interception-tools = { - enable = true; - udevmonConfig = let - dualFunctionKeysConfig = builtins.toFile "dual-function-keys.yaml" '' - TIMING: - TAP_MILLISEC: 200 - DOUBLE_TAP_MILLISEC: 0 - - MAPPINGS: - - KEY: KEY_CAPSLOCK - TAP: KEY_ESC - HOLD: KEY_LEFTCTRL +BrowseProtocols all ''; - in '' - - JOB: | - ${pkgs.interception-tools}/bin/intercept -g $DEVNODE \ - | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c ${dualFunctionKeysConfig} \ - | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE - DEVICE: - EVENTS: - EV_KEY: [KEY_CAPSLOCK] - ''; -}; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + # nautilus file manager + services.gvfs.enable = true; + + # Make CAPS work as a dual function ESC/CTRL key + services.interception-tools = { + enable = true; + udevmonConfig = let + dualFunctionKeysConfig = builtins.toFile "dual-function-keys.yaml" '' + TIMING: + TAP_MILLISEC: 200 + DOUBLE_TAP_MILLISEC: 0 + + MAPPINGS: + - KEY: KEY_CAPSLOCK + TAP: KEY_ESC + HOLD: KEY_LEFTCTRL + ''; + in '' + - JOB: | + ${pkgs.interception-tools}/bin/intercept -g $DEVNODE \ + | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c ${dualFunctionKeysConfig} \ + | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE + DEVICE: + EVENTS: + EV_KEY: [KEY_CAPSLOCK] + ''; + }; programs.ssh.startAgent = false; diff --git a/profiles/fourside/home.nix b/profiles/fourside/home.nix index 8cb58ed..523ae50 100644 --- a/profiles/fourside/home.nix +++ b/profiles/fourside/home.nix @@ -6,6 +6,8 @@ services.gpg-agent = { enable = true; enableSshSupport = true; + enableExtraSocket = true; + pinentryPackage = pkgs.pinentry-gtk2; }; home = { @@ -22,7 +24,8 @@ programs.waybar.settings.mainBar = { cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}"; # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input"; - temperature.hwmon-path = "/sys/class/hwmon/hwmon4/temp1_input"; + temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; + temperature.input-filename = "temp1_input"; }; @@ -70,7 +73,7 @@ DP-1 = { mode = "2560x1440"; # TEMPLATE scale = "1"; - bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; + #bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; }; }; diff --git a/profiles/fourside/nixos.nix b/profiles/fourside/nixos.nix index e38e8fd..4cf4e93 100644 --- a/profiles/fourside/nixos.nix +++ b/profiles/fourside/nixos.nix @@ -10,15 +10,9 @@ # imports = [ - inputs.nix-gaming.nixosModules.steamCompat ./hardware-configuration.nix ]; - nix.settings = { - substituters = ["https://nix-gaming.cachix.org"]; - trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="]; - }; - services = { getty.autologinUser = "swarsel"; greetd.settings.initial_session.user="swarsel"; @@ -27,7 +21,7 @@ boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; - kernelPackages = pkgs.linuxPackages_latest; + # kernelPackages = pkgs.linuxPackages_latest; }; networking = { @@ -55,7 +49,6 @@ }; guest = { enable = true; - x11 = true; }; }; @@ -127,15 +120,11 @@ programs.steam = { enable = true; extraCompatPackages = [ - inputs.nix-gaming.packages.${pkgs.system}.proton-ge + pkgs.proton-ge-bin ]; }; # Configure keymap in X11 (only used for login) - services.xserver = { - layout = "us"; - xkbVariant = "altgr-intl"; - }; services.thinkfan = { enable = false; @@ -145,7 +134,7 @@ users.users.swarsel = { isNormalUser = true; description = "Leon S"; - extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" ]; + extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ]; packages = with pkgs; []; }; diff --git a/profiles/onett/home.nix b/profiles/onett/home.nix index 6251553..55d7fa0 100644 --- a/profiles/onett/home.nix +++ b/profiles/onett/home.nix @@ -6,6 +6,8 @@ services.gpg-agent = { enable = true; enableSshSupport = true; + enableExtraSocket = true; + pinentryPackage = pkgs.pinentry-gtk2; }; diff --git a/profiles/stand/home.nix b/profiles/stand/home.nix index d442d60..5304c57 100644 --- a/profiles/stand/home.nix +++ b/profiles/stand/home.nix @@ -6,6 +6,8 @@ services.gpg-agent = { enable = true; enableSshSupport = true; + enableExtraSocket = true; + pinentryPackage = pkgs.pinentry-gtk2; }; diff --git a/profiles/threed/home.nix b/profiles/threed/home.nix index e00f51f..7ef34c4 100644 --- a/profiles/threed/home.nix +++ b/profiles/threed/home.nix @@ -6,6 +6,8 @@ services.gpg-agent = { enable = true; enableSshSupport = true; + enableExtraSocket = true; + pinentryPackage = pkgs.pinentry-gtk2; }; diff --git a/programs/config/.aspell.conf b/programs/config/.aspell.conf new file mode 100644 index 0000000..1ac6b93 --- /dev/null +++ b/programs/config/.aspell.conf @@ -0,0 +1 @@ +dict-dir /run/current-system/sw/lib/aspell diff --git a/programs/emacs/init.el b/programs/emacs/init.el index cf1e608..8dae25e 100644 --- a/programs/emacs/init.el +++ b/programs/emacs/init.el @@ -192,6 +192,37 @@ :config (global-evil-surround-mode 1)) +;; set the NixOS wordlist by hand +(setq ispell-alternate-dictionary "/nix/store/gjmvnbs97cnw19wnqh9m075cdbhy8r8g-wordlist-WORDLIST") + +(defun suppress-messages (old-fun &rest args) + (cl-flet ((silence (&rest args1) (ignore))) + (advice-add 'message :around #'silence) + (unwind-protect + (apply old-fun args) + (advice-remove 'message #'silence)))) + +(advice-add 'pixel-scroll-precision :around #'suppress-messages) +(advice-add 'mu4e--server-filter :around #'suppress-messages) +(advice-add 'org-unlogged-message :around #'suppress-messages) +(advice-add 'magit-auto-revert-mode--init-kludge :around #'suppress-messages) + +;; to reenable +;; (advice-remove 'timer-event-handler #'suppress-messages) + +(defun who-called-me? (old-fun format &rest args) +(let ((trace nil) (n 1) (frame nil)) + (while (setf frame (backtrace-frame n)) + (setf n (1+ n) + trace (cons (cadr frame) trace)) ) + (apply old-fun (concat "<<%S>>\n" format) (cons trace args)))) + +;; enable to get message backtrace, the first function shown in backtrace calls the other functions +;; (advice-add 'message :around #'who-called-me?) + +;; disable to stop receiving backtrace +;; (advice-remove 'message #'who-called-me?) + (use-package undo-tree ;; :init (global-undo-tree-mode) :bind (:map undo-tree-visualizer-mode-map @@ -300,11 +331,12 @@ (general-define-key "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card ;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist - ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetye for new anki cards + ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards ;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot "C-c d" 'duplicate-line ; duplicate line on CURSOR "C-M-j" 'consult-buffer "C-s" 'consult-line + "M-o" 'avy-goto-char-timer "C-" 'my-python-shell-run ) @@ -389,7 +421,8 @@ :init (doom-modeline-mode) :custom ((doom-modeline-height 22) - (doom-modeline-indent-info t))) + (doom-modeline-indent-info nil) + (doom-modeline-buffer-encoding nil))) ;; Generally show line numbers (column-number-mode) @@ -397,78 +430,82 @@ ;; (unless (string-match-p "^Power N/A" (battery)) ; On laptops... ;; (display-battery-mode 1)) +(setq read-buffer-completion-ignore-case t + read-file-name-completion-ignore-case t + completion-ignore-case t) + (use-package vertico - :custom - (vertico-scroll-margin 0) - (vertico-count 10) - (vertico-resize t) - (vertico-cycle t) - :init - (vertico-mode) - (vertico-mouse-mode)) - - (use-package vertico-directory - :ensure nil - :after vertico - :bind (:map vertico-map - ("RET" . vertico-directory-enter) - ("DEL" . vertico-directory-delete-char) - ("M-DEL" . vertico-directory-delete-word)) - ;; Tidy shadowed file names - :hook (rfn-eshadow-update-overlay . vertico-directory-tidy)) - - (use-package orderless - :custom - (completion-styles '(orderless flex basic)) - (completion-category-overrides '((file (styles . (partial-completion))) - (eglot (styles orderless))))) - - (use-package consult - :config - (setq consult-fontify-max-size 1024) - :bind - ("C-x b" . consult-buffer) - ("C-c " . consult-global-mark) - ("C-c C-a" . consult-org-agenda) - ("C-x O" . consult-outline) - ("M-g M-g" . consult-goto-line) - ("M-g i" . consult-imenu) - ("M-s s" . consult-line) - ("M-s M-s" . consult-line-multi)) - - (use-package embark - :bind - (("C-." . embark-act) - ("M-." . embark-dwim) - ("C-h B" . embark-bindings)) - :custom - (prefix-help-command #'embark-prefix-help-command) - (embark-quit-after-action '((t . nil))) - :config - (add-to-list 'display-buffer-alist - '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" - nil - (window-parameters (mode-line-format . none))))) - - (use-package embark-consult - :after (embark consult) - :demand t ; only necessary if you have the hook below - ;; if you want to have consult previews as you move around an - ;; auto-updating embark collect buffer - :hook - (embark-collect-mode . consult-preview-at-point-mode)) - - (use-package marginalia - :after vertico - :init - (marginalia-mode) - (setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))) - -(use-package nerd-icons-completion - :after (marginalia nerd-icons) - :hook (marginalia-mode . nerd-icons-completion-marginalia-setup) + :custom + (vertico-scroll-margin 0) + (vertico-count 10) + (vertico-resize t) + (vertico-cycle t) :init - (nerd-icons-completion-mode)) + (vertico-mode) + (vertico-mouse-mode)) + + (use-package vertico-directory + :ensure nil + :after vertico + :bind (:map vertico-map + ("RET" . vertico-directory-enter) + ("DEL" . vertico-directory-delete-word) + ("M-DEL" . vertico-directory-delete-char)) + ;; Tidy shadowed file names + :hook (rfn-eshadow-update-overlay . vertico-directory-tidy)) + + (use-package orderless + :custom + (completion-styles '(orderless flex basic)) + (completion-category-overrides '((file (styles . (partial-completion))) + (eglot (styles orderless))))) + + (use-package consult + :config + (setq consult-fontify-max-size 1024) + :bind + ("C-x b" . consult-buffer) + ("C-c " . consult-global-mark) + ("C-c C-a" . consult-org-agenda) + ("C-x O" . consult-outline) + ("M-g M-g" . consult-goto-line) + ("M-g i" . consult-imenu) + ("M-s s" . consult-line) + ("M-s M-s" . consult-line-multi)) + + (use-package embark + :bind + (("C-." . embark-act) + ("M-." . embark-dwim) + ("C-h B" . embark-bindings)) + :custom + (prefix-help-command #'embark-prefix-help-command) + (embark-quit-after-action '((t . nil))) + :config + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + + (use-package embark-consult + :after (embark consult) + :demand t ; only necessary if you have the hook below + ;; if you want to have consult previews as you move around an + ;; auto-updating embark collect buffer + :hook + (embark-collect-mode . consult-preview-at-point-mode)) + + (use-package marginalia + :after vertico + :init + (marginalia-mode) + (setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))) + + (use-package nerd-icons-completion + :after (marginalia nerd-icons) + :hook (marginalia-mode . nerd-icons-completion-marginalia-setup) + :init + (nerd-icons-completion-mode)) ;; (use-package ivy ;; :init (ivy-mode 1) @@ -801,26 +838,20 @@ (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config))) -;; (use-package auctex -;; :ensure nil) +(use-package auctex + :ensure nil) (setq TeX-auto-save t) (setq TeX-save-query nil) (setq TeX-parse-self t) (setq-default TeX-master nil) -;; (add-hook 'LaTeX-mode-hook 'visual-line-mode) -;; (add-hook 'LaTeX-mode-hook 'flyspell-mode) -;; (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) +(add-hook 'LaTeX-mode-hook 'visual-line-mode) +(add-hook 'LaTeX-mode-hook 'flyspell-mode) +(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) +(add-hook 'LaTeX-mode-hook 'reftex-mode) -;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ;; (setq reftex-plug-into-AUCTeX t) -(add-hook 'markdown-mode-hook - (lambda () - (local-set-key (kbd "C-c C-x C-l") 'org-latex-preview) - (local-set-key (kbd "C-c C-x C-u") 'markdown-toggle-url-hiding) - )) - (use-package org-download :after org :defer nil @@ -976,6 +1007,12 @@ ;;(add-hook 'markdown-mode-hook (lambda () (org-display-inline-images))) +(add-hook 'markdown-mode-hook + (lambda () + (local-set-key (kbd "C-c C-x C-l") 'org-latex-preview) + (local-set-key (kbd "C-c C-x C-u") 'markdown-toggle-url-hiding) + )) + (use-package olivetti :init (setq olivetti-body-width 100) @@ -1050,6 +1087,12 @@ :custom (direnv-always-show-summary nil) :config (direnv-mode)) +(use-package avy + :config + (setq avy-all-windows 'all-frames)) + +(use-package crdt) + (use-package devdocs) (use-package projectile @@ -1162,8 +1205,8 @@ ("S-" . corfu-popupinfo-scroll-up) ("C-" . corfu-previous) ("C-" . corfu-next) - ("" . swarsel/corfu-quit-and-up) - ("" . swarsel/corfu-quit-and-down)) + (" " . swarsel/corfu-quit-and-up) + (" " . swarsel/corfu-quit-and-down)) ) @@ -1203,31 +1246,31 @@ (use-package cape ;; Bind dedicated completion commands ;; Alternative prefix keys: C-c p, M-p, M-+, ... - ;; :bind (("C-c p p" . completion-at-point) ;; capf - ;; ("C-c p t" . complete-tag) ;; etags - ;; ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion - ;; ("C-c p h" . cape-history) - ;; ("C-c p f" . cape-file) - ;; ("C-c p k" . cape-keyword) - ;; ("C-c p s" . cape-elisp-symbol) - ;; ("C-c p e" . cape-elisp-block) - ;; ("C-c p a" . cape-abbrev) - ;; ("C-c p l" . cape-line) - ;; ("C-c p w" . cape-dict) - ;; ("C-c p :" . cape-emoji) - ;; ("C-c p \\" . cape-tex) - ;; ("C-c p _" . cape-tex) - ;; ("C-c p ^" . cape-tex) - ;; ("C-c p &" . cape-sgml) - ;; ("C-c p r" . cape-rfc1345)) - :init + :bind + ("C-c p p" . completion-at-point) ;; capf + ("C-c p t" . complete-tag) ;; etags + ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion + ("C-c p h" . cape-history) + ("C-c p f" . cape-file) + ("C-c p k" . cape-keyword) + ("C-c p s" . cape-elisp-symbol) + ("C-c p e" . cape-elisp-block) + ("C-c p a" . cape-abbrev) + ("C-c p l" . cape-line) + ("C-c p w" . cape-dict) + ("C-c p :" . cape-emoji) + ("C-c p \\" . cape-tex) + ("C-c p _" . cape-tex) + ("C-c p ^" . cape-tex) + ("C-c p &" . cape-sgml) + ("C-c p r" . cape-rfc1345) ;; Add to the global default value of `completion-at-point-functions' which is ;; used by `completion-at-point'. The order of the functions matters, the ;; first function returning a result wins. Note that the list of buffer-local ;; completion functions takes precedence over the global list. - (add-to-list 'completion-at-point-functions #'cape-dabbrev) - (add-to-list 'completion-at-point-functions #'cape-file) - (add-to-list 'completion-at-point-functions #'cape-elisp-block) + ;; (add-to-list 'completion-at-point-functions #'cape-dabbrev) + ;; (add-to-list 'completion-at-point-functions #'cape-file) + ;; (add-to-list 'completion-at-point-functions #'cape-elisp-block) ;; (add-to-list 'completion-at-point-functions #'cape-history) ;; (add-to-list 'completion-at-point-functions #'cape-keyword) ;; (add-to-list 'completion-at-point-functions #'cape-tex) @@ -1235,7 +1278,7 @@ ;; (add-to-list 'completion-at-point-functions #'cape-rfc1345) ;; (add-to-list 'completion-at-point-functions #'cape-abbrev) ;; (add-to-list 'completion-at-point-functions #'cape-dict) - (add-to-list 'completion-at-point-functions #'cape-elisp-symbol) + ;; (add-to-list 'completion-at-point-functions #'cape-elisp-symbol) ;; (add-to-list 'completion-at-point-functions #'cape-line) ) @@ -1338,6 +1381,15 @@ "-o ControlMaster=auto -o ControlPersist=yes")) ) +(use-package diff-hl + :hook + ((prog-mode + org-mode) . diff-hl-mode) + :init + (diff-fl-flydiff-mode) + (diff-hl-margin-mode) + (diff-hl-show-hunk-mouse-mode)) + (use-package evil-nerd-commenter :bind ("M-/" . evilnc-comment-or-uncomment-lines)) @@ -1364,7 +1416,7 @@ ("e" . "\\epsilon") ("z" . "\\zeta") ("h" . "\\eta") - ("t" . "\\theta") + ("th" . "\\theta") ("i" . "\\iota") ("k" . "\\kappa") ("l" . "\\lambda") @@ -1543,29 +1595,32 @@ ;; flycheck-posframe-prefix "💬 ")) (use-package eglot - :ensure nil - :hook - ((python-mode - c-mode - c++-mode - ) . (lambda () (progn - (eglot-ensure) - (add-hook 'before-save-hook 'eglot-format nil 'local)))) - :custom - (eldoc-echo-area-use-multiline-p nil) - (completion-category-defaults nil) - :config - ;; (push '(rustic-ts-mode . eglot-rust-analyzer) eglot-server-programs) - (push '(rustic-mode . eglot-rust-analyzer) eglot-server-programs) - (add-to-list 'eglot-server-programs '((rust-mode) . (eglot-rust-analyzer "rust-analyzer"))) - ;; (add-to-list 'eglot-server-programs '((python-mode) . ("pylsp"))) - ;; (add-to-list 'eglot-server-programs '((c-mode) . ("clangd"))) - :bind (:map eglot-mode-map - ("M-(" . flymake-goto-next-error) - ("C-c ," . eglot-code-actions))) + :ensure nil + :hook + ((python-mode + c-mode + c++-mode + tex-mode + ) . (lambda () (progn + (eglot-ensure) + (add-hook 'before-save-hook 'eglot-format nil 'local)))) + :custom + (eldoc-echo-area-use-multiline-p nil) + (completion-category-defaults nil) + :config + ;; (push '(rustic-ts-mode . eglot-rust-analyzer) eglot-server-programs) + (push '(rustic-mode . eglot-rust-analyzer) eglot-server-programs) + (add-to-list 'eglot-server-programs '((rust-mode) . (eglot-rust-analyzer "rust-analyzer"))) + ;; (add-to-list 'eglot-server-programs '((python-mode) . ("pylsp"))) + ;; (add-to-list 'eglot-server-programs '((c-mode) . ("clangd"))) + :bind (:map eglot-mode-map + ("M-(" . flymake-goto-next-error) + ("C-c ," . eglot-code-actions))) -(use-package breadcrumb - :config (breadcrumb-mode)) +(defalias 'start-lsp-server #'eglot) + + (use-package breadcrumb + :config (breadcrumb-mode)) ;; (use-package lsp-bridge ;; :ensure nil @@ -1763,42 +1818,44 @@ (add-to-list 'load-path mu4epath))) (use-package mu4e - :ensure nil - ;; :load-path "/usr/share/emacs/site-lisp/mu4e/" - ;;:defer 20 ; Wait until 20 seconds after startup - :config + :ensure nil + ;; :load-path "/usr/share/emacs/site-lisp/mu4e/" + ;;:defer 20 ; Wait until 20 seconds after startup + :config - ;; This is set to 't' to avoid mail syncing issues when using mbsync - (setq send-mail-function 'sendmail-send-it) - (setq mu4e-change-filenames-when-moving t) - (setq mu4e-mu-binary (executable-find "mu")) + ;; This is set to 't' to avoid mail syncing issues when using mbsync + (setq send-mail-function 'sendmail-send-it) + (setq mu4e-change-filenames-when-moving t) + (setq mu4e-mu-binary (executable-find "mu")) - (setq mu4e-update-interval 180) - (setq mu4e-get-mail-command "mbsync -a") - (setq mu4e-maildir "~/Mail") + (setq mu4e-update-interval 180) + (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-maildir "~/Mail") - ;; enable inline images - (setq mu4e-view-show-images t) - ;; use imagemagick, if available - (when (fboundp 'imagemagick-register-types) - (imagemagick-register-types)) + ;; enable inline images + (setq mu4e-view-show-images t) + ;; use imagemagick, if available + (when (fboundp 'imagemagick-register-types) + (imagemagick-register-types)) - (setq mu4e-drafts-folder "/Drafts") - (setq mu4e-sent-folder "/Sent Mail") - (setq mu4e-refile-folder "/All Mail") - (setq mu4e-trash-folder "/Trash") + (setq mu4e-drafts-folder "/Drafts") + (setq mu4e-sent-folder "/Sent Mail") + (setq mu4e-refile-folder "/All Mail") + (setq mu4e-trash-folder "/Trash") - (setq mu4e-maildir-shortcuts - '((:maildir "/leon/Inbox" :key ?1) - (:maildir "/nautilus/Inbox" :key ?2) - (:maildir "/mrswarsel/Inbox" :key ?3) - (:maildir "/Sent Mail" :key ?s) - (:maildir "/Trash" :key ?t) - (:maildir "/Drafts" :key ?d) - (:maildir "/All Mail" :key ?a)))) + (setq mu4e-maildir-shortcuts + '((:maildir "/leon/Inbox" :key ?1) + (:maildir "/nautilus/Inbox" :key ?2) + (:maildir "/mrswarsel/Inbox" :key ?3) + (:maildir "/Sent Mail" :key ?s) + (:maildir "/Trash" :key ?t) + (:maildir "/Drafts" :key ?d) + (:maildir "/All Mail" :key ?a)))) -(setq user-mail-address "leon.schwarzaeugl@gmail.com" - user-full-name "Leon Schwarzäugl") + (setq user-mail-address "leon.schwarzaeugl@gmail.com" + user-full-name "Leon Schwarzäugl") + +(setq mu4e-hide-index-messages t) (use-package mu4e-alert) (mu4e-alert-set-default-style 'libnotify) @@ -1875,6 +1932,15 @@ dashboard-startup-banner "~/.dotfiles/wallpaper/swarsel.png" dashboard-projects-backend 'projectile dashboard-set-navigator t + dashboard-startupify-list '(dashboard-insert-banner + dashboard-insert-newline + dashboard-insert-banner-title + dashboard-insert-newline + dashboard-insert-navigator + dashboard-insert-newline + dashboard-insert-init-info + dashboard-insert-items + ) dashboard-navigator-buttons `(;; line1 ((,"" @@ -1906,7 +1972,7 @@ (lambda (&rest _) (browse-url "swarsel.win"))) ) ))) - (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) + (setq dashboard-projects-switch-function 'project-switch-project) (setq gc-cons-threshold (* 800 1000 )) (fset 'epg-wait-for-status 'ignore)