From c6c985d1188830ac90a546cfa27a77c220c9d096 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Thu, 19 Oct 2023 19:24:35 +0200 Subject: Add stumpwm and change disk config for berserker. --- .emacs.d/init.el | 7 ++- .emacs.d/jd/jd-custom.el | 13 +++++ .emacs.d/jd/jd-dev.el | 87 +++++++++++++++----------------- .emacs.d/jd/jd-exwm.el | 20 ++++---- .emacs.d/jd/jd-mu4e.el | 127 +++++++++++++++++++++++++---------------------- .emacs.d/jd/jd-org.el | 41 ++++++--------- .emacs.d/jd/jd-ui.el | 41 +++++++-------- 7 files changed, 171 insertions(+), 165 deletions(-) (limited to '.emacs.d') diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d4fc30a..96b81da 100755 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -55,7 +55,9 @@ version-control t delete-old-versions t kept-new-versions 20 - kept-old-versions 5) + kept-old-versions 5 + custom-file (concat user-emacs-directory + "custom.el")) ;; (setq user-emacs-directory "~/.cache/emacs") @@ -120,3 +122,6 @@ (setq gc-cons-threshold (* 2 1000 1000)) ;;; init.el ends here +(put 'upcase-region 'disabled nil) +(put 'downcase-region 'disabled nil) +(put 'set-goal-column 'disabled nil) diff --git a/.emacs.d/jd/jd-custom.el b/.emacs.d/jd/jd-custom.el index 96d13c6..f48f761 100755 --- a/.emacs.d/jd/jd-custom.el +++ b/.emacs.d/jd/jd-custom.el @@ -17,6 +17,19 @@ clipboard-file-path)) (find-file clipboard-out-image))) +(defun jd/dired-open-file-in-kill-ring () + (interactive) + (let* ((last-killed (car kill-ring)) + (exists-p (file-exists-p last-killed)) + (dir-p (file-directory-p last-killed))) + (cond + ((not exists-p) (message "File doesn't exists!")) + (dir-p (dired last-killed)) + ((not dir-p) (find-file last-killed))))) + +(global-set-key (kbd "C-c O") #'jd/dired-open-file-in-kill-ring) + + (setq erc-nick "bobbma" erc-user-full-name "Jakub Dlugosz" erc-notify-list '("akuleszaa")) diff --git a/.emacs.d/jd/jd-dev.el b/.emacs.d/jd/jd-dev.el index d69313e..bd8d4ee 100755 --- a/.emacs.d/jd/jd-dev.el +++ b/.emacs.d/jd/jd-dev.el @@ -9,6 +9,7 @@ (setq gdb-many-windows t) (jd/use-package lsp-mode "emacs-lsp-mode" + :diminish t :commands (lsp lsp-deferred) :init (setq lsp-headerline-breadcrumb-enable nil) @@ -22,38 +23,33 @@ :after lsp) (jd/use-package paredit "emacs-paredit") -;; (jd/use-package evil-paredit "emacs-evil-paredit" -;; :config -;; (defun jd/lisp-mode-setup () -;; (rainbow-delimiters-mode) -;; (evil-paredit-mode) -;; (paredit-mode)) -;; (add-hook 'emacs-startup-hook -;; (lambda () -;; (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup) -;; (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup) -;; (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup) -;; (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup))) -;; (evil-define-key 'normal paredit-mode-map (kbd "g h") 'paredit-forward-barf-sexp) -;; (evil-define-key 'normal paredit-mode-map (kbd "g l") 'paredit-forward-slurp-sexp) -;; (evil-define-key 'normal paredit-mode-map (kbd "g H") 'paredit-backward-slurp-sexp) -;; (evil-define-key 'normal paredit-mode-map (kbd "g L") 'paredit-backward-barf-sexp)) -(jd/use-package rainbow-delimiters "emacs-rainbow-delimiters") -(jd/use-package geiser "emacs-geiser") -(jd/use-package geiser-guile "emacs-geiser-guile") +(defun jd/lisp-mode-setup () + (rainbow-delimiters-mode) + (paredit-mode)) + +(add-hook 'emacs-startup-hook + (lambda () + (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup) + (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup) + (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup) + (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup))) -;; (defun jd/python-mode-setup () -;; (let ((project-venv-path (concat (projectile-project-root) "venv/"))) -;; (when (projectile--directory-p project-venv-path) -;; (pyvenv-activate project-venv-path) -;; (pyvenv-mode)))) +(jd/use-package rainbow-delimiters "emacs-rainbow-delimiters") -;; (jd/use-package python-mode ;;TODO: find alternative -;; :hook (python-mode . lsp-deferred) -;; :hook (python-mode . jd/python-mode-setup) -;; :config -;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) +(jd/use-package sly "emacs-sly") + +(jd/use-package geiser "emacs-geiser") +(jd/use-package geiser-racket "emacs-geiser-racket") +(jd/use-package racket-mode "emacs-racket-mode") +(jd/use-package geiser-guile "emacs-geiser-guile" + :config + (when jd/guix-p + (defun jd/guix-repl () + (interactive) + (let ((geiser-guile-binary '("guix" "repl")) + (geiser-guile-load-path (cons "~/dotfiles/guix" geiser-guile-load-path))) + (geiser 'guile))))) (jd/use-package pyvenv "emacs-pyvenv" :after python-mode) @@ -63,11 +59,7 @@ :config (setq typescript-indent-level 2)) -;; (defun jd/activate-tide-mode () -;; (when (and (stringp buffer-file-name) -;; (string-match "\\.[tj]sx?\\'" buffer-file-name)) -;; (tide-setup) -;; (tide-hl-identifier-mode))) +(jd/use-package cider "emacs-cider") (jd/use-package tide "emacs-tide" :after (typescript-mode company web-mode)) @@ -94,6 +86,9 @@ (jd/use-package yaml-mode "emacs-yaml-mode") (jd/use-package docker "emacs-docker" + :bind + ("C-c D d" . docker-containers) + ("C-c D D" . docker) :config (jd/leader-key-def "d" '(:ignore t :which-key "Docker") @@ -101,6 +96,7 @@ "dd" '(docker :which-key "Docker"))) (jd/use-package company "emacs-company" + :diminish t :after lsp-mode :hook (lsp-mode . company-mode) :bind (:map company-active-map @@ -114,6 +110,7 @@ (global-company-mode)) (jd/use-package company-box "emacs-company-box" + :diminish t :hook (company-mode . company-box-mode)) (jd/use-package projectile "emacs-projectile" @@ -135,15 +132,6 @@ :init (setq neo-theme 'icons) :config - - ;; (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) - ;; (evil-define-key 'normal neotree-mode-map (kbd "C-RET") 'neotree-quick-look) - ;; (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) - ;; (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) - ;; (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) - ;; (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) - ;; (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) - (jd/leader-key-def "op" '(jd/neotree-project-dir :which-key "Open neotree")) @@ -162,11 +150,16 @@ (jd/use-package magit "emacs-magit" :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) + (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) - (jd/leader-key-def - "g" '(:ignore t :which-key "Git") - "gg" '(magit-status-here :which-key "Magit status"))) +(jd/use-package restclient "emacs-restclient") + +(setq sql-connection-alist + '(("net47-abaks" + (sql-product 'postgres) + (sql-user "kuba") + (sql-database "net47") + (sql-server "net47.abaks.pl")))) (provide 'jd-dev) diff --git a/.emacs.d/jd/jd-exwm.el b/.emacs.d/jd/jd-exwm.el index ed1c673..f083c44 100755 --- a/.emacs.d/jd/jd-exwm.el +++ b/.emacs.d/jd/jd-exwm.el @@ -4,6 +4,8 @@ ;;; Code: +(jd/use-package perspective "emacs-perspective") + (jd/use-package exwm "emacs-exwm" :config (defun jd/exwm-update-class () @@ -73,6 +75,7 @@ ?\M-` ?\M-& ?\M-! + ?\C-g ?\M-: ?\C-\M-j ?\C-\ )) @@ -114,27 +117,24 @@ (defun jd/dunst-show-history () (interactive) (start-process-shell-command "dunstctl" nil "dunstctl history-pop")) + (global-set-key (kbd "C-c N h") #'jd/dunst-show-history) (defun jd/dunst-close () (interactive) (start-process-shell-command "dunstctl" nil "dunstctl close")) + (global-set-key (kbd "C-c N c") #'jd/dunst-close) (defun jd/dunst-close-all () (interactive) (start-process-shell-command "dunstctl" nil "dunstctl close-all")) - - (jd/leader-key-def - "d" '(nil :which-key "dunst") - "dh" '(jd/dunst-show-history :which-key "show history") - "dc" '(jd/dunst-close :which-key "close") - "da" '(jd/dunst-close-all :which-key "close all")) + (global-set-key (kbd "C-c N a") #'jd/dunst-close-all) (desktop-environment-mode)) -(set-frame-parameter (selected-frame) 'alpha '(90 . 90)) -(add-to-list 'default-frame-alist `(alpha . (90 . 90))) -(set-frame-parameter (selected-frame) 'fullscreen 'maximized) -(add-to-list 'default-frame-alist '(fullscreen . maximized)) +;; (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) +;; (add-to-list 'default-frame-alist `(alpha . (90 . 90))) +;; (set-frame-parameter (selected-frame) 'fullscreen 'maximized) +;; (add-to-list 'default-frame-alist '(fullscreen . maximized)) (defun jd-exwm/get-color (ATTRIBUTE) (face-attribute 'default ATTRIBUTE)) diff --git a/.emacs.d/jd/jd-mu4e.el b/.emacs.d/jd/jd-mu4e.el index e97c4fc..cb81c5c 100755 --- a/.emacs.d/jd/jd-mu4e.el +++ b/.emacs.d/jd/jd-mu4e.el @@ -3,77 +3,84 @@ (jd/use-package htmlize "emacs-htmlize") -; (jd/add-package-to-manifest "mbsync") ;; TODO: Define guix mbsync package? +(jd/add-package-to-manifest "isync") (jd/use-package mu4e "mu" - :defer 10 - :ensure nil - :config - (require 'org-mu4e) + :defer 10 + :ensure nil + :bind + ("C-c M" . mu4e) + :config + ;a (require 'org-mu4e) - (setq mu4e-mu-binary "/usr/local/bin/mu") - (setq mu4e-update-interval (* 10 60)) - (setq mu4e-get-mail-command "mbsync -a") - (setq mu4e-maildir "~/Mail") + (if jd/guix-p + (setq mu4e-mu-binary "/home/jakub/.guix-extra-profiles/emacs/emacs/bin/mu") + (setq mu4e-mu-binary "/usr/local/bin/mu")) - (setq mu4e-completing-read-function #'ivy-completing-read) + (setq mu4e-update-interval (* 10 60)) + (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-maildir "~/Mail") - (setq mu4e-change-filenames-when-moving t) + (setq mu4e-completing-read-function #'ivy-completing-read) - (setq mu4e-contexts - `(,(make-mu4e-context - :name "Abaks" - :match-func (lambda (msg) (when msg - (string-prefix-p "/abaks" (mu4e-message-field msg :maildir)))) - :vars '( - (user-full-name . "Jakub Dlugosz") - (user-mail-address . "jakub@abaks.pl") - (mu4e-sent-folder . "/abaks/Sent Items") - (mu4e-trash-folder . "/abaks/Trash") - (mu4e-drafts-folder . "/abaks/Drafts") - (mu4e-refile-folder . "/abaks/Archive") - (smtpmail-local-domain . "pl") - (smtpmail-smtp-server . "smtp.abaks.pl") - (mu4e-sent-messages-behavior . sent) - )) - ,(make-mu4e-context - :name "Gmail" - :match-func (lambda (msg) (when msg - (string-prefix-p "/gmail" (mu4e-message-field msg :maildir)))) - :vars '( - (user-full-name . "Jakub Dlugosz") - (user-mail-address . "jdlugosz963@gmail.com") - (mu4e-sent-folder . "/gmail/\[Gmail\]/Wys\&AUI-ane") - (mu4e-trash-folder . "/gmail/\[Gmail\]/Kosz") - (mu4e-drafts-folder . "/gmail/\[Gmail\]/Wersje\ robocze") - (mu4e-refile-folder . "/gmail/Archive") - (smtpmail-local-domain . "com") - (smtpmail-smtp-server . "smtp.gmail.com") - (mu4e-sent-messages-behavior . sent) - )))) + (setq mu4e-change-filenames-when-moving t) - (setq mail-user-agent 'mu4e-user-agent - mail-host-address nil - message-send-mail-function 'smtpmail-send-it - smtpmail-smtp-service 465 - smtpmail-stream-type 'ssl) + (setq mu4e-contexts + `(,(make-mu4e-context + :name "Abaks" + :match-func (lambda (msg) (when msg + (string-prefix-p "/abaks" (mu4e-message-field msg :maildir)))) + :vars '( + (user-full-name . "Jakub Dlugosz") + (user-mail-address . "jakub@abaks.pl") + (mu4e-sent-folder . "/abaks/Sent Items") + (mu4e-trash-folder . "/abaks/Trash") + (mu4e-drafts-folder . "/abaks/Drafts") + (mu4e-refile-folder . "/abaks/Archive") + (mu4e-sent-messages-behavior . sent) + (smtpmail-local-domain . "pl") + (smtpmail-smtp-server . "smtp.abaks.pl") + (smtpmail-smtp-user . "jakub@abaks.pl"))) + ,(make-mu4e-context + :name "Gmail" + :match-func (lambda (msg) (when msg + (string-prefix-p "/gmail" (mu4e-message-field msg :maildir)))) + :vars '( + (user-full-name . "Jakub Dlugosz") + (user-mail-address . "jdlugosz963@gmail.com") + (mu4e-sent-folder . "/gmail/\[Gmail\]/Wys\&AUI-ane") + (mu4e-trash-folder . "/gmail/\[Gmail\]/Kosz") + (mu4e-drafts-folder . "/gmail/\[Gmail\]/Wersje\ robocze") + (mu4e-refile-folder . "/gmail/Archive") + (smtpmail-local-domain . "com") + (smtpmail-smtp-server . "smtp.gmail.com") + (smtpmail-smtp-user . "jdlugosz963@gmail.com") + (mu4e-sent-messages-behavior . sent))))) - (setq mu4e-compose-signature (concat - "Pozdrawiam,\n" - "Jakub Długosz")) + (setq mail-user-agent 'mu4e-user-agent + mail-host-address nil + message-send-mail-function 'smtpmail-send-it + smtpmail-smtp-service 465 + smtpmail-stream-type 'ssl + smtpmail-servers-requiring-authorization ".*") - (mu4e t)) + (setq mu4e-compose-signature (concat + "Pozdrawiam,\n" + "Jakub Długosz")) + + (mu4e t) + (mu4e-modeline-mode nil)) (jd/use-package mu4e-alert "emacs-mu4e-alert" - :defer 20 - :config - (mu4e-alert-set-default-style 'libnotify) - (mu4e-alert-enable-mode-line-display) - (mu4e-alert-enable-notifications) + :defer 20 + :config + (mu4e-alert-set-default-style 'libnotify) + (mu4e-alert-enable-mode-line-display) + (mu4e-alert-enable-notifications) - (jd/leader-key-def - "m" '(:ignore t :which-key "mail") - "mm" 'mu4e - "mc" 'mu4e-compose-new)) + (jd/leader-key-def + "m" '(:ignore t :which-key "mail") + "mm" 'mu4e + "mc" 'mu4e-compose-new)) (provide 'jd-mu4e) diff --git a/.emacs.d/jd/jd-org.el b/.emacs.d/jd/jd-org.el index cd05d72..fe273c3 100755 --- a/.emacs.d/jd/jd-org.el +++ b/.emacs.d/jd/jd-org.el @@ -5,7 +5,7 @@ (defvar jd/org-home "~/Documents/Org") (defvar jd/org-roam-home (concat jd/org-home "/roam")) -(defvar jd/org-roam-daily-home (concat jd/org-home "/roam/daily")) +(defvar jd/org-roam-daily-home (concat jd/org-roam-home "/daily")) (defun jd/org-mode-init () (org-indent-mode) @@ -20,12 +20,16 @@ :pin org :commands (org-capture org-agenda) :hook (org-mode . jd/org-mode-init) + :bind + ("C-c o c" . #'org-capture) + ("C-c o p" . #'org-mobile-pull) + ("C-c o P" . #'org-mobile-push) + ("C-c o a" . #'org-agenda) :config (setq org-directory (file-truename "~/Documents/Org/")) (setq org-mobile-inbox-for-pull (concat org-directory "flagged.org")) - (setq org-mobile-directory "~/Dropbox/Apps/MobileOrg") - (setq org-agenda-files - '("Tasks.org")) + (setq org-mobile-directory "~/Documents/Org/Mobile/") + (setq org-agenda-files '("Tasks.org" "Inbox.org" "Habits.org")) (setq org-ellipsis " ▾") (setq org-agenda-start-with-log-mode t) (setq org-log-done 'time) @@ -50,12 +54,14 @@ "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) (require 'org-tempo) + (jd/leader-key-def - "o" '(:ignore t :which-key "Open/Org") - "oc" '(org-capture :which-key "Open org-capture") - "oop" '(org-mobile-pull :which-key "Org mobile pull") - "ooP" '(org-mobile-push :which-key "Org mobile push") - "oa" '(org-agenda :which-key "Open org-agenda")) + "o" '(:ignore t :which-key "Open/Org") + "oc" '(org-capture :which-key "Open org-capture") + "oop" '(org-mobile-pull :which-key "Org mobile pull") + "ooP" '(org-mobile-push :which-key "Org mobile push") + "oa" '(org-agenda :which-key "Open org-agenda")) + (defun jd/org-font-setup () ;; Replace list hyphen with dot @@ -122,21 +128,7 @@ (org-babel-tangle)))) (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'jd/org-babel-tangle-config))) - - (defun jd/org-mode-visual-fill () - (setq visual-fill-column-width 100 - visual-fill-column-center-text t) - (visual-fill-column-mode 1))) - -;; (jd/use-package evil-org "emacs-evil-org" -;; :after org -;; :hook (org-mode . (lambda () evil-org-mode)) -;; :config -;; (require 'evil-org-agenda) -;; (evil-org-agenda-set-keys)) - -(jd/use-package visual-fill-column "emacs-visual-fill-column" - :hook (org-mode . jd/org-mode-visual-fill)) + ) (jd/use-package org-superstar "emacs-org-superstar" :hook (org-mode . org-superstar-mode) @@ -145,7 +137,6 @@ (setq org-superstar-remove-leading-stars t) (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) -; (jd/add-package-to-manifest "emacs-emacsql-sqlite3") (jd/use-package org-roam "emacs-org-roam" :custom (org-roam-directory (file-truename jd/org-roam-home)) diff --git a/.emacs.d/jd/jd-ui.el b/.emacs.d/jd/jd-ui.el index 1c44a65..7ccab23 100755 --- a/.emacs.d/jd/jd-ui.el +++ b/.emacs.d/jd/jd-ui.el @@ -22,12 +22,11 @@ (defalias 'yes-or-no-p 'y-or-n-p) -(jd/use-package doom-themes "emacs-doom-themes" - :config - ;; (load-theme 'manoj-black t) - ) +(require 'diminish) -(load-theme 'manoj-dark t) +(jd/use-package solarized-theme "emacs-solarized-theme" + :config + (load-theme 'solarized-selenized-black t)) (jd/use-package diminish "emacs-diminish") @@ -55,30 +54,25 @@ (jd/use-package ivy "emacs-ivy" :diminish :bind - (("C-s" . swiper) - ;; :map ivy-minibuffer-map - ;; ("C-k" . ivy-previous-line) - ;; ("C-j" . ivy-next-line) - ;; :map ivy-switch-buffer-map - ;; ("C-k" . ivy-previous-line) - ) + (("C-s" . swiper)) :config (ivy-mode 1)) (jd/use-package counsel "emacs-counsel" + :diminish t :config (counsel-mode 1) (jd/leader-key-def - "t" '(:ignore t :which-key "Toggle") - "tT" '(toggle-truncate-lines :which-key "Toggle truncate lines") - "tt" '(jd/load-theme :which-key "Choose theme")) + "t" '(:ignore t :which-key "Toggle") + "tT" '(toggle-truncate-lines :which-key "Toggle truncate lines") + "tt" '(jd/load-theme :which-key "Choose theme")) (jd/leader-key-def - "bb" '(jd/switch-buffer :which-key "Buffer switch") - "ba" '(counsel-switch-buffer :which-key "Buffer switch") - "b" '(:ignore t :which-key "Buffer") - "," '(counsel-switch-buffer :which-key "Buffer switch"))) + "bb" '(jd/switch-buffer :which-key "Buffer switch") + "ba" '(counsel-switch-buffer :which-key "Buffer switch") + "b" '(:ignore t :which-key "Buffer") + "," '(counsel-switch-buffer :which-key "Buffer switch"))) (jd/use-package which-key "emacs-which-key" :diminish @@ -88,14 +82,17 @@ (jd/use-package all-the-icons "emacs-all-the-icons") -(jd/use-package doom-modeline "emacs-doom-modeline" - ; :init (doom-modeline-mode 0) - :custom ((doom-modeline-height 15))) (jd/use-package beacon "emacs-beacon" :config (beacon-mode 1)) +(setq display-time-string-forms + '(" " 24-hours ":" minutes " ")) + +(when jd/exwm-p + (display-battery-mode) + (display-time-mode)) (provide 'jd-ui) -- cgit v1.2.3