diff --git a/Emacs.org b/Emacs.org index afde75b..55547c8 100644 --- a/Emacs.org +++ b/Emacs.org @@ -24,8 +24,6 @@ - [[#babel-languages][Babel Languages]] - [[#soure-block-creation-shortcuts][Soure Block Creation Shortcuts]] - [[#babel-configuration-file-automation-hook][Babel Configuration File Automation Hook]] - - [[#org-roam][Org Roam]] - - [[#deft-configuration][Deft Configuration]] - [[#programming-languages][Programming Languages]] - [[#common-lisp][Common Lisp]] - [[#mu4e-e-mail][Mu4e (E-mail)]] @@ -35,6 +33,7 @@ *** Load Paths #+begin_src emacs-lisp (add-to-list 'load-path "~/.guix-profile/bin/guile") +(add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp") ;; Match Emacs program path to be the same as user shell (defun set-exec-path-from-shell-PATH () @@ -353,78 +352,78 @@ Since we don't want to have to manually use the org-babel-tangle function everyt #+end_src -*** Org Roam -I use Org Roam as an alternative to writing traditional notes. Instead of long sprawling .org files, each note in Org roam is a excerpt of a specific idea or topic that has links to other notes made with Org Roam. Roam also allows you to pull up a buffer to look at which notes are linked in other notes. This creates a spawling network of information that is useful, quick to draw information from, and can create a notetaking experience that is interactive and seamless. +# *** Org Roam +# I use Org Roam as an alternative to writing traditional notes. Instead of long sprawling .org files, each note in Org roam is a excerpt of a specific idea or topic that has links to other notes made with Org Roam. Roam also allows you to pull up a buffer to look at which notes are linked in other notes. This creates a spawling network of information that is useful, quick to draw information from, and can create a notetaking experience that is interactive and seamless. -#+begin_src emacs-lisp +# #+begin_src emacs-lisp -(use-package org-roam - :init - (setq org-roam-v2-ack t) - :custom - (org-roam-directory "~/roam/notes/") - (org-roam-completion-everywhere t) - (org-roam-capture-templates - '(("d" "default" plain - "%?" - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") - :unnarrowed t) - ("r" "resources" plain - (file "~/roam/templates/resource-template.org") - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") - :unnarrowed t) - ("f" "files" plain - (file "~/roam/templates/res-file-note-temp.org") - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") - :unnarrowed t) - ("c" "cli" plain - (file "~/roam/templates/commands-template.org") - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") - :unnarrowed t))) - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n i" . org-roam-node-insert) - ("C-c n I" . org-roam-node-insert-immediate) - ("C-c n p" . my/org-roam-find-project) - :map org-mode-map - ("C-M-i" . completion-at-point) - :map org-roam-dailies-map - ("Y" . org-roam-dailies-capture-yesterday) - ("T" . org-roam-dailies-capture-tomorrow)) - :bind-keymap - ("C-c n d" . org-roam-dailies-map) - :config - (require 'org-roam-dailies) ;; Ensure the keymap is available - (org-roam-db-autosync-mode)) +# (use-package org-roam +# :init +# (setq org-roam-v2-ack t) +# :custom +# (org-roam-directory "~/roam/notes/") +# (org-roam-completion-everywhere t) +# (org-roam-capture-templates +# '(("d" "default" plain +# "%?" +# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") +# :unnarrowed t) +# ("r" "resources" plain +# (file "~/roam/templates/resource-template.org") +# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") +# :unnarrowed t) +# ("f" "files" plain +# (file "~/roam/templates/res-file-note-temp.org") +# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") +# :unnarrowed t) +# ("c" "cli" plain +# (file "~/roam/templates/commands-template.org") +# :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") +# :unnarrowed t))) +# :bind (("C-c n l" . org-roam-buffer-toggle) +# ("C-c n f" . org-roam-node-find) +# ("C-c n i" . org-roam-node-insert) +# ("C-c n I" . org-roam-node-insert-immediate) +# ("C-c n p" . my/org-roam-find-project) +# :map org-mode-map +# ("C-M-i" . completion-at-point) +# :map org-roam-dailies-map +# ("Y" . org-roam-dailies-capture-yesterday) +# ("T" . org-roam-dailies-capture-tomorrow)) +# :bind-keymap +# ("C-c n d" . org-roam-dailies-map) +# :config +# (require 'org-roam-dailies) ;; Ensure the keymap is available +# (org-roam-db-autosync-mode)) -;; Function to enable the ability to quickly insert a link without -;; opening a capture buffer. -(defun org-roam-node-insert-immediate (arg &rest args) - (interactive "P") - (let ((args (cons arg args)) - (org-roam-capture-templates (list (append (car org-roam-capture-templates) - '(:immediate-finish t))))) - (apply #'org-roam-node-insert args))) +# ;; Function to enable the ability to quickly insert a link without +# ;; opening a capture buffer. +# (defun org-roam-node-insert-immediate (arg &rest args) +# (interactive "P") +# (let ((args (cons arg args)) +# (org-roam-capture-templates (list (append (car org-roam-capture-templates) +# '(:immediate-finish t))))) +# (apply #'org-roam-node-insert args))) -#+end_src +# #+end_src -*** Deft Configuration +# *** Deft Configuration -Deft is a package that helps browse and filter plain text files. I use it to search through org-roam notes. +# Deft is a package that helps browse and filter plain text files. I use it to search through org-roam notes. -#+begin_src emacs-lisp +# #+begin_src emacs-lisp -(use-package deft - :after org - :bind - ("C-c n d" . deft) - :custom - (deft-recursive t) - (deft-use-filter-string-for-filename t) - (deft-default-extension "org") - (deft-directory org-roam-directory)) +# (use-package deft +# :after org +# :bind +# ("C-c n d" . deft) +# :custom +# (deft-recursive t) +# (deft-use-filter-string-for-filename t) +# (deft-default-extension "org") +# (deft-directory org-roam-directory)) -#+end_src +# #+end_src ** Programming Languages *** Common Lisp #+begin_src emacs-lisp diff --git a/New-Emacs.org b/New-Emacs.org new file mode 100644 index 0000000..e900019 --- /dev/null +++ b/New-Emacs.org @@ -0,0 +1,478 @@ +#+TITLE: Emacs Configuration +#+PROPERTY: header-args:emacs-lisp :tangle ~/Dotfiles/config/emacs/init.el :mkdirp yes :lexical yes + +Todo: +- Yassnippet +- Get Email Working again +- Get IRC working + +:PROPERTIES: +:VISIBILITY: children +:END: +* Table of Contents :TOC_4_gh: +* Package Management +I use [[https://github.com/raxod502/straight.el][straight.el]] for managing packages as it's fairly simple and robust. At some point I'd like to move to primarily using Guix for Emacs package management. + +** Bootstraping straight.el +#+begin_src emacs-lisp +(setq package-enable-at-startup nil) + +;; * Package Management with straight.el +(unless (featurep 'straight) + ;; Bootstrap straight.el + (defvar bootstrap-version) + (let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage))) + +;; Use straight.el for use-package expressions +(straight-use-package 'use-package) +#+end_src + +* General +** User Interface +#+begin_src emacs-lisp +(scroll-bar-mode -1) ;; Disable scroll bar +(tool-bar-mode -1) ;; Disable tool bar menu +(tooltip-mode -1) ;; Disable tooltips +(set-fringe-mode 10) ;; Disable fringe mode +(menu-bar-mode -1) ;; Disable menu bar +(global-display-line-numbers-mode t) ;; Display line numbers +(set-default 'truncate-lines nil) ;; Wrap lines at end of screen +(setq visible-bell t) ;; Visible flash to represent a bell +(setq x-select-enable-clipboard t) ;; Enable clipboard + +;; Disable line mode for specific major/minor modes. +(dolist (mode '(org-mode-hook + term-mode-hook + shell-mode-hook + eshell-mode-hook)) + (add-hook mode (lambda () (display-line-numbers-mode 0)))) +#+end_src + +** Modeline +Doom's modeline is excellent, and much less cluttered than the default Emacs modeline. +#+begin_src emacs-lisp +(use-package doom-modeline + :straight t + :init (doom-modeline-mode 1) + :custom ((doom-modeline-height 15))) +#+end_src + +** Keybinding display +Which-key is a package that displays the available commands granted that it's incomplete. For instance, if I type "SPC", I will see all of the commands available to the leader key. + +#+begin_src emacs-lisp +(use-package which-key + :straight t + :defer 0 + :diminish which-key-mode + :config + (which-key-mode) + (setq which-key-idle-delay 0.3)) +#+end_src + +** Notifications +*** Alerts +Minimal alerts so I can see notifications from various programs in Emacs. + +#+begin_src emacs-lisp +(use-package alert + :straight t + :config + (setq alert-default-style 'notification)) +#+end_src +*** Disable Warnings +#+begin_src emacs-lisp +(setq large-file-warning-threshold nil) ;; Disables warnings for large files +(setq vc-follow-symlinks t) ;; Disables warnings for symlinks +#+end_src +** Helpful Describe Functionality +Helpful.el is a package that reformats the describe-X functions to be much more informative. + +#+begin_src emacs-lisp +(use-package helpful + :straight t + :commands (helpful-callable helpful-variable helpful-command helpful-key) + :custom + (counsel-describe-function-function #'helpful-callable) + (counsel-describe-variable-function #'helpful-variable) + :bind + ([remap describe-function] . counsel-describe-function) + ([remap describe-command] . helpful-command) + ([remap describe-variable] . counsel-describe-variable) + ([remap describe-key] . helpful-key)) +#+end_src +** Autosaves +#+begin_src emacs-lisp +(use-package super-save + :straight t + :config + (super-save-mode +1) + (super-save-auto-save-when-idle t)) + +;; Auto reverting Changed Files +(setq global-auto-revert-non-file-buffers t) +(global-auto-revert-mode 1) +#+end_src +* Theme +I really enjoy [[https://protesilaos.com/emacs/modus-themes][Modus Themes]] by Protesilaos Stavrou. They are minimal, high contrast, and easy on the eyes. + +#+begin_src emacs-lisp +(use-package modus-themes + :straight t + :init + (setq modus-themes-italic-constructs t + modus-themes-bold-constructs nil + modus-themes-region '(accented bg-only no-extend) + modus-themes-org-blocks 'greyscale + modus-themes-paren-match 'intense + modus-themes-mixed-fonts t) + (modus-themes-load-themes) + :config + (modus-themes-load-vivendi) + :bind + ("" . modus-themes-toggle)) +#+end_src + +* Fonts +Mozilla's Fira fonts are pretty, and the Sans and Code types look excellent with the corresponding mode. + +#+begin_src emacs-lisp +(set-face-attribute 'default nil :font "Fira Code" :height 125 :weight 'medium) +(set-face-attribute 'variable-pitch nil :font "Fira Sans" :height 1.0 :weight 'regular) +(set-face-attribute 'fixed-pitch nil :font "Fira Code" :height 1.0 :weight 'medium) +#+end_src + +* Keybinding +I came from vim, so naturally I use Evil keybindings. I also used to use Doom Emacs before rolling my own configuration so I've borrowed some ideas from my time spent there as well. Between the two paradigms I rarely leave the home row which is ideal for typing for extended periods of time. + +** General.el (leader-key keybindings) +I really enjoy having a leader key and eschewing the Control and Alt keys entirely. Doom had far too many leader keybindings that I never used so I've boiled them down to the essentials that I used the most. + +#+begin_src emacs-lisp +(global-set-key (kbd "") 'keyboard-escape-quit) ;; Escape exits out of prompts + + ;; Define Leader Key +(use-package general + :straight t + :config + (general-evil-setup t) + (general-create-definer opal/leader-keys + :keymaps '(normal insert visual emacs) + :prefix "SPC" + :global-prefix "C-SPC") + ;; Define Keybindings (potentially move into own file) + (opal/leader-keys + ;; Leader-map + ";" #'pp-eval-expression ;; Eval expression + ":" #'execute-extended-command ;; Eq to M-x + "u" #'universal-argument ;; Universal argument + "w" #'evil-window-map ;; Window functions + "h" #'help-map ;; Helper functions + "." #'find-file ;; Find file (opens in mini-buffer) + "," #'persp-switch-to-buffer ;; Switch to perspective.el minibuffer + "<" #'switch-to-buffer ;; Switch to non-perspective.el minibuffer + "s" #'swiper)) ;; Search in current buffer +#+end_src + +** Evil +#+begin_src emacs-lisp +(use-package evil + :straight t + :init + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + (setq evil-want-C-u-scroll t) + (setq evil-want-C-i-jump nil) + (setq evil-respect-visual-line-mode t) + :config + (evil-mode 1) + (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) + (define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join) + + ;; Use visual line motions even outside of visual-line-mode buffers + (evil-global-set-key 'motion "j" 'evil-next-visual-line) + (evil-global-set-key 'motion "k" 'evil-previous-visual-line) + + (evil-set-initial-state 'messages-buffer-mode 'normal) + (evil-set-initial-state 'dashboard-mode 'normal)) + +(use-package evil-collection + :straight t + :after evil + :config + (evil-collection-init)) +#+end_src + +* Completion Frameworks +At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it as well. +** Ivy +#+begin_src emacs-lisp +(use-package ivy + :straight t + :diminish + :bind + (("C-s" . swiper) + :map ivy-minibuffer-map + ("TAB" . ivy-alt-done) + ("C-l" . ivy-alt-done) + ("C-j" . ivy-next-line) + ("C-k" . ivy-previous-line) + :map ivy-switch-buffer-map + ("C-k" . ivy-previous-line) + ("C-l" . ivy-done) + ("C-d" . ivy-reverse-i-search-kill)) + :config + (ivy-mode 1)) + +(use-package ivy-rich + :straight t + :after ivy + :init (icy-rich-mode 1))) +#+end_src + +** Counsel +#+begin_src emacs-lisp +(use-package counsel + :straight t + :bind + (("C-M-j" . 'counsel-switch-buffer) + :map minibuffer-local-map + ("C-r" . 'counsel-minibuffer-history)) + + :custom + (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only) + :config + (counsel-mode 1)) +#+end_src + +* Org + +#+begin_src emacs-lisp +(defun opal/org-font-setup () + ;; Replace list hyphen with dot + (font-lock-add-keywords 'org-mode + '(("^ *\\([-]\\) " + (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) + "•")))))) + + ;; Set faces for heading levels + (dolist (face '((org-level-1 . 1.2) + (org-level-2 . 1.1) + (org-level-3 . 1.05) + (org-level-4 . 1.0) + (org-level-5 . 1.1) + (org-level-6 . 1.1) + (org-level-7 . 1.1) + (org-level-8 . 1.1))) + (set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face))) + + ;; Ensure that anything that should be fixed-pitch in Org files appears that way + (set-face-attribute 'org-block nil :foreground nil :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-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)) + (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) + (set-face-attribute 'line-number nil :inherit 'fixed-pitch) + (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) + +;; Set org agenda dir +(setq org-directory "~/Org/") + +;; Tell Org to stop indenting inside of org source blocks. +(setq org-edit-src-content-indentation 0) + +(defun opal/org-mode-setup () + (org-indent-mode) + (variable-pitch-mode 1) + (visual-line-mode 1) + (setq org-startup-folded t)) + +(use-package org + :straight t + :commands (org-capture org-agenda) + :hook (org-mode . opal/org-mode-setup) + :config + (setq org-ellipsis " ▾") + (setq org-agenda-start-with-log-mode t) + (setq org-log-done 'time) + (setq org-log-into-drawer t) + + (setq org-agenda-files + '("~/Org/projects/" + "~/Org/tasks/" + )) + + (require 'org-habit) + (add-to-list 'org-modules 'org-habit) + (setq org-habit-graph-column 60) + + (setq org-todo-keywords + '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") + (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)"))) + + (setq org-refile-targets + '(("archive.org" :maxlevel . 1) + ("planner.org" :maxlevel . 1))) + + ;; Save Org buffers after refiling! + (advice-add 'org-refile :after 'org-save-all-org-buffers) + + (setq org-tag-alist + '((:startgroup) + ; Put mutually exclusive tags here + (:endgroup) + ("@errand" . ?E) + ("@home" . ?H) + ("@work" . ?W) + ("agenda" . ?a) + ("planning" . ?p) + ("publish" . ?P) + ("batch" . ?b) + ("note" . ?n) + ("idea" . ?i))) + + ;; Configure custom agenda views + (setq org-agenda-custom-commands + '(("d" "Dashboard" + ((agenda "" ((org-deadline-warning-days 7))) + (todo "NEXT" + ((org-agenda-overriding-header "Next Tasks"))) + (tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects"))))) + + ("n" "Next Tasks" + ((todo "NEXT" + ((org-agenda-overriding-header "Next Tasks"))))) + + ;; Low-effort next actions + ("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0" + ((org-agenda-overriding-header "Low Effort Tasks") + (org-agenda-max-todos 20) + (org-agenda-files org-agenda-files))))) + + ;; Create capture templates + (setq org-capture-templates + `(("t" "Tasks") + ("tt" "Task" entry (file+olp "~/org/planner/tasks.org" "Inbox") + "* TODO %?\n %U\n %a\n %i" :empty-lines 1) + + ("p" "Projects") + ("pp" "Project File" entry (file+olp "~/org/projects/auto-infra-overview.org" "Inbox") + "* TODO %?\n %U\n %a\n %i" :empty-lines 1))) + ;; Init org font setup + (opal/org-font-setup)) + +;; Change default pretty bullets to circles +(use-package org-bullets + :straight t + :after org + :hook (org-mode . org-bullets-mode) + :custom + (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) + +; Creates margins, and centerrs content in org mode. +(defun opal/org-mode-visual-fill () + (setq visual-fill-column-width 100 + visual-fill-column-center-text t) + (visual-fill-column-mode 1)) + +(use-package visual-fill-column + :straight t + :hook (org-mode . opal/org-mode-visual-fill)) + +;; Org Babel +;; Load languages for babel code blocks. +(with-eval-after-load 'org + (org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . t))) + + (push '("conf-unix" . conf-unix) org-src-lang-modes)) + +;; Set geiser default language +(setq geiser-default-implementation '(guile)) + +(with-eval-after-load 'org + (require 'org-tempo) + + (add-to-list 'org-structure-template-alist '("sh" . "src shell")) + (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) + (add-to-list 'org-structure-template-alist '("py" . "src python")) + (add-to-list 'org-structure-template-alist '("yml" . "src yaml")) + (add-to-list 'org-structure-template-alist '("scm" . "src scheme")) + (add-to-list 'org-structure-template-alist '("js" . "src javascript")) + (add-to-list 'org-structure-template-alist '("html" . "src html")) + (add-to-list 'org-structure-template-alist '("css" . "src css")) + (add-to-list 'org-structure-template-alist '("cl" . "src lisp"))) +#+end_src +* Magit +#+begin_src emacs-lisp +(use-package magit + :straight t) +#+end_src +* E-Mail +#+begin_src emacs-lisp +;; (use-package mu4e +;; :straight t +;; :config +;; ;; This is set to 't' to avoid mail syncing issues when using mbsync +;; (setq mu4e-change-filenames-when-moving t) + +;; ;; Refresh mail using isync every 5 minutes +;; (setq mu4e-update-interval (* 5 60)) +;; (setq mu4e-get-mail-command "mbsync -a -c ~/Dotfiles/.config/mbsync/mbsyncrc") +;; (setq mu4e-maildir "~/Mail") + +;; (setq mu4e-contexts +;; (list +;; ;; Opal.sh +;; (make-mu4e-context +;; :name "Ry P." +;; :match-func +;; (lambda (msg) +;; (when msg +;; (string-prefix-p "/opal.sh" (mu4e-message-field msg :maildir)))) + +;; :vars '((user-mail-address . "ry@opal.sh") +;; (user-full-name . "Ry P.") +;; (mu4e-drafts-folder . "/opal.sh/Drafts") +;; (mu4e-sent-folder . "/opal.sh/Sent") +;; (mu4e-trash-folder . "/opal.sh/Trash"))))) + +;; (setq mu4e-maildir-shortcuts +;; '(("/opal.sh/Inbox" . ?i) +;; ("/opal.sh/Sent" . ?s) +;; ("/opal.sh/Trash" . ?t) +;; ("/opal.sh/Drafts" . ?d)))) +#+end_src +* IRC +#+begin_src emacs-lisp +;; (use-package erc +;; :straight t +;; (setq erc-server "irc.libera.chat" ;sets default server +;; erc-nick "opalvaults" ; Sets nick +;; erc-user-full-name "opalvaults" +;; erc-track-shorten-start 8 +;; erc-kill-buffer-on-part t +;; erc-auto-query 'bury +;; erc-fill-column 90 +;; erc-fill-function 'erc-fill-static +;; erc-fill-static-center 20 +;; erc-track-visibility nil +;; erc-interpret-mirc-color t +;; erc-rename-buffers t +;; erc-track-exclude-server-buffer t)) +#+end_src diff --git a/StumpWM.org b/StumpWM.org new file mode 100644 index 0000000..240acab --- /dev/null +++ b/StumpWM.org @@ -0,0 +1,175 @@ +#+TITLE: StumpWM Configuration +#+PROPERTY: header-args:emacs-lisp :tangle ~/Dotfiles/config/stumpwm/init.el :mkdirp yes + +In my quest to make my computer a Lisp machine in its own right, I am using StumpWM as my window manager. + +* Init +#+begin_src lisp +(in-package :stumpwm) +;; (defvar *sbcl-path* "~/.guix-home/profile/share/common-lisp/sbcl/") + +;; StumpWM Modules +(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-swm-gaps") +(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-ttf-fonts") +(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-stumptray") +(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-kbd-layouts") +#+end_src + +* Environment +** Workspaces +#+begin_src lisp +(run-commands + "gnewbg I" + "gnew II" + "gnewbg III" + "gnewbg IV" + "gnewbg V" + "gnewbg-float F") +#+end_src + +** Set Prefix +#+begin_src lisp +(set-prefix-key (kbd "s-d")) +#+end_src + +** Focus window with mouth +#+begin_src lisp +setf *mouse-focus-policy* :click) +#+end_src + +** Messages +#+begin_src lisp +(setq *message-window-gravity* :top) +(setq *message-window-padding* 10) +(setq *message-window-y-padding 10) +#+end_src + +** Command Window +#+begin_src lisp +(setq *input-window-gravity* :center) +#+end_src +* Keyboard +** Load Keyboard Layout Module +#+begin_src lisp +;; (load-module "kbd-layouts") +#+end_src +** Remap Caps Lock +#+begin_src lisp +setf kbd-layouts:*caps-lock-behavior* :esc) +#+end_src +** Xmodmap +#+begin_src lisp +;; (run-shell-command "xmodmap ~/Dotfiles/.config/Xmodmap") +#+end_src + +** Keybinds +#+begin_src lisp +;; Set some super key bindings +(define-key *top-map* (kbd "s-h") "move-focus left") +(define-key *top-map* (kbd "s-l") "move-focus right") +(define-key *top-map* (kbd "s-j") "move-focus down") +(define-key *top-map* (kbd "s-k") "move-focus up") + +(define-key *top-map* (kbd "s-S-h") "move-window left") +(define-key *top-map* (kbd "s-S-l") "move-window right") +(define-key *top-map* (kbd "s-S-j") "move-window down") +(define-key *top-map* (kbd "s-S-k") "move-window up") + +(define-key *top-map* (kbd "s-f") "fullscreen") +(define-key *top-map* (kbd "s-r") "iresize") +(define-key *top-map* (kbd "s-S-q") "delete") +(define-key *top-map* (kbd "s-SPC") "run-shell-command emacsclient -e \"(call-interactively #'app-launcher-run-app)\"") +;; (define-key *top-map* (kbd "C-s-l") "run-shell-command slock") + +(define-key *top-map* (kbd "s-TAB") "next-in-frame") +(define-key *top-map* (kbd "s-S-TAB") "prev-in-frame") + +(define-key *top-map* (kbd "s-1") "gselect I") +(define-key *top-map* (kbd "s-2") "gselect II") +(define-key *top-map* (kbd "s-3") "gselect III") +(define-key *top-map* (kbd "s-4") "gselect IV") +(define-key *top-map* (kbd "s-5") "gselect V") + +(define-key *top-map* (kbd "s-S-1") "gmove I") +(define-key *top-map* (kbd "s-S-2") "gmove II") +(define-key *top-map* (kbd "s-S-3") "gmove III") +(define-key *top-map* (kbd "s-S-4") "gmove IV") +(define-key *top-map* (kbd "s-S-5") "gmove V") + +;; Brightness and volume +;; (define-key *top-map* (kbd "XF86MonBrightnessDown") "run-shell-command brightnessctl set 5%-") +;; (define-key *top-map* (kbd "XF86MonBrightnessUp") "run-shell-command brightnessctl set +5%") +;; (define-key *top-map* (kbd "XF86AudioLowerVolume") "run-shell-command amixer set Master 3%- unmute") +;; (define-key *top-map* (kbd "XF86AudioRaiseVolume") "run-shell-command amixer set Master 3%+ unmute") +;; (define-key *top-map* (kbd "XF86AudioMute") "run-shell-command amixer set Master toggle") +#+end_src + +* UI +** Colors +#+begin_src lisp +;; Set UI colors +(set-border-color "#c792ea") +(set-bg-color "#232635") +(set-fg-color "#A6Accd") +(set-msg-border-width 2) +#+end_src +** Gaps +#+begin_src lisp +(load-module "swm-gaps") +(setf swm-gaps:*inner-gaps-size* 3) +(run-commands "toggle-gaps-on") +#+end_src +** Fonts +#+begin_src lisp +;; Enable TTF fonts +;; (load-module "ttf-fonts") +;; (setf xft:*font-dirs* '("/home/opal/.guix-home/profile/share/fonts/")) +;; (setf clx-truetype:+font-cache-filename+ "/home/daviwil/.local/share/fonts/font-cache.sexp") +;; (xft:cache-fonts) + +;; (set-font (make-instance 'xft:font :family "Fira Mono" :subfamily "Regular" :size 16)) + +#+end_src +** Mode-Line +#+begin_src lisp +;; Set mode line colors +(setf *mode-line-background-color* "#232635") +(setf *mode-line-foreground-color* "#A6Accd") + +;; Set the mode line format +(setf *screen-mode-line-format* "[^B%n^b] %W ^>%d") +(run-commands "mode-line" "mode-line") + +;; Start the mode line +(run-commands "mode-line") +#+end_src + +** System tray +#+begin_src lisp +;; Add the system tray module +(load-module "stumptray") +(stumptray:stumptray) +#+end_src + +* Applications +#+begin_src lisp +;; (run-shell-command "feh --bg-scale ~/.dotfiles/backgrounds/samuel-ferrara-uOi3lg8fGl4-unsplash.jpg") +;; (run-shell-command "dunst") +;; (run-shell-command "nm-applet") +;; (run-shell-command "syncthing-gtk --minimized") +;; (run-shell-command "redshift -l 37.983810:23.727539 -t 6500:3500") +(run-shell-command "emacs") +#+end_src + +* Repl Start +#+begin_src lisp +(require :slynk) +(slynk:create-server :dont-close t) +#+end_src + +* Reference +- https://github.com/daviwil/dotfiles/blob/guix-home/Stump.org +- https://github.com/alezost/stumpwm-config +- https://github.com/herbertjones/my-stumpwm-config +- https://github.com/Phundrak/dotfiles/blob/master/org/config/stumpwm.org +