settings to update how wayland display is detected

This commit is contained in:
Chris Cochrun 2023-02-07 10:14:53 -06:00
parent 6c5f570810
commit e178d20978
3 changed files with 114 additions and 19 deletions

View file

@ -272,7 +272,7 @@ Probably the prettiest and best modeline I've found.
doom-modeline-buffer-file-name-style 'file-name doom-modeline-buffer-file-name-style 'file-name
doom-modeline-buffer-encoding nil doom-modeline-buffer-encoding nil
doom-modeline-mu4e t doom-modeline-mu4e t
doom-modeline-enable-word-count t) doom-modeline-enable-word-count nil)
(if (daemonp) (if (daemonp)
(add-hook 'after-make-frame-functions (add-hook 'after-make-frame-functions
(lambda (frame) (lambda (frame)
@ -346,7 +346,9 @@ I am currently using NixOS. In order for emacs to have access to certain program
Also due to using greetd, emacs isn't started with the environment from the system, so let's make sure it knows which wayland display we are using Also due to using greetd, emacs isn't started with the environment from the system, so let's make sure it knows which wayland display we are using
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setenv "WAYLAND_DISPLAY" "wayland-0") (setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland")
"wayland-1"
"wayland-0"))
#+end_src #+end_src
#+RESULTS: #+RESULTS:
@ -500,6 +502,7 @@ This evil-collection package includes a lot of other evil based things.
"ss" '(consult-line :which-key "consult search") "ss" '(consult-line :which-key "consult search")
"sr" '(consult-ripgrep :which-key "consult ripgrep") "sr" '(consult-ripgrep :which-key "consult ripgrep")
"sd" '(dictionary-search :which-key "search the dictionary") "sd" '(dictionary-search :which-key "search the dictionary")
"sv" '(imenu :which-key "imenu")
"oP" '(proced :which-key "proced") "oP" '(proced :which-key "proced")
"ov" '(vterm :which-key "vterm") "ov" '(vterm :which-key "vterm")
"wo" '(other-window :which-key "other window") "wo" '(other-window :which-key "other window")
@ -616,6 +619,43 @@ Let's start by creating a self contained function of what I'd like started on ev
(interactive (list (mark) (point))) (interactive (list (mark) (point)))
(org-table-convert-region beg end ",")) (org-table-convert-region beg end ","))
(defun chris/org-cycle-hide-drawers (state)
"Re-hide all drawers after a visibility state change."
(interactive)
(when (and (derived-mode-p 'org-mode)
(not (memq state '(overview folded contents))))
(save-excursion
(let* ((globalp (memq state '(contents all)))
(beg (if globalp
(point-min)
(point)))
(end (if globalp
(point-max)
(if (eq state 'children)
(save-excursion
(outline-next-heading)
(point))
(org-end-of-subtree t)))))
(goto-char beg)
(while (re-search-forward org-drawer-regexp end t)
(save-excursion
(beginning-of-line 1)
(when (looking-at org-drawer-regexp)
(let* ((start (1- (match-beginning 0)))
(limit
(save-excursion
(outline-next-heading)
(point)))
(msg (format
(concat
"org-cycle-hide-drawers: "
"`:END:`"
" line missing at position %s")
(1+ start))))
(if (re-search-forward "^[ \t]*:END:" limit t)
(outline-flag-region start (point-at-eol) t)
(user-error msg))))))))))
(defun chris/org-agenda-setup () (defun chris/org-agenda-setup ()
(interactive) (interactive)
(org-indent-mode +1) (org-indent-mode +1)
@ -808,7 +848,8 @@ Part of this config includes some special capture templates for my work as a you
(chris/leader-keys (chris/leader-keys
:states 'normal :states 'normal
:keymaps 'org-mode-map :keymaps 'org-mode-map
"is" 'org-time-stamp) "is" 'org-time-stamp
"tp" (chris/org-cycle-hide-drawers 'children))
(chris/leader-keys (chris/leader-keys
:states 'visual :states 'visual
:keymaps 'override :keymaps 'override
@ -833,6 +874,7 @@ Part of this config includes some special capture templates for my work as a you
"zn" 'org-narrow-to-subtree "zn" 'org-narrow-to-subtree
"zw" 'widen "zw" 'widen
"zp" 'org-set-property "zp" 'org-set-property
"zh" (chris/org-cycle-hide-drawers 'subtree)
"S" 'org-schedule "S" 'org-schedule
"t" 'org-todo "t" 'org-todo
"gf" 'org-footnote-action "gf" 'org-footnote-action
@ -1586,9 +1628,12 @@ Consult has a lot of nice functions like Ivy's Counsel functions (enhanced searc
(use-package consult (use-package consult
:after vertico :after vertico
:config :config
(setq consult-narrow-key "'" (setq consult-narrow-key (kbd "C-n")
consult-project-root-function 'projectile-project-root) consult-project-root-function 'projectile-project-root)
(consult-customize
consult-org-heading :preview-key nil)
(defun chris/consult-ripgrep-for-stepdata () (defun chris/consult-ripgrep-for-stepdata ()
"Make ripgrep search hidden files for stepdata" "Make ripgrep search hidden files for stepdata"
(interactive) (interactive)
@ -2239,6 +2284,8 @@ LSP is useful...
:server-id 'qml)) :server-id 'qml))
:general :general
(general-def 'normal c++-mode-map (general-def 'normal c++-mode-map
"gf" 'lsp-clangd-find-other-file)
(general-def 'normal c++-ts-mode-map
"gf" 'lsp-clangd-find-other-file)) "gf" 'lsp-clangd-find-other-file))
(use-package lsp-ui (use-package lsp-ui
@ -2260,7 +2307,9 @@ Let's give eglot a try.
:commands eglot :commands eglot
:hook :hook
(c++-mode . eglot-ensure) (c++-mode . eglot-ensure)
(rust-mode . eglot-ensure)) (c++-ts-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure))
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -2758,7 +2807,7 @@ Let's add org-msg to write emails in org-mode
(setq mail-user-agent 'mu4e-user-agent (setq mail-user-agent 'mu4e-user-agent
org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t" org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t"
org-msg-startup "hidestars indent inlineimages" org-msg-startup "hidestars indent inlineimages"
org-msg-greeting-fmt "\nHi%s,\n\n" org-msg-greeting-fmt "\n%s\n"
org-msg-recipient-names '(("chris@tfcconnection.org" . "Chris Cochrun")) org-msg-recipient-names '(("chris@tfcconnection.org" . "Chris Cochrun"))
org-msg-greeting-name-limit 3 org-msg-greeting-name-limit 3
org-msg-default-alternatives '((new . (text html)) org-msg-default-alternatives '((new . (text html))
@ -2767,8 +2816,6 @@ Let's add org-msg to write emails in org-mode
org-msg-convert-citation t org-msg-convert-citation t
org-msg-signature " org-msg-signature "
Regards,
#+begin_signature #+begin_signature
-- --
*Chris* *Chris*
@ -3508,10 +3555,13 @@ I am going to try and use LanguageTool to fix grammatical issues.
#+end_src #+end_src
** MyBible ** MyBible
MyBible is going to be my minor mode for creating and using a bible app within Emacs. Let's see if we can't make it work. MyBible is going to be set of functions for creating and using a bible app within Emacs. Let's see if we can't make it work.
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
(defun chris/find-translation-tag () (defun chris/find-verse ()
(interactive) (interactive)
(find-buffer-visiting "/home/chris/org/bibles/esv.org")
(set-buffer )
(org-node-if match)
) )
#+end_src #+end_src

61
init.el
View file

@ -115,7 +115,7 @@
doom-modeline-buffer-file-name-style 'file-name doom-modeline-buffer-file-name-style 'file-name
doom-modeline-buffer-encoding nil doom-modeline-buffer-encoding nil
doom-modeline-mu4e t doom-modeline-mu4e t
doom-modeline-enable-word-count t) doom-modeline-enable-word-count nil)
(if (daemonp) (if (daemonp)
(add-hook 'after-make-frame-functions (add-hook 'after-make-frame-functions
(lambda (frame) (lambda (frame)
@ -148,7 +148,9 @@
(which-key-mode) (which-key-mode)
:defer 1) :defer 1)
(setenv "WAYLAND_DISPLAY" "wayland-0") (setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland")
"wayland-1"
"wayland-0"))
(executable-find "ssh") (executable-find "ssh")
(setq ispell-program-name "hunspell" (setq ispell-program-name "hunspell"
@ -242,6 +244,7 @@
"ss" '(consult-line :which-key "consult search") "ss" '(consult-line :which-key "consult search")
"sr" '(consult-ripgrep :which-key "consult ripgrep") "sr" '(consult-ripgrep :which-key "consult ripgrep")
"sd" '(dictionary-search :which-key "search the dictionary") "sd" '(dictionary-search :which-key "search the dictionary")
"sv" '(imenu :which-key "imenu")
"oP" '(proced :which-key "proced") "oP" '(proced :which-key "proced")
"ov" '(vterm :which-key "vterm") "ov" '(vterm :which-key "vterm")
"wo" '(other-window :which-key "other window") "wo" '(other-window :which-key "other window")
@ -348,6 +351,43 @@
(interactive (list (mark) (point))) (interactive (list (mark) (point)))
(org-table-convert-region beg end ",")) (org-table-convert-region beg end ","))
(defun chris/org-cycle-hide-drawers (state)
"Re-hide all drawers after a visibility state change."
(interactive)
(when (and (derived-mode-p 'org-mode)
(not (memq state '(overview folded contents))))
(save-excursion
(let* ((globalp (memq state '(contents all)))
(beg (if globalp
(point-min)
(point)))
(end (if globalp
(point-max)
(if (eq state 'children)
(save-excursion
(outline-next-heading)
(point))
(org-end-of-subtree t)))))
(goto-char beg)
(while (re-search-forward org-drawer-regexp end t)
(save-excursion
(beginning-of-line 1)
(when (looking-at org-drawer-regexp)
(let* ((start (1- (match-beginning 0)))
(limit
(save-excursion
(outline-next-heading)
(point)))
(msg (format
(concat
"org-cycle-hide-drawers: "
"`:END:`"
" line missing at position %s")
(1+ start))))
(if (re-search-forward "^[ \t]*:END:" limit t)
(outline-flag-region start (point-at-eol) t)
(user-error msg))))))))))
(defun chris/org-agenda-setup () (defun chris/org-agenda-setup ()
(interactive) (interactive)
(org-indent-mode +1) (org-indent-mode +1)
@ -535,7 +575,8 @@
(chris/leader-keys (chris/leader-keys
:states 'normal :states 'normal
:keymaps 'org-mode-map :keymaps 'org-mode-map
"is" 'org-time-stamp) "is" 'org-time-stamp
"tp" (chris/org-cycle-hide-drawers 'children))
(chris/leader-keys (chris/leader-keys
:states 'visual :states 'visual
:keymaps 'override :keymaps 'override
@ -560,6 +601,7 @@
"zn" 'org-narrow-to-subtree "zn" 'org-narrow-to-subtree
"zw" 'widen "zw" 'widen
"zp" 'org-set-property "zp" 'org-set-property
"zh" (chris/org-cycle-hide-drawers 'subtree)
"S" 'org-schedule "S" 'org-schedule
"t" 'org-todo "t" 'org-todo
"gf" 'org-footnote-action "gf" 'org-footnote-action
@ -1047,9 +1089,12 @@ If on a:
(use-package consult (use-package consult
:after vertico :after vertico
:config :config
(setq consult-narrow-key "'" (setq consult-narrow-key (kbd "C-n")
consult-project-root-function 'projectile-project-root) consult-project-root-function 'projectile-project-root)
(consult-customize
consult-org-heading :preview-key nil)
(defun chris/consult-ripgrep-for-stepdata () (defun chris/consult-ripgrep-for-stepdata ()
"Make ripgrep search hidden files for stepdata" "Make ripgrep search hidden files for stepdata"
(interactive) (interactive)
@ -1547,7 +1592,9 @@ targets."
:commands eglot :commands eglot
:hook :hook
(c++-mode . eglot-ensure) (c++-mode . eglot-ensure)
(rust-mode . eglot-ensure)) (c++-ts-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure))
(use-package consult-eglot (use-package consult-eglot
:general :general
@ -1894,7 +1941,7 @@ targets."
(setq mail-user-agent 'mu4e-user-agent (setq mail-user-agent 'mu4e-user-agent
org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t" org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t"
org-msg-startup "hidestars indent inlineimages" org-msg-startup "hidestars indent inlineimages"
org-msg-greeting-fmt "\nHi%s,\n\n" org-msg-greeting-fmt "\n%s\n"
org-msg-recipient-names '(("chris@tfcconnection.org" . "Chris Cochrun")) org-msg-recipient-names '(("chris@tfcconnection.org" . "Chris Cochrun"))
org-msg-greeting-name-limit 3 org-msg-greeting-name-limit 3
org-msg-default-alternatives '((new . (text html)) org-msg-default-alternatives '((new . (text html))
@ -1903,8 +1950,6 @@ targets."
org-msg-convert-citation t org-msg-convert-citation t
org-msg-signature " org-msg-signature "
Regards,
#+begin_signature #+begin_signature
-- --
*Chris* *Chris*

View file

@ -1,4 +1,4 @@
;;; Automatically generated by recentf on Fri Jan 20 09:38:48 2023. ;;; Automatically generated by recentf on Sun Feb 5 05:55:12 2023.
(setq recentf-list 'nil) (setq recentf-list 'nil)