diff options
35 files changed, 1263 insertions, 625 deletions
diff --git a/8t88.org b/8t88.org new file mode 100644 index 0000000..4811cda --- /dev/null +++ b/8t88.org @@ -0,0 +1,29 @@ +#+title: 8t88 Configuration + +This file configures my Framework 12 laptop named 8t88. + +* Voyager Keyboard + +This section sets up the necessary things for the Voyager keyboard to be configured. With these changes I can flash new firmware onto my Voyager keyboard. + +First I need to make sure qmk is set up. + +#+begin_src sh + qmk setup zsa/qmk_firmware -b firmware25 +#+end_src + +After this I'll need to copy the udev rules for most keyboards, although I don't know if this is necessary for Voyager specifically. + +#+begin_src sh + sudo cp ~/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/ +#+end_src + +Now I just need to add this other rule manually. I store this in =/etc/udev/rules.d/49-voyager.rules= so that it should be loaded just before the QMK general rules, hopefully pre-empting whatever those would do that doesn't work for my Voyager keyboard. + +#+begin_src sh :tangle "sudo::/etc/udev/rules.d/49-voyager.rules" + SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", MODE:="0666", SYMLINK+="ignition_dfu" +#+end_src + +The ~MODE:="0666"~ is the important bit here, it makes sure that I can access the device when it connects. + +# I probably want to change the mode to 0660 and add a GROUP:="input" or something so that only those users who should be able to actually can access it, not all users. diff --git a/GNUmakefile b/GNUmakefile index 5d7b856..9652766 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -8,7 +8,7 @@ SCHEME_IMPLEMENTATION = guile .PRECIOUS: %.el define tangle = - @printf "\e[35mOBT\e[0m %s\n" $< + @printf "\e[30;41m OBT \e[0m %s\n" $< @$(EMACS) -quick -batch \ -eval "(package-initialize)" \ -load ob-tangle \ @@ -28,7 +28,8 @@ before-%-install: # Dummy recipe @true %-stow: % before-%-install - $(STOW) $< + @printf "\e[30;44m LNK \e[0m %s\n" $< + @$(STOW) $< %-install: %-stow # Dummy recipe @true @@ -36,6 +37,10 @@ before-%-install: # Dummy recipe %-uninstall: $(STOW) -D $(subst -uninstall,,$@) +## 8t88 + +8t88: emacs/.emacs.d/init.el + ## Picom picom: picom/.config/picom.conf @@ -119,7 +124,9 @@ mbsync: mbsync/.config/cron/mbsync.guile ## ZSH zsh: zsh/.profile zsh/.zshrc zsh/.zsh/functions/unzip.zwc \ - zsh/.zsh/functions/x-yank.zwc zsh/.zsh/functions/x-copy-region-as-kill.zwc + zsh/.zsh/functions/x-yank.zwc zsh/.zsh/functions/x-copy-region-as-kill.zwc \ + zsh/.zsh/functions/settitle.zwc zsh/.zsh/functions/spwd.zwc \ + zsh/.zsh/functions/x-kill-region.zwc ## Nyxt @@ -131,14 +138,14 @@ nyxt: nyxt/.config/nyxt/init.lisp $(call tangle,emacs-lisp) %.elc: %.el - @printf "\e[36mELC\e[0m %s\n" $< + @printf "\e[30;42m ELC \e[0m %s\n" $< @$(EMACS) -q -batch -f package-initialize -f batch-byte-compile $< %.fnl: %.org $(call tangle,fennel) %.lua: %.fnl - @printf "\e[32mFNL\e[0m %s\n" $< + @printf "\e[30;43m FNL \e[0m %s\n" $< @fennel --compile $^ > $@ %: %.org @@ -148,7 +155,8 @@ nyxt: nyxt/.config/nyxt/init.lisp $(call tangle) %.zwc: % - zsh -c "zcompile $@ $^" + @printf "\e[30;45m ZWC \e[0m %s\n" $< + @zsh -c "zcompile $@ $^" check: $(SCHEME_IMPLEMENTATION) --no-auto-compile test.scm @@ -166,7 +174,18 @@ surfingkeys/dist/punt.js: surfingkeys/punt.ts surfingkeys/home.ts ## Diamond Interactive MacOS -diamond-interactive: ssh-keygen brew-install wezterm-install glide-install git-install zsh-install _mbsetupuser-install change-macos-defaults +diamond-interactive: \ + atuin-install \ + ssh-keygen \ + brew-install \ + wezterm-install \ + glide-install \ + git-install \ + zsh-install \ + _mbsetupuser-install \ + change-macos-defaults \ + hammerspoon-install \ + vivid-install ssh-keygen: $(HOME)/.ssh/id_ed25519.pub @@ -180,8 +199,6 @@ before-_mbsetupuser-install: \ _mbsetupuser/.emacs.d/init.elc \ _mbsetupuser/.emacs.d/scripts/find-php-class -before-wezterm-install: wezterm/.config/wezterm/wezterm.lua - _mbsetupuser/.config/zsh/conf.d/postgresql.sh: _mbsetupuser/Brewfile $(call tangle,shell) @@ -193,14 +210,17 @@ _mbsetupuser/.emacs.d/init.el: \ emacs/.emacs.d/oni-stillness.el \ emacs/.emacs.d/oni-xterm-color.el \ emacs/.emacs.d/oni-compilation.el \ - emacs/.emacs.d/oni-php.el \ emacs/.emacs.d/oni-prescient.el \ emacs/.emacs.d/oni-corfu.el \ - emacs/.emacs.d/oni-yasnippet.el \ emacs/.emacs.d/oni-smartparens.el \ emacs/.emacs.d/oni-flycheck.el \ emacs/.emacs.d/oni-dumb-jump.el \ emacs/.emacs.d/oni-grep.el \ + emacs/.emacs.d/oni-display-fill-column-indicator.el \ + emacs/.emacs.d/oni-sops.el \ + emacs/.emacs.d/oni-treesit.el \ + emacs/.emacs.d/oni-typescript.el \ + emacs/.emacs.d/oni-wgrep.el \ oni/home/config/pop-os/emacs.el mkdir -p $$(dirname $@) cat $^ > $@ @@ -220,6 +240,13 @@ change-macos-defaults: defaults write com.apple.dock "autohide" -bool "true" killall Dock +### Vivid + +vivid/.config/zsh/conf.d/vivid.sh: vivid/init.org + $(call tangle,sh) + +before-vivid-install: vivid/.config/zsh/conf.d/vivid.sh + # Local Variables: # outline-regexp: "##+" # End: diff --git a/_mbsetupuser/.emacs.d/init.el b/_mbsetupuser/.emacs.d/init.el new file mode 100644 index 0000000..a47ce90 --- /dev/null +++ b/_mbsetupuser/.emacs.d/init.el @@ -0,0 +1,240 @@ +;;; init.el --- Macos init file -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Tom Willemsen + +;; Author: Tom Willemsen <tom@punt.com> + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Make a thing. + +;;; Code: + +(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) + +(use-package menu-bar + :if (not (eq window-system 'ns)) + :init + (menu-bar-mode -1)) + +(use-package exec-path-from-shell + :if (eq system-type 'darwin) + :ensure t + :init + (exec-path-from-shell-initialize)) + +(use-package oni-package + :if (eq system-type 'darwin) + :ensure t + :after package) + +(use-package use-package-ensure-system-package + :ensure t) + +(use-package system-packages + :ensure t) + +(use-package oni-core + :demand t) + +(use-package oni-gui + :demand t) + +(use-package oni-elfeed + :after elfeed + :config + (require 'oni-elfeed) + (setq elfeed-feeds + '(("https://www.reddit.com/r/PHP/.rss" php) + ("https://phpreads.com/feed" php) + ("https://phpstan.org/rss.xml" php) + ("https://lobste.rs/t/php.rss" php) + ("https://mastodon.social/tags/PHP.rss" php) + ("https://wendelladriel.com/feed.rss" php)) + elfeed-curl-program-name "curl")) + +(use-package oni-data-dir) + +(use-package oni-eww + :after eww) + +(use-package oni-yasnippet + :after yasnippet) + +(use-package oni-php + :after php) + +(use-package oni-yaml + :after (yaml yaml-ts-mode)) + +(use-package oni-elisp) + +(use-package oni-org + :after org + :config + (setf (map-elt org-capture-templates "t") + '("A simple TODO item" entry (file "") "* TODO %? +:PROPERTIES: +:CREATED: %U +:END:")) + (setf (map-elt org-capture-templates "d") + '("A simple DONE item" entry (file "") "* DONE %? +:PROPERTIES: +:CREATED: %U +:END:")) + (setf (map-elt org-capture-templates "n") + '("A simple note" entry (file "") "* Note taken on %U +:PROPERTIES: +:CREATED: %U +:END: + +%?")) + (setf (map-elt org-capture-templates "N") + '("A simple note (on current task)" item (clock) "- Note taken on %U: \\\\ + %?")) + (setf (map-elt org-capture-templates "r") + '("An Operational Request came in" entry (file "") "* TODO Operation Request %^U +:PROPERTIES: +:CREATED: %U +:END: + +%c"))) + +(use-package consult-yasnippet + :vc (:url "https://git.sr.ht/~ryuslash/consult-yasnippet" + :rev :newest)) + +(use-package oni-paredit + :after paredit) + +(use-package paredit + :hook fennel-mode) + +(use-package oni-core) + +(use-package oni-outline + :after outline) + +(use-package terraform-mode) + +(use-package oni-dired + :ensure t + :after dired) + +(use-package docker-compose-mode + :ensure t + :mode (rx "docker-compose.yml" eos)) + +(use-package oni-corfu + :ensure t + :after corfu) + +(use-package corfu + :hook (docker-compose-mode typescript-ts-mode tsx-ts-mode) + :config + (setq corfu-auto t)) + +(use-package treesit + :if (and (functionp 'treesit-available-p) + (treesit-available-p)) + :defer t + :ensure nil + :config + (setq treesit-language-source-alist + '((yaml "https://github.com/ikatyang/tree-sitter-yaml") + (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") + (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") + (php "https://github.com/tree-sitter/tree-sitter-php" "master" "php/src"))) + (when (treesit-ready-p 'yaml) + (add-to-list 'major-mode-remap-alist '(yaml-mode . yaml-ts-mode))) + (when (treesit-ready-p 'typescript) + (add-to-list 'major-mode-remap-alist '(typescript-mode . typescript-ts-mode))) + (when (treesit-ready-p 'tsx) + (add-to-list 'auto-mode-alist (cons (rx ".tsx" eos) 'tsx-ts-mode)))) + +(use-package electric-pair-mode + :hook (((tsx-ts-mode typescript-ts-mode dockerfile-mode) . electric-pair-local-mode))) + +(use-package rainbow-delimiters + :ensure t + :hook prog-mode) + +(use-package display-fill-column-indicator + :hook prog-mode) + +(use-package files + :ensure nil + :config + (add-to-list 'lock-file-name-transforms (list ".*" (expand-file-name "data/lock-files/" user-emacs-directory) t))) + +(use-package subword + :ensure nil + :hook (php-mode typescript-ts-mode tsx-ts-mode)) + +(use-package combobulate + :ensure t + :vc (:url "https://github.com/mickeynp/combobulate" + :rev :latest) + :hook tsx-ts-mode + :config + (setq combobulate-prefix "C-c o")) + +(use-package grep + :config + (require 'find-dired) + + (add-to-list 'grep-files-aliases '("msbuild" . "*.targets *.proj")) + (add-to-list 'grep-files-aliases '("typescript" . "*.ts *.tsx *.js *.jsx *.json")) + (add-to-list 'grep-files-aliases '("vue" . "*.vue *.js *.jsx *.json")) + + (when (eq system-type 'windows-nt) + (setq find-program (shell-quote-argument "c:/cygwin64/bin/find.exe")) + (setq grep-program (shell-quote-argument "c:/cygwin64/bin/grep.exe")) + (setq grep-use-null-device nil) + + (let ((exe (shell-quote-argument "c:/cygwin64/bin/ls.exe"))) + (setq find-ls-option + (cons (concat "-exec " exe " -ld {} \";\"") "-ld")))) + + (setf (map-elt display-buffer-alist (rx bos "*grep*" eos)) + '(display-buffer-in-side-window + (side . bottom) + (slot . 0) + (window-height . 0.33))) + + (add-to-list 'grep-find-ignored-directories ".cask") + + (add-hook 'grep-mode-hook 'hl-line-mode)) + +(use-package eglot + :if (eq system-type 'darwin) + :ensure-system-package (harper-ls . harper) + :hook (org-mode . eglot) + :config + (add-to-list 'eglot-server-programs + '(org-mode . ("harper-ls" "--stdio")))) + +(dir-locals-set-directory-class (expand-file-name "~/code/diamond-interactive/sweepstakes-frontend") 'sweepstakes-frontend) + +(dir-locals-set-class-variables + 'sweepstakes-frontend + '((nil . ((grep-find-ignored-directories . ("apps/*/.next" "node_modules" ".pnpm-store")))))) + +(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) +(load custom-file) + +(provide 'init) +;;; init.el ends here diff --git a/_mbsetupuser/Brewfile.org b/_mbsetupuser/Brewfile.org index f2cf741..9ad2863 100644 --- a/_mbsetupuser/Brewfile.org +++ b/_mbsetupuser/Brewfile.org @@ -29,18 +29,35 @@ Then I need some things for configuration and development purposes: - git :: Version control system that I use. - stow :: Mainly used with this repository, "installs" configuration files by making and maintaining symbolic links. - make :: The bundled version with macos is really old and doesn't support some of the features that I use. -- tailscale :: Mesh VPN that lets me connect to my self-hosted services like music streaming. +- tailscale-app :: Mesh VPN that lets me connect to my self-hosted services like music streaming. - hammerspoon :: Automation framework like AutoHotKey for Windows. But different. - fennel :: Fennel is a lisp -> lua compiler, it allows me to write lua config (like Wezterm and Hammerspoon) in lisp. +- zplug :: A plug-in manager for ZSH. +- atuin :: Shell history completion on steroids. +- bettercmdtab :: Trying out this program that lets me have a better experience switching windows. #+begin_src ruby brew "git" brew "stow" - brew "make" cask "tailscale-app" cask "hammerspoon" brew "fennel" + brew "zplug" + brew "atuin" + cask "bettercmdtab" +#+end_src + +Install make because the bundled version is really old and doesn't support some of the features that I used. Surprisingly it /is/ GNU make, not BSD make that's installed. + +#+begin_src ruby + brew "make" +#+end_src + +This requires an alias in ZSH to make sure that the newly installed make is actually used. + +#+begin_src sh :tangle .config/zsh/conf.d/macos.sh + alias make=gmake #+end_src And there are some development projects that I need to be able to install. @@ -75,9 +92,33 @@ Fonts too! cask "font-dosis" #+end_src -I also created my own tap: +I also created my own tap for SCSH: #+begin_src ruby tap "ryuslash/scsh", "https://git.sr.ht/~ryuslash/homebrew-scsh", trusted: true brew "scsh" #+end_src + +Flameshot, for easier screenshot taking. Aside from installing through Homebrew this needs some extra work to be enabled. If I try to start it it will be blocked, but after that I have to go into System Settings -> Privacy & Security, and then scroll down to the line that says that Flameshot was blocked, and then allow it. Then I can use it. + +#+begin_src ruby + cask "flameshot" +#+end_src + +Install the coreutils packages because the BSD alternatives that MacOS comes with are very disappointing. + +#+begin_src ruby + brew "coreutils" +#+end_src + +This requires some aliases to actually work, otherwise the bundled versions get referenced instead. + +#+begin_src sh :tangle .config/zsh/conf.d/macos.sh + alias ls="gls --color=always" +#+end_src + +Install wakatime-cli so I can track my personal coding times. + +#+begin_src ruby + brew "wakatime-cli" +#+end_src diff --git a/atuin/.config/atuin/config.toml b/atuin/.config/atuin/config.toml new file mode 100644 index 0000000..54af460 --- /dev/null +++ b/atuin/.config/atuin/config.toml @@ -0,0 +1,36 @@ +inline_height = 20 +filter_mode = "directory" +history_filter = [ + "^ +", +] +enter_accept = true +sync_address = "http://phoenix.fold-kanyu.ts.net:8888" +search_mode = "skim" + +[stats] +common_subcommands = [ + "guix", + "guix home", + "nala", + "apt", + "cargo", + "composer", + "dnf", + "docker", + "docker-compose", + "docker compose", + "git", + "go", + "ip", + "kubectl", + "nix", + "nmcli", + "npm", + "pecl", + "pnpm", + "podman", + "port", + "systemctl", + "tmux", + "yarn" +] diff --git a/atuin/.config/zsh/conf.d/atuin.sh b/atuin/.config/zsh/conf.d/atuin.sh new file mode 100644 index 0000000..13eefe6 --- /dev/null +++ b/atuin/.config/zsh/conf.d/atuin.sh @@ -0,0 +1,3 @@ +eval "$(atuin init zsh)" +bindkey -M emacs '^p' atuin-up-search +bindkey -M emacs '^[p' atuin-up-search @@ -0,0 +1 @@ +hide=1 @@ -1,6 +1,8 @@ (add-to-load-path (dirname (current-filename))) -(system* "make" "new-dotfiles") +(define hostname (gethostname)) + +(system* "make" hostname) (load-from-path "secrets.scm") -(load-from-path (string-append "oni/home/config/" (gethostname) ".scm")) +(load-from-path (string-append "oni/home/config/" hostname ".scm")) diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index ab3d120..71ca9cc 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -6,13 +6,13 @@ First, lexical binding must be enabled. This is better for performance, but also ;; -*- lexical-binding: t; -*- #+end_src -Switch prompts for “yes” or “no” to “y” or “n”. +Switch prompts for “yes” or “no” to “y” or “n”. It's not recommended to do this because it's very easy to accidentally press either single character when you don't realize Emacs is asking you for a confirmation, but in practice I've had no issues with this. At worst I've said “no” to saving a file before doing something a few times. #+begin_src emacs-lisp (defalias 'yes-or-no-p 'y-or-n-p) #+end_src -sStore all auto-save files in =$XDG_DATA_HOME/emacs/auto-save-list= and backup files in =$XDG_DATA_HOME/emacs/backup-files= to prevent them from clogging up =$XDG_CONFIG_HOME/emacs/=. The XDG specification says that if =XDG_DATA_HOME= hasn't specified a default of =~/.local/share= should be used. +Store all auto-save files in =$XDG_DATA_HOME/emacs/auto-save-list= and backup files in =$XDG_DATA_HOME/emacs/backup-files= to prevent them from clogging up =$XDG_CONFIG_HOME/emacs/=. The XDG specification says that if =XDG_DATA_HOME= hasn't specified a default of =~/.local/share= should be used. #+begin_src emacs-lisp (defun oni-core-data-dir (file) @@ -63,13 +63,15 @@ Now that I can check whether or not I'm typing a word, I can tell =electric-quot So now that that's settled, I should be writing ='= in words like “shouldn't'' and =’= otherwise. And spellchecking should work just fine. -Add MELPA to package archives, this lets me install more packages. +Add MELPA to package archives, this lets me install more packages. Also my own oni archive, which contains most of my configuration variables. #+begin_src emacs-lisp - (eval-and-compile - (use-package package - :config - (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t))) + (use-package package + :if (eq system-type 'darwin) + :demand t + :config + (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) + (add-to-list 'package-archives '("oni" . "https://ryuslash.srht.site/emacs-config/packages/"))) #+end_src Make use-package default to ensuring everything. This way each =use-package= doesn't need to have its own ~:ensure t~ and when I use Guix to install these modules they don't try to download everything from everywhere else. @@ -152,6 +154,13 @@ Lua is mainly used by wezterm right now. (use-package markdown-mode) #+end_src +Also install =markdown-indent-mode= which is very much like =org-indent-mode= (built-in), but for Markdown. + +#+begin_src emacs-lisp + (use-package markdown-indent-mode + :hook markdown-mode) +#+end_src + * Org Mode #+begin_src emacs-lisp @@ -231,7 +240,16 @@ It bugs me to have whitespace left over. * Consult #+begin_src emacs-lisp - (use-package consult) + (use-package consult + :bind (("M-g M" . consult-global-mark) + ("M-g m" . consult-mark) + ([remap bookmark-jump] . consult-bookmark) + ([remap goto-line] . consult-goto-line) + ([remap imenu] . consult-imenu) + ([remap project-switch-to-buffer] . consult-project-buffer) + ([remap projectile-switch-to-buffer] . consult-project-buffer) + ([remap switch-to-buffer] . consult-buffer) + ([remap yank-pop] . consult-yank-pop))) #+end_src * Diff-hl @@ -274,7 +292,19 @@ Highlight diffs in the fringe. #+begin_src emacs-lisp (use-package ace-window :bind (("M-o" . ace-window) - ("C-x o"))) + ("C-x o")) + :custom-face + (aw-leading-char-face ((t (:foreground "#222424" :background "#ff9800")))) + :custom + (aw-keys '(?a ?r ?s ?t ?n ?e ?i ?o)) + :config + (defun oni-core-ace-window-select-other-window (window) + "Use ‘ace-window’ to select which window is considered “other”." + (interactive) + (setq other-window-scroll-buffer window)) + + (ace-window-posframe-mode) + (add-to-list 'aw-dispatch-alist '(?O oni-core-ace-window-select-other-window "Select window to be \"other\""))) #+end_src * Rest @@ -645,20 +675,9 @@ Highlight diffs in the fringe. (marginalia-mode) - ;;; Consult - (global-set-key (kbd "C-c w d") '("Delete a window" . ace-delete-window)) (global-set-key (kbd "C-c w k") '("Keep a single window" . ace-delete-other-windows)) (global-set-key (kbd "C-c w o") '("Select other window" . oni-core-ace-window-select-other-window)) - (global-set-key (kbd "M-g M") '("Jump to a mark anywhere" . consult-global-mark)) - (global-set-key (kbd "M-g m") '("Jump to a mark" . consult-mark)) - (global-set-key [remap bookmark-jump] 'consult-bookmark) - (global-set-key [remap goto-line] 'consult-goto-line) - (global-set-key [remap imenu] 'consult-imenu) - (global-set-key [remap project-switch-to-buffer] 'consult-project-buffer) - (global-set-key [remap projectile-switch-to-buffer] 'consult-project-buffer) - (global-set-key [remap switch-to-buffer] 'consult-buffer) - (global-set-key [remap yank-pop] 'consult-yank-pop) (global-set-key (kbd "C-x 8 l") "λ") @@ -811,7 +830,8 @@ Highlight diffs in the fringe. * Rainbow Delimiters #+begin_src emacs-lisp - (use-package rainbow-delimiters) + (use-package rainbow-delimiters + :hook (php-mode emacs-lisp-mode)) #+end_src * Mixed Pitch Mode @@ -844,3 +864,135 @@ Change the file where =customize= stores its settings. :config (add-to-list 'orderless-matching-styles 'orderless-initialism)) #+end_src + +* Org-Caldav + +This allows me to synchronize tasks and events between my phone and Emacs. + +#+begin_src emacs-lisp + (use-package org-caldav + :config + (setq org-caldav-url "https://phoenix.fold-kanyu.ts.net/" + org-caldav-calendar-id "tom/196e7d47-b820-a12a-c902-113871fcade7" + org-caldav-inbox "~/documents/personal.org" + org-caldav-files nil + org-icalendar-timezone "America/Vancouver" + org-icalendar-include-todo 'all + org-caldav-sync-todo t + org-caldav-todo-percent-states '((0 "TODO") (1 "NEXT") (100 "DONE")))) +#+end_src + +* Wakatime + +I run my own [[https://wakapi.dev/][Wakapi]] instance to track my coding time. + +#+begin_src emacs-lisp + (use-package wakatime-mode + :init + (global-wakatime-mode) + :custom + (wakatime-cli-path "/opt/homebrew/bin/wakatime-cli")) +#+end_src + +* Directory-locals + +This is the definition of directory-local variables for the new Punt front-end. + +#+begin_src emacs-lisp + (use-package files + :ensure nil + :config + (dir-locals-set-class-variables + 'sweepstakes-frontend + '((nil . ((grep-find-ignored-directories + . ("apps/*/.next" "node_modules" ".pnpm-store")))))) + + (dir-locals-set-directory-class + (expand-file-name "~/code/diamond-interactive/sweepstakes-frontend") + 'sweepstakes-frontend)) +#+end_src + +Now the pull app. + +#+begin_src emacs-lisp + (use-package files + :ensure nil + :config + (dir-locals-set-class-variables + 'pull-app + '((nil . ((grep-find-ignored-directories + . ("node_modules")))))) + + (dir-locals-set-directory-class + (expand-file-name "~/code/diamond-interactive/pull-app") + 'pull-app)) +#+end_src + +* Eglot + +Set up a server program for Eglot for org-mode. + +#+begin_src emacs-lisp + (use-package eglot + :if (eq system-type 'darwin) + :ensure-system-package (harper-ls . harper) + :config + (add-to-list 'eglot-server-programs + '(org-mode . ("harper-ls" "--stdio")))) +#+end_src + +* Minions + +Hide all of my minor modes in a single menu item. + +#+begin_src emacs-lisp + (use-package minions + :init + (minions-mode)) +#+end_src + +* Corfu + +This is a modern in-buffer completion framework that works a little more nicely with internal existing tools in Emacs than Company does. I've used company for years and it was a big improvement over the previous autocomplete, but now I'm trying this out. + +This includes cape for extra completion-at-point functions, and corfu-prescient to show the selected option in the buffer. + +#+begin_src emacs-lisp + (use-package corfu + :config + (setq corfu-auto t)) + + (use-package cape + :init + (add-to-list 'completion-at-point-functions 'cape-abbrev) + (add-to-list 'completion-at-point-functions 'cape-dabbrev) + (add-to-list 'completion-at-point-functions 'cape-file)) + + (use-package corfu-prescient + :hook (corfu-mode)) +#+end_src + +* Golden Ratio + +This package automatically adjusts your window sized to follow the golden ratio, so that the focused one is always the biggest. + +#+begin_src emacs-lisp + (use-package golden-ratio + :init + (golden-ratio-mode) + :config + (with-eval-after-load 'ace-window + (advice-add 'ace-window :after #'golden-ratio)) + (add-to-list 'golden-ratio-exclude-modes 'calculator-mode)) +#+end_src + +This configuration adds advice after the =ace-window= command to make sure that switching with it still properly configures the window sizes. + +* Phel + +Phel is a Clojure-inspired lisp that compiles to PHP. + +#+begin_src emacs-lisp + (use-package phel-mode + :mode (rx ".phel" eos)) +#+end_src diff --git a/emacs/.emacs.d/oni-display-fill-column-indicator.el b/emacs/.emacs.d/oni-display-fill-column-indicator.el new file mode 100644 index 0000000..fe07fdf --- /dev/null +++ b/emacs/.emacs.d/oni-display-fill-column-indicator.el @@ -0,0 +1,8 @@ +;; Start of oni-display-fill-column-indicator + +(use-package display-fill-column-indicator + :ensure nil + :hook (yaml-ts-mode + prog-mode)) + +;; End of oni-display-fill-column-indicator diff --git a/emacs/.emacs.d/oni-flycheck.el b/emacs/.emacs.d/oni-flycheck.el index 6ee6a19..84f0088 100644 --- a/emacs/.emacs.d/oni-flycheck.el +++ b/emacs/.emacs.d/oni-flycheck.el @@ -1,6 +1,8 @@ ;; Start of oni-flycheck (use-package flycheck + :hook (php-mode + yaml-ts-mode) :config (require 'flycheck-posframe) diff --git a/emacs/.emacs.d/oni-sops.el b/emacs/.emacs.d/oni-sops.el new file mode 100644 index 0000000..9a0936f --- /dev/null +++ b/emacs/.emacs.d/oni-sops.el @@ -0,0 +1,7 @@ +;; Oni-sops starts here + +(use-package sops + :init + (global-sops-mode)) + +;; Oni-sops ends here diff --git a/emacs/.emacs.d/oni-treesit.el b/emacs/.emacs.d/oni-treesit.el new file mode 100644 index 0000000..8ce2839 --- /dev/null +++ b/emacs/.emacs.d/oni-treesit.el @@ -0,0 +1,10 @@ +;; Start of oni-treesit + +(use-package treesit + :defer t + :ensure nil + :config + (setq treesit-language-source-alist + '((yaml "https://github.com/ikatyang/tree-sitter-yaml")))) + +;; End of oni-treesit diff --git a/emacs/.emacs.d/oni-typescript.el b/emacs/.emacs.d/oni-typescript.el new file mode 100644 index 0000000..7792cd3 --- /dev/null +++ b/emacs/.emacs.d/oni-typescript.el @@ -0,0 +1,5 @@ +;; Start of oni-typescript + +(use-package typescript-mode) + +;; End of oni-typescript diff --git a/emacs/.emacs.d/oni-wgrep.el b/emacs/.emacs.d/oni-wgrep.el new file mode 100644 index 0000000..df9eae9 --- /dev/null +++ b/emacs/.emacs.d/oni-wgrep.el @@ -0,0 +1,5 @@ +;; Oni-wgrep starts here + +(use-package wgrep) + +;; Oni-wgrep ends here diff --git a/emacs/.emacs.d/oni-yaml.el b/emacs/.emacs.d/oni-yaml.el new file mode 100644 index 0000000..56d99b8 --- /dev/null +++ b/emacs/.emacs.d/oni-yaml.el @@ -0,0 +1,34 @@ +;; Start of oni-yaml + +(use-package yaml-ts-mode + :ensure nil + :defer t + :init + (when (and (functionp 'treesit-available-p) + (treesit-available-p) + (require 'treesit) + (treesit-ready-p 'yaml)) + (add-to-list 'major-mode-remap-alist '(yaml-mode . yaml-ts-mode))) + :config + (defun oni-yaml--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + + (defun oni-yaml--enable-hooks (hook) + "Enable all hooks I use for editing yaml files for HOOK." + (add-hook hook 'electric-indent-local-mode) + (add-hook hook 'electric-pair-local-mode) + (add-hook hook 'highlight-indent-guides-mode) + (add-hook hook 'oni-yaml--auto-fill-mode) + (add-hook hook 'yaml-imenu-enable) + (add-hook hook 'yaml-pro-mode) + (add-hook hook 'flycheck-mode)) + + (define-key yaml-ts-mode-map (kbd "C-c >") 'indent-tools-hydra/body) + + (oni-yaml--enable-hooks 'yaml-mode-hook)) + +(use-package yaml-pro) + +;; End of oni-yaml diff --git a/glide/.config/glide/glide.ts b/glide/.config/glide/glide.ts index af5d1bf..48430db 100644 --- a/glide/.config/glide/glide.ts +++ b/glide/.config/glide/glide.ts @@ -16,7 +16,10 @@ // // Try typing `glide.` and see what you can do! +glide.g.mapleader = "<C-c>"; + glide.o.hint_size = "15pt"; +glide.o.hint_chars = "arstneio"; glide.prefs.set("ui.key.menuAccessKeyFocuses", false); glide.prefs.set("sidebar.verticalTabs", true); diff --git a/hammerspoon/.hammerspoon/init.fnl b/hammerspoon/.hammerspoon/init.fnl new file mode 100644 index 0000000..fa9045f --- /dev/null +++ b/hammerspoon/.hammerspoon/init.fnl @@ -0,0 +1,120 @@ +(fn show-window-information [] + (let [window (hs.window.focusedWindow)] + (if (= window nil) + (hs.alert.show "no window") + (hs.alert.show (.. "Title: " (window:title) "\n" + "Application: " (: (window:application) :name)))))) + +(hs.hotkey.bind ["cmd" "alt" "ctrl"] "e" show-window-information) +(hs.hotkey.bind ["cmd" "shift"] "r" hs.reload) +(hs.hotkey.bind ["cmd"] "l" hs.caffeinate.startScreensaver) + +(fn make-config-path-watcher [] + (hs.pathwatcher.new + (.. (os.getenv "HOME") + "/code/personal/dotfiles/hammerspoon/.hammerspoon") + (fn [] (print "Reload!") (hs.reload)))) + +(let [watcher (make-config-path-watcher)] + (watcher:start)) + +;;; Layout -- Automatically put windows in their place. + +(fn apply-layout [] + (let [my-screen (hs.screen.primaryScreen) + screen-mode (: my-screen :currentMode) + geom [(. screen-mode "w") (. screen-mode "h")] + max (. hs "layout" "maximized")] + (case geom + [3440 1440] (hs.layout.apply + [["Emacs" nil nil (. hs "layout" "left70") nil nil] + ["WezTerm" nil nil (. hs "layout" "right30") nil nil] + ["Glide" nil nil max nil nil]]) + + [5120 1440] (hs.layout.apply + [["Glide" nil nil (. hs "layout" "left25") nil nil] + ["Emacs" nil nil (hs.geometry.rect 0.25 0 0.5 1) nil nil] + ["WezTerm" nil nil (. hs "layout" "right25") nil nil]]) + + _ (hs.layout.apply + [["Glide" nil nil max nil nil] + ["Emacs" nil nil max nil nil] + ["WezTerm" nil nil max nil nil]])))) + +(fn make-application-watcher [] + (fn match-application [name event-type application] + (when (and (= event-type (. hs :application :watcher :launched)) + (or (= name "Emacs") + (= name "WezTerm") + (= name "Glide"))) + (apply-layout))) + (hs.application.watcher.new match-application)) + +(fn make-screen-watcher [] + (hs.screen.watcher.new apply-layout)) + +(apply-layout) + +(let [watcher (make-application-watcher)] + (watcher:start)) +(let [watcher (make-screen-watcher)] + (watcher:start)) + +;;; Mouse -- Automatically set primary button based on mouse connected. + +(fn set-mouse-buttons! [swap?] + (let [task (hs.task.new + "/usr/bin/defaults" nil [] + ["-currentHost" + "write" + ".GlobalPreferences" + "com.apple.mouse.swapLeftRightButton" + "-bool" + (tostring swap?)])] + (task:start) + (task:waitUntilExit)) + (print (.. "Changed mouse button to: " (if swap? "left" "right")))) + +(fn make-mouse-watcher [] + (fn match-device [{:eventType event-type :productName name}] + (let [connected? (= event-type "added")] + (print (.. "Device " (if connected? "" "dis") "connected: " name)) + (when (= name "USB Optical Mouse") + (set-mouse-buttons! connected?)))) + (hs.usb.watcher.new match-device)) + +(fn mouse-connected? [] + (fn find-mouse-device [devices] + (if (= (next devices) nil) + false + (let [device (table.remove devices 1)] + (if (= (. device "productName") "USB Optical Mouse") + true + (tail! (find-mouse-device devices)))))) + (find-mouse-device (hs.usb.attachedDevices))) + +(set-mouse-buttons! (mouse-connected?)) + +(let [watcher (make-mouse-watcher)] + (watcher:start)) + +;;; Fennel Repl +;; From https://linktohack.com/posts/a-fennel-repl-for-hammer-spoon/ + +(local fennel (require :fennel)) + +(let [coro (coroutine.create (. fennel :repl :repl))] + (coroutine.resume coro {:readChunk (fn [] + (let [input (coroutine.yield)] + (.. input "\n"))) + :onValues (fn [xs] + (print (table.concat xs "\t"))) + :onError (fn [_ msg] + (print msg))}) + (set hs._consoleInputPreparser (fn [s] + (coroutine.resume coro s) + ""))) + +;;; Done + +(hs.alert.show "Loaded!" [] (hs.screen.primaryScreen) 0.5) diff --git a/hammerspoon/.hammerspoon/init.lua b/hammerspoon/.hammerspoon/init.lua new file mode 100644 index 0000000..b21f91a --- /dev/null +++ b/hammerspoon/.hammerspoon/init.lua @@ -0,0 +1,6 @@ +if hs.fs.displayName("fennel.lua") == nil then + print("Downloading fennel") + os.execute("curl -o fennel.lua https://fennel-lang.org/downloads/fennel-1.6.1.lua") +end + +require("fennel").install().dofile('init.fnl') diff --git a/oni/home/config/common.scm b/oni/home/config/common.scm index 2b52f58..f762de5 100644 --- a/oni/home/config/common.scm +++ b/oni/home/config/common.scm @@ -243,7 +243,6 @@ LocalForward 19999 localhost:19999")) "autoload -U $HOME/.zsh/functions/*(:t)\n" "alias csi=\"rlwrap csi\"\n" "alias scsh=\"rlwrap scsh\"\n" - "alias sbcl=\"rlwrap sbcl\"\n" "alias hc=herbstclient\n" "alias reco=\"pushd ~/projects/new-dotfiles/ && guix home reconfigure config.scm; popd\"\n" "setopt SHARE_HISTORY\n" diff --git a/oni/home/config/data.scm b/oni/home/config/data.scm index 6636ab3..38ae590 100644 --- a/oni/home/config/data.scm +++ b/oni/home/config/data.scm @@ -23,6 +23,7 @@ #:use-module (oni home services emacs) #:use-module (oni home services environment) #:use-module (oni home services git) + #:use-module (oni home services guile-xyz) #:use-module (oni home services kdeconnect) #:use-module ((oni home services mail) #:select (home-mbsync-service-type)) @@ -32,7 +33,8 @@ #:select (emacs-outli emacs-syncthing-status)) #:use-module (oni packages emacs-config) - #:use-module (oni packages pick-random-wallpaper)) + #:use-module (oni packages pick-random-wallpaper) + #:use-module (oni home services lisp)) (home-environment (packages (append @@ -49,54 +51,61 @@ "emacs-geiser-hoot" "wayland" "emacs-org-journal" - "emacs-nginx-mode")) + "emacs-nginx-mode" + "emacs-fennel-mode" + "fennel-ls" + "fnlfmt" + "emacs-org-caldav")) (list - pick-random-wallpaper - emacs-org-contacts - emacs-syncthing-status - emacs-outli - emacs-guix + pick-random-wallpaper + emacs-org-contacts + emacs-syncthing-status + emacs-outli + emacs-guix - emacs-oni-vterm - emacs-oni-elisp - emacs-oni-core - emacs-oni-eshell - emacs-oni-compilation - emacs-oni-common-lisp - emacs-oni-gui - emacs-oni-magit - emacs-oni-project - emacs-oni-bookmark - emacs-oni-dired - emacs-oni-browse-url - emacs-oni-c - emacs-oni-conf - emacs-oni-css - emacs-oni-diff-hl - emacs-oni-ediff - emacs-oni-embrace - emacs-oni-eww - emacs-oni-grep - emacs-oni-highlight-indent-guides - emacs-oni-html - emacs-oni-json - emacs-oni-log-edit - emacs-oni-lua - emacs-oni-makefile - emacs-oni-nxml - emacs-oni-package - emacs-oni-projectile - emacs-oni-scheme - emacs-oni-sh - emacs-oni-shr - emacs-oni-tramp - emacs-oni-git-commit - emacs-oni-python - emacs-oni-yaml - emacs-oni-gnus - emacs-oni-elfeed + (emacs-oni-org emacs-pgtk) + emacs-oni-vterm + emacs-oni-elisp + emacs-oni-core + emacs-oni-eshell + emacs-oni-compilation + emacs-oni-common-lisp + emacs-oni-gui + emacs-oni-magit + emacs-oni-project + emacs-oni-bookmark + emacs-oni-dired + emacs-oni-browse-url + emacs-oni-c + emacs-oni-conf + emacs-oni-css + emacs-oni-diff-hl + emacs-oni-ediff + emacs-oni-embrace + emacs-oni-eww + emacs-oni-grep + emacs-oni-highlight-indent-guides + emacs-oni-html + emacs-oni-json + emacs-oni-log-edit + emacs-oni-lua + emacs-oni-makefile + emacs-oni-nxml + emacs-oni-package + emacs-oni-projectile + emacs-oni-scheme + emacs-oni-sh + emacs-oni-shr + emacs-oni-tramp + emacs-oni-git-commit + emacs-oni-python + emacs-oni-yaml + emacs-oni-gnus + emacs-oni-elfeed + emacs-oni-yasnippet + emacs-oni-sendmail - gforth))) + gforth))) (services (append @@ -133,6 +142,7 @@ (package emacs-pgtk) (configurations (list + (local-file "../../../emacs/.emacs.d/init.el") (local-file "../services/emacs/init.el") (mixed-text-file "init.el" @@ -150,7 +160,6 @@ (org-mode-key "C-S-e"))) (service home-emacs-golden-ratio-service-type) (service home-emacs-pinentry-service-type) - (service home-emacs-org-caldav-service-type) (service home-emacs-org-mem-service-type) (service home-mbsync-service-type) @@ -176,4 +185,11 @@ (home-wakatime-configuration (api-url "https://waka.ryuslash.org/api") (exclude '("COMMIT_EDITMSG$" - "TAG_EDITMSG$")))))))) + "TAG_EDITMSG$")))) + + (service home-guile-swayer-service-type + (home-guile-swayer-configuration + (extra-config + (list + (local-file "../../../sway/.config/sway/init.scm"))))) + (service home-sbcl-service-type))))) diff --git a/oni/home/config/pop-os/emacs.el b/oni/home/config/pop-os/emacs.el index ffd0c79..241bf5e 100644 --- a/oni/home/config/pop-os/emacs.el +++ b/oni/home/config/pop-os/emacs.el @@ -106,7 +106,7 @@ connector." (containers '(("chanced" . "chanced-backend") ("punt" . "punt-backend") ("filament" . "chanced-admin-panel")))) - (async-shell-command (format "docker exec -it %s composer install" (map-elt containers b)) + (async-shell-command (format "docker exec -it %s composer install --no-interaction --no-progress" (map-elt containers b)) (get-buffer-create (format "*%s-composer*" (upcase b)))))) (if (string= brand "all") '("chanced" "punt" "filament") (list brand)))) @@ -129,10 +129,11 @@ connector." (let ((default-directory (expand-file-name "punt" (project-root (project-current))))) (async-shell-command "docker exec -it punt-backend php artisan migrate"))) -(defun artisan-chanced-migrate () - (interactive) +(defun artisan-chanced-migrate (&optional reverse?) + (interactive "P") (let ((default-directory (expand-file-name "chanced" (project-root (project-current))))) - (async-shell-command "docker exec -it chanced-backend php artisan migrate"))) + (async-shell-command (concat "docker exec -it chanced-backend php artisan migrate" + (if reverse? ":rollback" ""))))) ;; (transient-define-prefix artisan-test-transient () ;; "Artisan Test." @@ -260,55 +261,6 @@ Optional argument STOPP means stop on any defect." (list (oni-read-brand))) (artisan-run-test-at-point name t)) -;; (defun artisan--test-internal (pick name ignore fail test-at-point-p) -;; (let* ((default-directory (expand-file-name name (project-root (project-current)))) -;; (buffer-name (format "*%s Tests*" (capitalize name))) -;; (buffer (get-buffer-create buffer-name)) -;; (state ((with-current-buffer buffer -;; artisan--test-last-state))) -;; (filter (or (map-elt state 'filter) -;; (when test-at-point-p (which-function)))) -;; (files (unless (map-elt state 'file) -;; (cons '("all" . "") -;; (mapcar (lambda (dir) (cons (file-name-nondirectory dir) dir)) -;; (directory-files-recursively "../" (rx "Test.php") nil (lambda (subdir) (not (or (string-suffix-p "vendor" subdir) -;; (string-suffix-p "data" subdir) -;; (string-suffix-p "cdk.out" subdir) -;; (string-suffix-p ignore subdir))))))))) -;; (file (or (and (not pick) -;; (map-elt state 'file)) -;; (and test-at-point-p -;; (concat "../" (file-relative-name (buffer-file-name) (project-root (project-current))))) -;; (map-elt files (completing-read "File: " files nil t)))) -;; (command (with-current-buffer buffer -;; (format "../../chanced-scripts/test %s %s %s %s" -;; name -;; (if fail "--stop-on-failure" "") -;; (if filter (format "--filter=%s" filter) "") -;; file))) -;; (compilation-scroll-output t)) -;; (cl-letf (((symbol-function 'compilation-buffer-name) -;; (lambda (&rest _) buffer-name))) -;; (compile command)) -;; (with-current-buffer buffer -;; (setq artisan--test-last-state -;; `((file . ,file) -;; (filter . ,filter))) -;; (local-set-key (kbd "g") -;; (lambda () -;; (interactive) -;; (artisan--test-internal nil name ignore fail))) -;; (local-set-key (kbd "q") #'bury-buffer) -;; (local-set-key (kbd "s") (lambda () (interactive) (interrupt-process))) -;; (local-set-key (kbd "M-p") (lambda () -;; (interactive) -;; (forward-line -1) -;; (search-backward " •"))) -;; (local-set-key (kbd "M-n") (lambda () -;; (interactive) -;; (forward-line) -;; (search-forward " •")))))) - (transient-define-prefix artisan-make-migration-transient () "Make migration." @@ -403,10 +355,6 @@ Optional argument STOPP means stop on any defect." (find-file good-file-name) (vc-register))) -(setq browse-url-browser-function #'browse-url-generic) -(setq browse-url-generic-args nil) -(setq browse-url-generic-program "~/Downloads/glide/glide") - (defun oni-fixup-phpstan-filenames (errors) "Change the file name from each error in ERRORS to one on local disk." (mapcar diff --git a/oni/home/config/rincewind.scm b/oni/home/config/rincewind.scm index 357bafa..42828f8 100644 --- a/oni/home/config/rincewind.scm +++ b/oni/home/config/rincewind.scm @@ -1,199 +1,62 @@ (define-module (oni home config rincewind) - #:use-module ((gnu home) - #:select (home-environment)) + #:use-module (gnu home) #:use-module (gnu home services) - #:use-module ((gnu home services mail) - #:select (home-msmtp-service-type - home-msmtp-configuration - msmtp-configuration - msmtp-account)) - #:use-module ((gnu home services gnupg) - #:select (home-gpg-agent-service-type - home-gpg-agent-configuration)) + #:use-module (gnu home services mail) + #:use-module (gnu home services gnupg) #:use-module (gnu home services shells) - #:use-module ((gnu home services ssh) - #:select (home-ssh-agent-service-type)) - #:use-module ((gnu packages cdrom) - #:select (abcde)) - #:use-module ((gnu packages databases) - #:select (recutils - emacs-rec-mode)) - #:use-module ((gnu packages emacs) - #:select (emacs-next)) - #:use-module ((gnu packages emacs-xyz) - #:select (emacs-guix - emacs-org-contacts - emacs-fennel-mode - emacs-gnuplot)) - #:use-module ((gnu packages file-systems) - #:select (tmsu)) - #:use-module ((gnu packages forth) - #:select (gforth)) - #:use-module ((gnu packages librewolf) - #:select (librewolf)) - #:use-module ((gnu packages mail) - #:select (notmuch - emacs-notmuch)) + #:use-module (gnu home services ssh) + #:use-module (gnu packages cdrom) + #:use-module (gnu packages databases) + #:use-module (gnu packages emacs) + #:use-module (gnu packages emacs-xyz) + #:use-module (gnu packages file-systems) + #:use-module (gnu packages forth) + #:use-module (gnu packages librewolf) + #:use-module (gnu packages mail) #:use-module (gnu packages music) #:use-module (gnu packages perl-web) - #:use-module ((gnu packages tree-sitter) - #:select (tree-sitter-bash - tree-sitter-scheme - tree-sitter-python - tree-sitter-org - tree-sitter-json - tree-sitter-css)) + #:use-module (gnu packages tree-sitter) #:use-module (gnu packages web) - #:use-module ((gnu packages) - #:select (specification->package+output - specification->package)) - #:use-module ((gnu services) - #:select (service - simple-service)) - #:use-module ((guix channels) - #:select (channel - make-channel-introduction - openpgp-fingerprint)) - #:use-module ((guix gexp) - #:select (local-file - mixed-text-file)) + #:use-module (gnu packages) + #:use-module (gnu services) + #:use-module (guix channels) + #:use-module (guix gexp) #:use-module (guix packages) - #:use-module ((guix transformations) - #:select (options->transformation)) - #:use-module ((nongnu packages emacs) - #:select (emacs-org-roam-ui)) + #:use-module (guix transformations) + #:use-module (nongnu packages emacs) #:use-module (oni home config common) - #:use-module ((oni home services copyq) - #:select (home-copyq-service-type)) - #:use-module ((oni home services dunst) - #:select (home-dunst-default-service)) + #:use-module (oni home services copyq) + #:use-module (oni home services dunst) #:use-module (oni home services emacs) - #:use-module ((oni home services environment) - #:select (home-environment-service)) - #:use-module ((oni home services flameshot) - #:select (home-flameshot-service-type)) + #:use-module (oni home services environment) + #:use-module (oni home services flameshot) #:use-module (oni home services freedesktop) - #:use-module ((oni home services git) - #:select (home-git-service-type - home-git-configuration)) - #:use-module ((oni home services gnuzilla) - #:select (home-icecat-service-type - home-icecat-configuration)) - #:use-module ((oni home services kdeconnect) - #:select (home-kdeconnect-service-type)) - #:use-module ((oni home services mpd) - #:select (home-mpd-service-type - home-mpd-configuration - <home-mpd-audio-output> - home-mpc-update-service-type - home-mpd-notify-service-type - home-mpdscrobble-service-type)) - #:use-module ((oni home services mpv) - #:select (home-mpv-service-type - home-mpv-mpris-service-type)) - #:use-module ((oni home services notmuch) - #:select (home-notmuch-service-type - home-notmuch-configuration)) - #:use-module ((oni home services picom) - #:select (home-picom-service-type - home-picom-configuration)) - #:use-module ((oni home services polybar) - #:select (home-polybar-service-type - home-polybar-configuration)) - #:use-module ((oni home services rofi) - #:select (home-rofi-default-service)) - #:use-module ((oni home services stumpwm) - #:select (home-stumpwm-service-type - home-stumpwm-configuration - home-stumpwm-gaps-service-type - home-stumpwm-gaps-configuration - home-stumpwm-stumptray-service-type - home-stumpwm-stumptray-configuration)) - #:use-module ((oni home services syncthing) - #:select (home-syncthing-service-type)) + #:use-module (oni home services git) + #:use-module (oni home services gnuzilla) + #:use-module (oni home services kdeconnect) + #:use-module (oni home services mpd) + #:use-module (oni home services mpv) + #:use-module (oni home services notmuch) + #:use-module (oni home services picom) + #:use-module (oni home services polybar) + #:use-module (oni home services rofi) + #:use-module (oni home services stumpwm) + #:use-module (oni home services syncthing) #:use-module (oni home services terminals) - #:use-module ((oni home services utilities) - #:select (home-inkplate-display-service-type)) - #:use-module ((oni home services zsh) - #:select (home-zsh-syntax-highlighting-service-type - home-zsh-autosuggestions-service-type - home-zsh-autopair-service-type - home-zsh-atuin-service-type - home-zsh-atuin-configuration)) - #:use-module ((oni packages count-emails) - #:select (count-emails)) + #:use-module (oni home services utilities) + #:use-module (oni home services zsh) + #:use-module (oni packages count-emails) #:use-module (oni packages emacs) - #:use-module ((oni packages emacs-config) - #:select (emacs-oni-org-roam - emacs-oni-elfeed - emacs-oni-elisp - emacs-oni-eshell - emacs-oni-core - emacs-oni-compilation - emacs-oni-common-lisp - emacs-oni-gui - emacs-oni-magit - emacs-oni-notmuch - emacs-oni-hy - emacs-oni-project - emacs-oni-bookmark - emacs-oni-dired - emacs-oni-browse-url - emacs-oni-c - emacs-oni-circe - emacs-oni-clojure - emacs-oni-cmake - emacs-oni-conf - emacs-oni-cpp - emacs-oni-csharp - emacs-oni-css - emacs-oni-diff-hl - emacs-oni-ediff - emacs-oni-elm - emacs-oni-emms - emacs-oni-epub - emacs-oni-eww - emacs-oni-grep - emacs-oni-haskell - emacs-oni-highlight-indent-guides - emacs-oni-html - emacs-oni-java - emacs-oni-json - emacs-oni-log-edit - emacs-oni-lua - emacs-oni-makefile - emacs-oni-nxml - emacs-oni-package - emacs-oni-projectile - emacs-oni-scheme - emacs-oni-sh - emacs-oni-shr - emacs-oni-tramp - emacs-oni-embrace - emacs-oni-yaml - emacs-oni-python - emacs-oni-git-commit - emacs-oni-php - emacs-oni-web-mode - emacs-oni-js)) - #:use-module ((oni packages inbox-size) - #:select (inbox-size)) - #:use-module ((oni packages mpd) - #:select (mpd-random-albums)) - #:use-module ((oni packages notmuch-collect-tasks) - #:select (notmuch-collect-tasks)) - #:use-module ((oni packages notmuch-tag-mailinglists) - #:select (notmuch-tag-mailinglists)) - #:use-module ((oni packages pick-random-wallpaper) - #:select (pick-random-wallpaper)) - #:use-module ((oni packages shutdown-rofi) - #:select (shutdown-rofi)) - #:use-module ((oni packages stumpwm) - #:select (stumpwm+swank)) - #:use-module ((oni packages terminals) - #:select (tym)) - #:use-module ((oop goops) - #:select (make))) + #:use-module (oni packages emacs-config) + #:use-module (oni packages inbox-size) + #:use-module (oni packages mpd) + #:use-module (oni packages notmuch-collect-tasks) + #:use-module (oni packages notmuch-tag-mailinglists) + #:use-module (oni packages pick-random-wallpaper) + #:use-module (oni packages shutdown-rofi) + #:use-module (oni packages stumpwm) + #:use-module (oni packages terminals) + #:use-module (oop goops)) (define (with-master-branch package) "Apply a transformation to PACKAGE so that it uses the master branch." @@ -217,7 +80,6 @@ (service home-picom-service-type (home-picom-configuration (backend "glx") - (glx-no-stencil #t) (detect-transient #t) (shadow #t) (shadow-radius 5) diff --git a/oni/home/services/guile-xyz.scm b/oni/home/services/guile-xyz.scm new file mode 100644 index 0000000..5569f3a --- /dev/null +++ b/oni/home/services/guile-xyz.scm @@ -0,0 +1,44 @@ +(define-module (oni home services guile-xyz) + #:use-module (gnu home services) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu services configuration) + #:use-module (guix packages) + #:use-module (guix gexp) + + #:export (home-guile-swayer-service-type + home-guile-swayer-configuration)) + +(define-configuration home-guile-swayer-configuration + (package + (package guile-swayer) + "Package to use for setting Guile-Swayer") + (extra-config + (text-config '()) + "Configuration for sway.")) + +(define (add-guile-swayer-packages config) + (list (home-guile-swayer-configuration-package config))) + +(define (home-guile-swayer-config-files config) + `(("sway/config" + ,(mixed-text-file + "config" + "include /etc/sway/config.d/*\n" + "\n" + "exec_always \"guile ~/.config/sway/init.scm\"\n")) + ("sway/init.scm" + ,(mixed-text-file + "init.scm" + (serialize-text-config config (home-guile-swayer-configuration-extra-config config)))))) + +(define home-guile-swayer-service-type + (service-type (name 'home-guile-swayer) + (extensions + (list (service-extension + home-xdg-configuration-files-service-type + home-guile-swayer-config-files) + (service-extension + home-profile-service-type + add-guile-swayer-packages))) + (default-value (home-guile-swayer-configuration)) + (description "Configure guile-swayer"))) diff --git a/oni/home/services/lisp.scm b/oni/home/services/lisp.scm new file mode 100644 index 0000000..b9b1721 --- /dev/null +++ b/oni/home/services/lisp.scm @@ -0,0 +1,38 @@ +(define-module (oni home services lisp) + #:use-module (gnu home services) + #:use-module (gnu packages lisp) + #:use-module (gnu packages lisp-xyz) + #:use-module (gnu services configuration) + #:use-module (guix packages) + #:use-module (guix gexp) + + #:export (home-sbcl-service-type + home-sbcl-configuration)) + +(define-configuration home-sbcl-configuration + (package + (package sbcl) + "Package to use for setting SBCL") + (linedit-package + (package sbcl-linedit) + "Package for setting up linedit")) + +(define (add-sbcl-packages config) + (list (home-sbcl-configuration-package config) + (home-sbcl-configuration-linedit-package config))) + +(define (home-sbcl-config-files config) + `((".sbclrc" + ,(local-file "../../../sbcl/sbclrc")))) + +(define home-sbcl-service-type + (service-type (name 'home-sbcl) + (extensions + (list (service-extension + home-files-service-type + home-sbcl-config-files) + (service-extension + home-profile-service-type + add-sbcl-packages))) + (default-value (home-sbcl-configuration)) + (description "Configure SBCL"))) diff --git a/oni/home/services/picom.scm b/oni/home/services/picom.scm index 54a3f02..73d8249 100644 --- a/oni/home/services/picom.scm +++ b/oni/home/services/picom.scm @@ -86,9 +86,6 @@ (backend (string "xrender") "Specify the backend to use: xrender, glx, or xr_glx_hybrid") - (glx-no-stencil - (boolean #f) - "GLX backend: avoid using stencil buffer, useful if you don’t have a stencil buffer") (detect-transient (boolean #f) "Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time") diff --git a/oni/packages/emacs-config.scm b/oni/packages/emacs-config.scm index c1ea083..b0a4f27 100644 --- a/oni/packages/emacs-config.scm +++ b/oni/packages/emacs-config.scm @@ -6,6 +6,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages emacs-xyz) #:use-module (gnu packages gnome) + #:use-module (gnu packages lisp) #:use-module (gnu packages llvm) #:use-module (gnu packages cmake) #:use-module (gnu packages bash) @@ -38,7 +39,7 @@ (define-public emacs-oni-config (let - ((commit "59e0a0b53a166d4b1e8d01361a6adf55ad53fa6f") + ((commit "769f1267c051a0d01932cc890506470f55f0e9af") (revision "0")) (package (name "emacs-oni-config") (version (git-version "0.0.1" revision commit)) @@ -47,12 +48,12 @@ (uri (git-reference (url - "git://code.ryuslash.org/emacs-config.git") + "https://git.sr.ht/~ryuslash/emacs-config") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 - "1nsc40z1s7g5gxyqgdm8yqpjrg4qn9c2mykjbk7gdzvdqgfwpzan")))) + "1fglzflwf1zva0cnlrdhsljb4rrqbb5c3wgxacfidhibl9167008")))) (build-system emacs-build-system) (home-page "https://code.ryuslash.org/emacs-config/") (synopsis "My Emacs configuration") @@ -311,7 +312,11 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-yasnippet") (arguments - '(#:include '("oni-yasnippet.el"))) + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'chdir-oni-yasnippet + (λ _ (chdir "oni-yasnippet")))) + #:include '("\\.el$" "^snippets\\/"))) (propagated-inputs `(("emacs-yasnippet" ,emacs-yasnippet) ("emacs-diminish" ,emacs-diminish))) @@ -323,15 +328,10 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-bats") (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-bats - (λ _ (chdir "oni-bats")))) - #:include '("\\.el$" "^snippets\\/bats-mode\\/"))) + '(#:include '("\\.el$"))) (propagated-inputs `(("emacs-bats" ,emacs-bats) ("emacs-oni-sh" ,emacs-oni-sh) - ("emacs-oni-yasnippet" ,emacs-oni-yasnippet) ("bats" ,bats))) (synopsis "My Emacs Bats coding configuration") (description "This package provides my configuration for coding in Bats"))) @@ -346,15 +346,13 @@ Emacs"))) (add-after 'unpack 'chdir-oni-org (λ _ (chdir "oni-org")))) #:include '("\\.el$" - "^snippets\\/org-mode\\/" "^capture-templates\\/" "^icons\\/") ;; The default #:emacs (emacs-minimal) doesn't include `range.el' and ;; throws an error while trying to byte-compile oni-org. #:emacs ,emacs)) (propagated-inputs - (list emacs-oni-yasnippet - emacs-oni-hydra + (list emacs-oni-hydra my-emacs-org-roam emacs-org emacs-org-contrib @@ -429,14 +427,9 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-python") (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-python - (λ _ (chdir "oni-python")))) - #:include '("\\.el$" "^snippets\\/python-mode\\/"))) + '(#:include '("oni-python\\.el$"))) (propagated-inputs - (list emacs-oni-yasnippet - emacs-oni-company + (list emacs-oni-company emacs-oni-flycheck emacs-oni-hydra emacs-oni-lsp @@ -500,7 +493,8 @@ Emacs"))) ("emacs-oni-paredit" ,emacs-oni-paredit) ("emacs-rainbow-delimiters" ,emacs-rainbow-delimiters) ("emacs-slime" ,emacs-slime) - ("emacs-slime-company" ,emacs-slime-company))) + ("emacs-slime-company" ,emacs-slime-company) + ("sbcl" ,sbcl))) (synopsis "My Emacs Common Lisp configuration") (description "This package provides my configuration for Common Lisp"))) @@ -521,14 +515,7 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-conf") (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-conf - (λ _ (chdir "oni-conf")))) - #:include '("\\.el$" - "^snippets\\/conf-mode\\/"))) - (propagated-inputs - `(("emacs-oni-yasnippet" ,emacs-oni-yasnippet))) + '(#:include '("oni-conf\\.el$"))) (synopsis "My Emacs Conf mode configuration") (description "This pakcage provides my configuation for Conf mode"))) @@ -562,16 +549,11 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-csharp") (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-csharp - (λ _ (chdir "oni-csharp")))) - #:include '("\\.el$" "^snippets\\/"))) + '(#:include '("oni-csharp\\.el$"))) (propagated-inputs `(("emacs-csharp-mode" ,emacs-csharp-mode) ("emacs-oni-company" ,emacs-oni-company) ("emacs-oni-flycheck" ,emacs-oni-flycheck) - ("emacs-oni-yasnippet" ,emacs-oni-yasnippet) ("emacs-oni-hydra" ,emacs-oni-hydra) ("emacs-oni-lsp" ,emacs-oni-lsp) ("emacs-oni-smartparens" ,emacs-oni-smartparens))) @@ -583,16 +565,11 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-css") (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-css - (λ _ (chdir "oni-css")))) - #:include '("\\.el$" "^snippets\\/"))) + '(#:include '("oni-css\\.el$"))) (propagated-inputs `(("emacs-oni-company" ,emacs-oni-company) ("emacs-oni-hydra" ,emacs-oni-hydra) - ("emacs-rainbow-mode" ,emacs-rainbow-mode) - ("emacs-oni-yasnippet" ,emacs-oni-yasnippet))) + ("emacs-rainbow-mode" ,emacs-rainbow-mode))) (synopsis "My Emacs CSS configuration") (description "This package provides my configuration for writing CSS."))) @@ -612,16 +589,11 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-elisp") (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-elisp - (λ _ (chdir "oni-elisp")))) - #:include '("\\.el$" "^snippets\\/"))) + '(#:include '("oni-elisp\\.el$"))) (propagated-inputs `(("emacs-oni-company" ,emacs-oni-company) ("emacs-oni-flycheck" ,emacs-oni-flycheck) ("emacs-oni-paredit" ,emacs-oni-paredit) - ("emacs-oni-yasnippet" ,emacs-oni-yasnippet) ("emacs-oni-hydra" ,emacs-oni-hydra) ("emacs-rainbow-delimiters" ,emacs-rainbow-delimiters) ("emacs-nameless" ,emacs-nameless) @@ -678,7 +650,6 @@ Emacs"))) (propagated-inputs (list emacs-hy-mode emacs-oni-paredit - emacs-oni-yasnippet emacs-rainbow-delimiters)) (synopsis "My Hy configuration") (description "This package provides my configuration for Hy."))) @@ -795,13 +766,7 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-html") (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-html - (λ _ (chdir "oni-html")))) - #:include '("\\.el$" "^snippets\\/"))) - (propagated-inputs - (list emacs-oni-yasnippet)) + '(#:include '("oni-html\\.el$"))) (synopsis "My HTML configuration") (description "This package provides my configuration for HTML."))) @@ -865,14 +830,9 @@ Emacs"))) (inherit emacs-oni-config) (name "emacs-oni-nxml") (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir-oni-nxml - (λ _ (chdir "oni-nxml")))) - #:include '("\\.el$" "^snippets\\/"))) + '(#:include '("oni-nxml\\.el$"))) (propagated-inputs - (list emacs-oni-yasnippet - emacs-reformatter)) + (list emacs-reformatter)) (synopsis "My XML configuration") (description "This package provides my configuration for writing XML."))) @@ -970,10 +930,9 @@ Emacs"))) (modify-phases %standard-phases (add-after 'unpack 'chdir-oni-php (λ _ (chdir "oni-php")))) - #:include '("\\.el$" "^snippets\\/" "^scripts\\/"))) + #:include '("\\.el$" "^scripts\\/"))) (propagated-inputs (list emacs-php-mode - emacs-oni-yasnippet emacs-oni-flycheck emacs-oni-corfu emacs-oni-hydra diff --git a/rincewind.org b/rincewind.org index f1fd47d..dc84186 100644 --- a/rincewind.org +++ b/rincewind.org @@ -1,3 +1,5 @@ +* PC Speaker + Disable the PC Speaker because I get annoyed at it beeping at me all the time. #+begin_src conf :tangle "/sudo::/etc/modprobe.d/nobeep.conf" @@ -8,7 +10,7 @@ Disable the PC Speaker because I get annoyed at it beeping at me all the time. Enable the =amdgpu= module because I have an AMD video card. -#+begin_src conf-unix :noweb-ref mkinitcpio-modules +#+begin_src sh :tangle "/sudo::/etc/mkinitcpio.conf.d/amdgpu.conf" MODULES=(amdgpu) #+end_src @@ -16,79 +18,36 @@ Set up the hooks loaded into the image. Use =mkinitcpio -H <MODULE>= to find out - =base= :: Crucial runtime necessities for booting. Should always be included. - =udev= :: Adds the udev daemon to the initramfs to allow dynamic loading of modules and reliable detection of the root device via UUID. -- =autodetect= :: +- =autodetect= :: ??? +- =microcode= :: ??? +- =modconf= :: ??? +- =kms= :: ??? +- =keyboard= :: ??? +- =keymap= :: ??? +- =consolefont= :: ??? +- =block= :: ??? +- =encrypt= :: Decrypt encrypted root drive. +- =filesystems= :: ??? +- =fsck= :: ??? -#+begin_src conf-unix :noweb-ref mkinitcpio-hooks - HOOKS=(base udev autodetect modconf block keymap consolefont encrypt filesystems keyboard fsck) +#+begin_src sh :tangle "/sudo::/etc/mkinitcpio.conf.d/hooks.conf" + HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck) #+end_src -#+begin_src conf-unix :noweb yes - # vim:set ft=sh - # MODULES - # The following modules are loaded before any boot hooks are - # run. Advanced users may wish to specify all system modules - # in this array. For instance: - # MODULES=(piix ide_disk reiserfs) - <<mkinitcpio-modules>> +* Pacman - # BINARIES - # This setting includes any additional binaries a given user may - # wish into the CPIO image. This is run last, so it may be used to - # override the actual binaries included by a given hook - # BINARIES are dependency parsed, so you may safely ignore libraries - BINARIES=() +For this configuration to work there needs to be a small change made to the base =/etc/pacman.conf=. We need to add =Include = /etc/pacman.d/conf/*.conf= under the =[options]= section. - # FILES - # This setting is similar to BINARIES above, however, files are added - # as-is and are not parsed in any way. This is useful for config files. - FILES=() +# This could be added by a script with grep + sed, for future reference. - # HOOKS - # This is the most important setting in this file. The HOOKS control the - # modules and scripts added to the image, and what happens at boot time. - # Order is important, and it is recommended that you do not change the - # order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for - # help on a given hook. - # 'base' is _required_ unless you know precisely what you are doing. - # 'udev' is _required_ in order to automatically load modules - # 'filesystems' is _required_ unless you specify your fs modules in MODULES - # Examples: - ## This setup specifies all modules in the MODULES setting above. - ## No raid, lvm2, or encrypted root is needed. - # HOOKS=(base) - # - ## This setup will autodetect all modules for your system and should - ## work as a sane default - # HOOKS=(base udev autodetect block filesystems) - # - ## This setup will generate a 'full' image which supports most systems. - ## No autodetection is done. - # HOOKS=(base udev block filesystems) - # - ## This setup assembles a pata mdadm array with an encrypted root FS. - ## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. - # HOOKS=(base udev block mdadm encrypt filesystems) - # - ## This setup loads an lvm2 volume group on a usb device. - # HOOKS=(base udev block lvm2 filesystems) - # - ## NOTE: If you have /usr on a separate partition, you MUST include the - # usr, fsck and shutdown hooks. - <<mkinitcpio-hooks>> +Download several packages in parallel. - # COMPRESSION - # Use this to compress the initramfs image. By default, zstd compression - # is used. Use 'cat' to create an uncompressed image. - #COMPRESSION="zstd" - #COMPRESSION="gzip" - #COMPRESSION="bzip2" - #COMPRESSION="lzma" - #COMPRESSION="xz" - #COMPRESSION="lzop" - #COMPRESSION="lz4" +#+begin_src conf-unix :tangle "/sudo::/etc/pacman.d/conf/parallel.conf" :mkdirp t + ParallelDownloads = 5 +#+end_src - # COMPRESSION_OPTIONS - # Additional options for the compressor - #COMPRESSION_OPTIONS=() +Show a pacman-like animation as the progress bar. Just for funsies. +#+begin_src conf-unix :tangle "/sudo::/etc/pacman.d/conf/candy.conf" :mkdirp t + ILoveCandy #+end_src diff --git a/sbcl/.sbclrc b/sbcl/sbclrc index 86d47f9..47baaef 100644 --- a/sbcl/.sbclrc +++ b/sbcl/sbclrc @@ -2,17 +2,25 @@ ;;; The following lines added by ql:add-to-init-file: #-quicklisp -(let ((quicklisp-init (merge-pathnames ".local/share/quicklisp/setup.lisp" +(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init))) +(require :linedit) + ;;; Enable linedit, a readline-like module for SBCL. Install through ;;; (ql:quickload "linedit"). (if (member "--no-linedit" sb-ext:*posix-argv* :test 'equal) (setf sb-ext:*posix-argv* (remove "--no-linedit" sb-ext:*posix-argv* :test 'equal)) (when (interactive-stream-p *terminal-io*) + (require :asdf) (require :sb-aclrepl) - (require :linedit) - (funcall (intern "INSTALL-REPL" :linedit) :wrap-current t))) + (funcall (intern "INSTALL-REPL" :linedit) :wrap-current t) + + (defun delete-char-forwards-or-quit (chord editor) + (if (equal "" (linedit::get-string editor)) + (sb-ext:quit) + (linedit::delete-char-forwards chord editor))) + (linedit::defcommand "C-D" 'delete-char-forwards-or-quit))) diff --git a/sway/.config/sway/config b/sway/.config/sway/config new file mode 100644 index 0000000..494548a --- /dev/null +++ b/sway/.config/sway/config @@ -0,0 +1,4 @@ +include /etc/sway/config.d/* + +exec_always "pkill -f '.*guile.*sway/init.scm'" +exec_always "sleep 0.2 && guile ~/.config/sway/init.scm" diff --git a/sway/.config/sway/init.scm b/sway/.config/sway/init.scm new file mode 100644 index 0000000..a2ab373 --- /dev/null +++ b/sway/.config/sway/init.scm @@ -0,0 +1,31 @@ +(use-modules (guile-swayer) + (srfi srfi-18)) + +(system (format #f "pgrep -f '.*guile.*sway/init.scm' | grep -v ~a | while read mypid; do kill $mypid; done" (getpid))) + +(sway-connect-sockets!) + +(sway-bindsym "Mod4+d" "exec wmenu-run") +(sway-bindsym "Mod4+Shift+c" "reload") +(sway-bindsym "Mod4+shift+q" "kill") + +(sway-bindsym "Mod4+f" "focus right") +(sway-bindsym "Mod4+b" "focus left") +(sway-bindsym "Mod4+p" "focus up") +(sway-bindsym "Mod4+n" "focus down") + +(sway-bindsym "Mod4+1" "workspace number 1") +(sway-bindsym "Mod4+2" "workspace number 2") +(sway-bindsym "Mod4+3" "workspace number 3") +(sway-bindsym "Mod4+4" "workspace number 4") +(sway-bindsym "Mod4+5" "workspace number 5") +(sway-bindsym "Mod4+6" "workspace number 6") +(sway-bindsym "Mod4+7" "workspace number 7") +(sway-bindsym "Mod4+8" "workspace number 8") +(sway-bindsym "Mod4+9" "workspace number 9") +(sway-bindsym "Mod4+0" "workspace number 10") + +(sway-bindsym "Mod4+l" "exec swaylock") + +(sway-start-event-listener-thread) +(thread-join! SWAY-LISTENER-THREAD) diff --git a/vivid/init.org b/vivid/init.org new file mode 100644 index 0000000..0bc6d31 --- /dev/null +++ b/vivid/init.org @@ -0,0 +1,7 @@ +#+title: Vivid + +[[https://github.com/sharkdp/vivid][vivid]] is a theme generator for =LS_COLORS=. I just need it to run when I enable ZSH and it should work. + +#+begin_src sh :tangle .config/zsh/conf.d/vivid.sh :mkdirp t + export LS_COLORS=$(vivid generate dracula) +#+end_src diff --git a/wezterm/.config/wezterm/wezterm.fnl b/wezterm/.config/wezterm/init.fnl index fcf6ac3..a76f4ff 100644 --- a/wezterm/.config/wezterm/wezterm.fnl +++ b/wezterm/.config/wezterm/init.fnl @@ -1,14 +1,19 @@ (local wezterm (require :wezterm)) (local colors { :foreground "#bfbfbf" - :background "#222424" }) + :background "#222424" + :cursor_bg "#ff9800" + :cursor_fg "#ff9800" + :cursor_border "#cc7100" + :selection_fg "#111414" + :selection_bg "#ff9800" }) (local open-url-key { :key "E" :mods "CTRL|SHIFT" :action (wezterm.action.QuickSelectArgs { :label "open url" - :patterns [ "https?://[[:alnum:]./-]+[[:alnum:]/]" ] + :patterns [ "https?://[[:alnum:]./-~]+[[:alnum:]/]" ] :action (wezterm.action_callback (fn [window pane] (let [url (window:get_selection_text_for_pane pane)] @@ -30,8 +35,19 @@ [ open-url-key copy-guix-hash-key { :key "o" :mods "ALT" :action wezterm.action.PaneSelect } - { :key "p" :mods "ALT" :action (wezterm.action.ScrollToPrompt -1) } - { :key "n" :mods "ALT" :action (wezterm.action.ScrollToPrompt 1) } ]) + { :key "p" :mods "LEADER" :action (wezterm.action.ScrollToPrompt -1) } + { :key "n" :mods "LEADER" :action (wezterm.action.ScrollToPrompt 1) } + { :key "c" :mods "LEADER" :action (wezterm.action.SendKey { :key "c" :mods "CTRL" }) } + { :key "c" :mods "LEADER|CTRL" :action (wezterm.action.SendKey { :key "c" :mods "CTRL" }) } + { :key "s" :mods "LEADER" :action (wezterm.action.ActivateKeyTable { :name "split_pane" :timeout_milliseconds 1000 }) } + { :key "x" :mods "ALT" :action wezterm.action.ActivateCommandPalette } ]) + +(local key_tables + { :split_pane [ { :key "f" :action (wezterm.action.SplitPane { :direction "Right" :size { :Percent 50 } }) } + { :key "b" :action (wezterm.action.SplitPane { :direction "Left" :size { :Percent 50 } }) } + { :key "p" :action (wezterm.action.SplitPane { :direction "Up" :size { :Percent 50 } }) } + { :key "n" :action (wezterm.action.SplitPane { :direction "Down" :size { :Percent 50 } }) } + { :key "g" :mods "CTRL" :action "PopKeyTable" } ] }) (local inactive_pane_hsb { :saturation 0.8 @@ -48,6 +64,7 @@ : colors : keys + : key_tables : inactive_pane_hsb ;; :command_palette_font (wezterm.font "Fantasque Sans Mono") diff --git a/wezterm/.config/wezterm/wezterm.lua b/wezterm/.config/wezterm/wezterm.lua index 3459deb..1967494 100644 --- a/wezterm/.config/wezterm/wezterm.lua +++ b/wezterm/.config/wezterm/wezterm.lua @@ -1,19 +1,22 @@ -local wezterm = require("wezterm") -local colors = {foreground = "#bfbfbf", background = "#222424"} -local open_url_key -local function _1_(window, pane) - local url = window:get_selection_text_for_pane(pane) - wezterm.log_info(("opening: " .. url)) - return wezterm.open_with(url) +local wezterm = require "wezterm" + +local function file_exists(name) + local f = io.open(name, "r") + if f ~= nil then + io.close(f) + return true + end + return false end -open_url_key = {key = "E", mods = "CTRL|SHIFT", action = wezterm.action.QuickSelectArgs({label = "open url", patterns = {"https?://[[:alnum:]./-]+[[:alnum:]/]"}, action = wezterm.action_callback(_1_)})} -local copy_guix_hash_key -local function _2_(window, pane) - local text = window:get_selection_text_for_pane(pane) - wezterm.log_info(("copying: " .. text)) - return window:copy_to_clipboard(text) + +local file_name = wezterm.config_dir .. "/fennel.lua" + +if not file_exists(file_name) then + os.execute("curl -o \"" .. file_name .. "\" https://fennel-lang.org/downloads/fennel-1.6.1.lua") end -copy_guix_hash_key = {key = "G", mods = "CTRL|SHIFT", action = wezterm.action.QuickSelectArgs({label = "copy hash", patterns = {"[a-z0-9]{52}"}, action = wezterm.action_callback(_2_)})} -local keys = {open_url_key, copy_guix_hash_key, {key = "o", mods = "ALT", action = wezterm.action.PaneSelect}, {key = "p", mods = "ALT", action = wezterm.action.ScrollToPrompt(-1)}, {key = "n", mods = "ALT", action = wezterm.action.ScrollToPrompt(1)}} -local inactive_pane_hsb = {saturation = 0.8, brightness = 0.7} -return {default_cursor_style = "SteadyBar", colors = colors, keys = keys, inactive_pane_hsb = inactive_pane_hsb, command_palette_font_size = 14, command_palette_bg_color = "#111414", command_palette_fg_color = "#bfbfbf", command_palette_rows = 10, font = wezterm.font("Fantasque Sans Mono"), font_size = 20, hide_tab_bar_if_only_one_tab = true, quick_select_alphabet = "arstdhneio", window_decorations = "INTEGRATED_BUTTONS|RESIZE", adjust_window_size_when_changing_font_size = false} + +local fennel_file_name = wezterm.config_dir .. "/init.fnl" + +wezterm.add_to_config_reload_watch_list(fennel_file_name) + +return require("fennel").install().dofile(fennel_file_name) diff --git a/zsh/zshrc.org b/zsh/zshrc.org index 27af335..9383348 100644 --- a/zsh/zshrc.org +++ b/zsh/zshrc.org @@ -8,208 +8,223 @@ Autoload any ZSH function from =$HOME/.zsh/functions=. autoload -U $HOME/.zsh/functions/*(:t) #+END_SRC +Remove ~/~, ~-~ , and ~)~ from ZSH's characters considered to be part of a word. This means that something like =M-DEL= will stop at =/= characters. + +#+begin_src sh + WORDCHARS=${WORDCHARS/\/} + WORDCHARS=${WORDCHARS/-} + WORDCHARS=${WORDCHARS/)} +#+end_src + * Aliases - Use rlwrap on some less-than-pleasant REPLs that don't have GNU - Readline-like features themselves. +Use rlwrap on some less-than-pleasant REPLs that don't have GNU Readline-like features themselves. - #+BEGIN_SRC sh - alias csi="rlwrap csi" - alias scsh="rlwrap scsh" - alias sbcl="rlwrap sbcl" - #+END_SRC +#+BEGIN_SRC sh + alias csi="rlwrap csi" + alias scsh="rlwrap scsh" + alias sbcl="rlwrap sbcl" +#+END_SRC - This alias is useful for when I'm trying something new with - herbstluftwm. +This alias is useful for when I'm trying something new with herbstluftwm. - #+BEGIN_SRC sh - alias hc=herbstclient - #+END_SRC +#+BEGIN_SRC sh + alias hc=herbstclient +#+END_SRC - Systemd supports user-level services, it's easy to manage them with this - simple alias. +Systemd supports user-level services, it's easy to manage them with this simple alias. - #+begin_src sh - alias myctl="systemctl --user" - #+end_src +#+begin_src sh + alias myctl="systemctl --user" +#+end_src - By default scrot will take a screenshot in whatever the current working - directory is, but I prefer having it all in the same location. +By default scrot will take a screenshot in whatever the current working directory is, but I prefer having it all in the same location. - #+begin_src sh - alias scrot="/usr/bin/scrot -e 'mv \$f ~/pictures/screenshots/'" - #+end_src +#+begin_src sh + alias scrot="/usr/bin/scrot -e 'mv \$f ~/pictures/screenshots/'" +#+end_src - Show colors and an indicator of what type each file is when using ~ls~, like - directory, pipe, link, etc. +Show colors and an indicator of what type each file is when using ~ls~, like directory, pipe, link, etc. - #+begin_src sh - alias ls="ls --classify --color=always" - #+end_src +#+begin_src sh + alias ls="ls --color=always" +#+end_src - Always show color in pacman output. +Always show color in pacman output. - #+begin_src sh - alias pacman="pacman --color=always" - #+end_src +#+begin_src sh + alias pacman="pacman --color=always" +#+end_src * History - Store ZSH history in a non-intrusive place. +Store ZSH history in a non-intrusive place. - #+BEGIN_SRC sh - HISTFILE=$HOME/.zsh/histfile - #+END_SRC +#+BEGIN_SRC sh + HISTFILE=$HOME/.zsh/histfile +#+END_SRC - Keep at most 1000 previous commands in memory. +Keep at most 1000 previous commands in memory. - #+BEGIN_SRC sh - HISTSIZE=1000 - #+END_SRC +#+BEGIN_SRC sh + HISTSIZE=1000 +#+END_SRC - Save at most 1000 previous commands to disk. +Save at most 1000 previous commands to disk. - #+BEGIN_SRC sh - SAVEHIST=1000 - #+END_SRC +#+BEGIN_SRC sh + SAVEHIST=1000 +#+END_SRC - Allow multiple shell instances to share the same history. +Allow multiple shell instances to share the same history. - #+BEGIN_SRC sh - setopt SHARE_HISTORY - #+END_SRC +#+BEGIN_SRC sh + setopt SHARE_HISTORY +#+END_SRC - Don't remember duplicated commands. +Don't remember duplicated commands. - #+BEGIN_SRC sh - setopt HIST_IGNORE_ALL_DUPS - #+END_SRC +#+BEGIN_SRC sh + setopt HIST_IGNORE_ALL_DUPS +#+END_SRC -* Plug-ins +* COMMENT Plug-ins - Load zplug, a next generation zsh plugin manager. +Load zplug, a next generation zsh plugin manager. - #+BEGIN_SRC sh - source /usr/share/zsh/scripts/zplug/init.zsh - #+END_SRC +#+BEGIN_SRC sh + source /usr/share/zsh/scripts/zplug/init.zsh +#+END_SRC - Add zsh-syntax-highlighting. +Add zsh-syntax-highlighting. - #+BEGIN_SRC sh - zplug "zsh-users/zsh-syntax-highlighting", defer:3 - #+END_SRC +#+BEGIN_SRC sh + zplug "zsh-users/zsh-syntax-highlighting", defer:3 +#+END_SRC - Add zsh-autosuggestions. +Add zsh-autosuggestions. - #+BEGIN_SRC sh - zplug "zsh-users/zsh-autosuggestions" - #+END_SRC +#+BEGIN_SRC sh + zplug "zsh-users/zsh-autosuggestions" +#+END_SRC - Add bgnotify from oh-my-zsh to show when long-running commands finish. +Add bgnotify from oh-my-zsh to show when long-running commands finish. - #+BEGIN_SRC sh - zplug "plugins/bgnotify", from:oh-my-zsh - #+END_SRC +#+BEGIN_SRC sh + zplug "plugins/bgnotify", from:oh-my-zsh +#+END_SRC - Make sure all plugins are installed. +Make sure all plugins are installed. - #+BEGIN_SRC sh - if ! zplug check --verbose; then - printf "Install? [y/N]: " - if read -q; then - echo; zplug install - fi - fi - #+END_SRC +#+BEGIN_SRC sh + if ! zplug check --verbose; then + printf "Install? [y/N]: " + if read -q; then + echo; zplug install + fi + fi +#+END_SRC - Load all plugins. +Load all plugins. - #+BEGIN_SRC sh - zplug load - #+END_SRC +#+BEGIN_SRC sh + zplug load +#+END_SRC * X Interaction - Make some widgets for interacting with the clipboard. +Make some widgets for interacting with the clipboard. - #+BEGIN_SRC sh - zle -N x-copy-region-as-kill - zle -N x-kill-region - zle -N x-yank - #+END_SRC +#+BEGIN_SRC sh + zle -N x-copy-region-as-kill + zle -N x-kill-region + zle -N x-yank +#+END_SRC - Bind them to keyboard shortcuts. +Bind them to keyboard shortcuts. - #+BEGIN_SRC sh - bindkey -e '^[w' x-copy-region-as-kill - bindkey -e '^W' x-kill-region - bindkey -e '^Y' x-yank - #+END_SRC +#+BEGIN_SRC sh + bindkey -e '^[w' x-copy-region-as-kill + bindkey -e '^W' x-kill-region + bindkey -e '^Y' x-yank +#+END_SRC * Completion - Initialize completion. This triggers loading of - zsh-syntax-highlighting as well. +Initialize completion. This triggers loading of zsh-syntax-highlighting as well. - #+BEGIN_SRC sh - autoload -Uz compinit - compinit - #+END_SRC +#+BEGIN_SRC sh + autoload -Uz compinit + compinit +#+END_SRC * Less - I use a terminal that's always 80 columns wide. This means that a - lot of output doesn't fit on a single line. I use the less command a - lot to look at output that's too big and wide to view in my - terminal. The default doesn't make this any better though, so I use - these switches. Most of these I originally got from what git uses. +I use a terminal that's always 80 columns wide. This means that a lot of output doesn't fit on a single line. I use the less command a lot to look at output that's too big and wide to view in my terminal. The default doesn't make this any better though, so I use these switches. Most of these I originally got from what git uses. - #+BEGIN_SRC sh - export LESS="FXRSi" - #+END_SRC +#+BEGIN_SRC sh + export LESS="FXRSi" +#+END_SRC - This causes less to immediately quit if there is no need to use a - pager (everything fits in a single screen) (=-F=). Doesn't clear the - screen when less is closed (=-X=). Handles ANSI colors (=-R=). Stops - long lines from wraping (=-S=). And makes searches case-insensitive - (=-i=). +This causes less to immediately quit if there is no need to use a pager (everything fits in a single screen) (=-F=). Doesn't clear the screen when less is closed (=-X=). Handles ANSI colors (=-R=). Stops long lines from wraping (=-S=). And makes searches case-insensitive (=-i=). * Prompt - First off, do some setup. Allow the use of functions inside the prompt, - initialize colors and load the ~add-zsh-hook~ function. +First off, do some setup. Allow the use of functions inside the prompt, initialize colors and load the ~add-zsh-hook~ function. - #+begin_src sh - setopt PROMPT_SUBST +#+begin_src sh + setopt PROMPT_SUBST - autoload -U colors - autoload -Uz add-zsh-hook - autoload -Uz vcs_info + autoload -U colors + autoload -Uz add-zsh-hook + autoload -Uz vcs_info - colors - #+end_src + colors +#+end_src + +Setup VCS info. The =formats= option supports two arguments, they are the format strings for the =vcs_info_message_0_= and =vcs_info_message_1_=. The latter is used to set the title for the current wezterm (or other terminal) tab. + +#+begin_src sh + add-zsh-hook precmd vcs_info - Setup VCS info. + zstyle ':vcs_info:*' actionformats '%u%c%B%F{1}%a%f%%b %F{3}%s%f:%F{5}%r%f:%F{4}%b%f' + zstyle ':vcs_info:*' enable bzr git hg svn + zstyle ':vcs_info:*' formats '%u%c%F{3}%s%f:%F{5}%r%f:%F{4}%b%f' '%r' + zstyle ':vcs_info:*' nvcsformats '' + zstyle ':vcs_info:bzr:*' branchformat '%b' + zstyle ':vcs_info:git:*' check-for-changes 1 + zstyle ':vcs_info:*' stagedstr '%F{2}*%f' + zstyle ':vcs_info:*' unstagedstr '%F{1}*%f' +#+end_src - #+begin_src sh - add-zsh-hook precmd vcs_info +Set the actual prompts. - zstyle ':vcs_info:*' actionformats '%u%c%B%F{1}%a%f%%b %F{3}%s%f:%F{5}%r%f:%F{4}%b%f' - zstyle ':vcs_info:*' enable bzr git hg svn - zstyle ':vcs_info:*' formats '%u%c%F{3}%s%f:%F{5}%r%f:%F{4}%b%f' - zstyle ':vcs_info:*' nvcsformats '' - zstyle ':vcs_info:bzr:*' branchformat '%b' - zstyle ':vcs_info:git:*' check-for-changes 1 - zstyle ':vcs_info:*' stagedstr '%F{2}*%f' - zstyle ':vcs_info:*' unstagedstr '%F{1}*%f' - #+end_src +#+begin_src sh + PROMPT=$'%{\e]133;P;k=i\a%}%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f %{\e]133;B\a%}' + RPROMPT=$'%{\e]133;P;k=r\a%}${vcs_info_msg_0_}%{\e]133;B\a%}' +#+end_src - Set the actual prompts. +Execute this preexec function to mark the output field. - #+begin_src sh - PROMPT='%T $(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f ' - RPROMPT='${vcs_info_msg_0_}' - #+end_src +#+begin_src sh + function mark_output() + { + printf "\\e]133;C\a" + } + + add-zsh-hook preexec mark_output +#+end_src + +Set the current tab's title (for wezterm at least), to the current project directory. This is set above with the =%r= specifier. + +#+begin_src sh + function set_vcs_title() + { + printf "\\e]0;${vcs_info_msg_1_:-$(basename $PWD)}\\a" + } + + add-zsh-hook precmd set_vcs_title +#+end_src * Other configurations |
