From 2b62ae597cc6a4c213f7d4b54b112ff9c216dbaa Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Fri, 7 Apr 2023 23:02:33 +0200 Subject: Some changes... --- Desktop.org | 175 ++++++++++++++++++++++++++++++------------------------------ Emacs.org | 105 ++++++++++++++++++++++++++++++++++-- Mail.org | 22 +++++++- 3 files changed, 209 insertions(+), 93 deletions(-) diff --git a/Desktop.org b/Desktop.org index e24607e..595e278 100644 --- a/Desktop.org +++ b/Desktop.org @@ -8,93 +8,92 @@ #+begin_src emacs-lisp - (defun jd/exwm-update-class () - (exwm-workspace-rename-buffer exwm-class-name)) - - (defun jd-exwm/run-in-background (command) - (let ((command-parts (split-string command "[ ]+"))) - (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) - - (defun jd-exwm/restart-process (program-name) - (call-process "killall" nil nil nil program-name) - (jd-exwm/run-in-background program-name)) - - (defun jd-exwm/exwm-init-hook () - (jd-exwm/restart-process "polybar") - (jd-exwm/restart-process "nm-applet") - (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") - (jd-exwm/restart-process "blueman-applet") - (jd-exwm/restart-process "pasystray")) - - (defun jd-exwm/exwm-update-title () - (exwm-workspace-rename-buffer exwm-title)) - - (defun jd-exwm/configure-window-by-class () - (interactive) - (pcase exwm-class-name - ("firefox" (exwm-workspace-move-window 2)) - ("Brave" (exwm-workspace-move-window 2)) - ("qutebrowser" (exwm-workspace-move-window 2)) - ("discord" (exwm-workspace-move-window 5)) - ("obs" (exwm-workspace-move-window 5)) - ("Virt-manager" (exwm-workspace-move-window 4)))) - - (use-package exwm - :config - (setq exwm-workspace-number 10) - - (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) - (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) - (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) - (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) - - (start-process-shell-command "nitrogen" nil "nitrogen --restore") - (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") - (start-process-shell-command "xmodmap" nil "xmodmap ~/dotfiles/.Xmodmap") - - (require 'exwm-randr) - (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) - (exwm-randr-enable) - - (setq exwm-input-simulation-keys - '(([?\C-b] . [left]) - ([?\C-f] . [right]) - ([?\C-p] . [up]) - ([?\C-n] . [down]))) - - (setq exwm-input-prefix-keys - '(?\C-x - ?\C-u - ?\C-h - ?\M-x - ?\M-` - ?\M-& - ?\M-: - ?\C-\M-j - ?\C-\ )) - - (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) - (exwm-input-set-key (kbd "s-p") 'counsel-linux-app) - - (setq exwm-input-global-keys - `(([?\s-R] . exwm-reset) - - - ([?\s-r] . (lambda (command) - (interactive (list (read-shell-command "$ "))) - (start-process-shell-command command nil command))) - - ([?\s-W] . exwm-workspace-move-window) - ([?\s-w] . exwm-workspace-switch) - - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 9)))) - - (exwm-enable)) + (defun jd/exwm-update-class () + (exwm-workspace-rename-buffer exwm-class-name)) + + (defun jd-exwm/run-in-background (command) + (let ((command-parts (split-string command "[ ]+"))) + (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) + + (defun jd-exwm/restart-process (program-name) + (call-process "killall" nil nil nil program-name) + (jd-exwm/run-in-background program-name)) + + (defun jd-exwm/exwm-init-hook () + (jd-exwm/run-in-background "nitrogen --restore") + (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") + (start-process-shell-command "syndaemon" nil "syndaemon -i 0.8 -K -R -d") + + (jd-exwm/restart-process "polybar") + (jd-exwm/restart-process "nm-applet") + (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") + (jd-exwm/restart-process "blueman-applet")) + + (defun jd-exwm/exwm-update-title () + (exwm-workspace-rename-buffer exwm-title)) + + (defun jd-exwm/configure-window-by-class () + (interactive) + (pcase exwm-class-name + ("firefox" (exwm-workspace-move-window 2)) + ("Brave" (exwm-workspace-move-window 2)) + ("qutebrowser" (exwm-workspace-move-window 2)) + ("discord" (exwm-workspace-move-window 5)) + ("obs" (exwm-workspace-move-window 5)) + ("Virt-manager" (exwm-workspace-move-window 4)))) + + (use-package exwm + :config + (setq exwm-workspace-number 10) + + (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) + (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) + (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) + (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) + + (require 'exwm-randr) + (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) + (exwm-randr-enable) + + (setq exwm-input-simulation-keys + '(([?\C-h] . [left]) + ([?\C-l] . [right]) + ([?\C-k] . [up]) + ([?\C-j] . [down]))) + + (setq exwm-input-prefix-keys + '(?\C-x + ?\C-u + ?\C-h + ?\M-x + ?\M-` + ?\M-& + ?\M-: + ?\C-\M-j + ?\C-\ )) + + (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + (exwm-input-set-key (kbd "s-p") 'counsel-linux-app) + + (setq exwm-input-global-keys + `(([?\s-R] . exwm-reset) + + + ([?\s-r] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command))) + + ([?\s-W] . exwm-workspace-move-window) + ([?\s-w] . exwm-workspace-switch) + + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + + (exwm-enable)) #+end_src ** Desktop mode @@ -173,6 +172,8 @@ export GTK_THEME="Adwaita:dark" export CALIBRE_USE_DARK_PALETTE=1 + gentoo-pipewire-launcher & + exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el #+end_src diff --git a/Emacs.org b/Emacs.org index 3fabb47..536aa85 100644 --- a/Emacs.org +++ b/Emacs.org @@ -29,6 +29,7 @@ - [[#org-margin][Org margin]] - [[#org-superstar][Org superstar]] - [[#org-roam][Org roam]] + - [[#langtoolel][langtool.el]] - [[#development][Development]] - [[#languages][Languages]] - [[#company][Company]] @@ -42,6 +43,7 @@ - [[#pdf-tools][PDF Tools]] - [[#mu4e][Mu4e]] - [[#rss][RSS]] +- [[#custom][Custom]] - [[#runtime-performance][Runtime Performance]] * Startup Performance @@ -201,6 +203,8 @@ (global-set-key (kbd "") 'keyboard-escape-quit) + (global-prettify-symbols-mode 1) + (defalias 'yes-or-no-p 'y-or-n-p) (use-package doom-themes @@ -505,14 +509,14 @@ (org-level-6 . 1.1) (org-level-7 . 1.1) (org-level-8 . 1.1))) - (set-face-attribute (car face) nil :font "Monospace" :weight 'Bold :height (cdr face))) + (set-face-attribute (car face) nil :font "sans" :weight 'Bold :height (cdr face))) ;; Ensure that anything that should be fixed-pitch in Org files appears that way (set-face-attribute 'org-block nil :font "hack" :inherit 'fixed-pitch) (set-face-attribute 'org-table nil :inherit 'fixed-pitch) (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) - (set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch)) + (set-face-attribute 'org-table nil :font "hack ":inherit '(shadow fixed-pitch)) (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) @@ -632,13 +636,51 @@ :config ;; If you're using a vertical completion framework, you might want a more informative completion interface (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) + (setq org-roam-capture-templates + '(("a" "workstuff" plain (file (concat org-roam-directory "/work")) + :target (file+head "work/%<%Y%m%d%H%M%S>-${slug}.org" + "#+title: ${title}\n") :unnarrowed t) + ("b" "research" plain (file "~/Documents/roam/study/templates/research.org") + :target (file+head "study/%<%Y%m%d%H%M%S>-${slug}.org" + "#+title: ${title}\n") :unnarrowed t) + )) + (org-roam-db-autosync-mode)) #+end_src +** langtool.el + +#+begin_src emacs-lisp + + (use-package langtool + :config + (setq langtool-language-tool-jar "/home/jakub/Documents/LanguageTool-6.0/languagetool-commandline.jar") + (setq langtool-default-language "pl-PL")) + + (jd/leader-key-def + "l" '(:ignore t :which-key "langtool") + "lc" 'langtool-check-buffer + "ld" 'langtool-check-done + "li" 'langtool-interactive-correction) + + +#+end_src + * Development ** Languages +*** C + +#+begin_src emacs-lisp + + (setq c-default-style "linux" + c-basic-offset 8) + + (setq gdb-many-windows t) + +#+end_src + *** Lsp #+begin_src emacs-lisp @@ -900,9 +942,14 @@ (use-package vterm + :init + (add-to-list 'project-switch-commands '(project-vterm "Vterm") t) + (add-to-list 'project-kill-buffer-conditions '(major-mode . vterm-mode)) + (setq vterm-copy-exclude-prompt t) :config (setq vterm-buffer-name "vterm") - (evil-set-initial-state 'vterm-mode 'emacs)) + (evil-set-initial-state 'vterm-mode 'emacs) + (setq vterm-tramp-shells (append '(("ssh" "/bin/bash")) vterm-tramp-shells))) #+end_src @@ -983,7 +1030,57 @@ (use-package elfeed :config (setq elfeed-feeds - '("https://www.reddit.com/r/emacs.rss"))) + '(("https://www.reddit.com/r/emacs.rss" emacs) + ("https://www.reddit.com/r/gnu.rss" gnu) + ("https://stallman.org/rss/rss.xml" stallman)))) + +#+end_src + +* Custom + +#+begin_src emacs-lisp + (defun jd/generete-qr-from-clipboard () + (interactive) + (let ((clipboard-value (x-get-clipboard)) + (clipboard-file-path "/tmp/clipboard_value.txt") + (clipboard-out-image "/tmp/qr.png")) + (with-temp-file clipboard-file-path + (insert clipboard-value)) + (shell-command (concat + "qrencode -o " + clipboard-out-image + " < " + clipboard-file-path)) + (find-file clipboard-out-image))) + + + ;; (defun jd/screenshot () + ;; (inactive) + ;; (let* ((screenshot-command '("import" "png:-")) + ;; (image + ;; (with-temp-buffer + ;; (set-buffer-multibyte nil) + ;; (apply #'call-process + ;; (car screenshot-command) nil (current-buffer) nil + ;; (cdr screenshot-command)) + ;; (buffer-string)))) + ;; (set-mark (point)) + ;; (insert-image + ;; (create-image image 'png t + ;; :max-width (truncate (* (frame-pixel-width) 0.8)) + ;; :max-height (truncate (* (frame-pixel-height) 0.8)) + ;; :scale 1) + ;; (format "<#part type=\"image/png\" disposition=inline data-encoding=base64 raw=t>\n%s\n<#/part>" + ;; ;; Get a base64 version of the image -- this avoids later + ;; ;; complications if we're auto-saving the buffer and + ;; ;; restoring from a file. + ;; (with-temp-buffer + ;; (set-buffer-multibyte nil) + ;; (insert image) + ;; (base64-encode-region (point-min) (point-max) t) + ;; (buffer-string)))) + ;; (insert "\n\n") + ;; (message ""))) #+end_src diff --git a/Mail.org b/Mail.org index c749918..1ded00d 100644 --- a/Mail.org +++ b/Mail.org @@ -59,16 +59,34 @@ smtpmail-smtp-service 465 smtpmail-stream-type 'ssl) + (setq mu4e-compose-signature (concat + "Pozdrawiam,\n" + "Jakub Długosz")) + (mu4e t)) +#+end_src + +*mu4e-alert* + +#+begin_src emacs-lisp + (use-package mu4e-alert + :defer 20 + :config + (mu4e-alert-set-default-style 'libnotify) + (mu4e-alert-enable-mode-line-display) + (mu4e-alert-enable-notifications)) +#+end_src + +*mu4e bindings* + +#+begin_src emacs-lisp (jd/leader-key-def "m" '(:ignore t :which-key "mail") "mm" 'mu4e "mc" 'mu4e-compose-new) - (provide 'jd-mu4e) - #+end_src * mbsyncrc -- cgit v1.2.3