From 407d651ddda4c79c4f3add905343cdfecfe53a0d Mon Sep 17 00:00:00 2001 From: James Patrick Date: Tue, 20 Jul 2021 15:22:16 -0400 Subject: [PATCH 01/25] Added confluence quickmark --- tridactyl/tridactylrc | 1 + 1 file changed, 1 insertion(+) diff --git a/tridactyl/tridactylrc b/tridactyl/tridactylrc index c04f31e..702628f 100644 --- a/tridactyl/tridactylrc +++ b/tridactyl/tridactylrc @@ -52,6 +52,7 @@ colorscheme onedark " Quick marks quickmark r https://redmine.greenfiling.com/projects/general/issues?query_id=67 +quickmark c https://greenfiling.atlassian.net/wiki/home quickmark G https://github.com/ quickmark g https://git.jpatrick.io/ quickmark l https://lobste.rs/ From f5ec18f3bb33c6c8096f59d4570f1b2c973f2d10 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Wed, 21 Jul 2021 16:57:28 -0400 Subject: [PATCH 02/25] Added sql.vim to use the pgformatter --- vim/ftplugin/sql.vim | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 vim/ftplugin/sql.vim diff --git a/vim/ftplugin/sql.vim b/vim/ftplugin/sql.vim new file mode 100644 index 0000000..6003a96 --- /dev/null +++ b/vim/ftplugin/sql.vim @@ -0,0 +1,2 @@ +let b:ale_fixers = ['pgformatter'] +let b:ale_fix_on_save = 0 From f0c37b09bcb8f6f0f4dec2125594d5309591a87e Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 28 Aug 2021 00:07:17 -0400 Subject: [PATCH 03/25] Added ftplugin sh --- vim/ftplugin/sh.vim | 2 ++ vim/makefile | 1 + 2 files changed, 3 insertions(+) create mode 100644 vim/ftplugin/sh.vim diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim new file mode 100644 index 0000000..41b0e00 --- /dev/null +++ b/vim/ftplugin/sh.vim @@ -0,0 +1,2 @@ +let b:ale_fixers = ['shfmt'] +let b:ale_fix_on_save = 0 diff --git a/vim/makefile b/vim/makefile index cac44b9..d997d9e 100644 --- a/vim/makefile +++ b/vim/makefile @@ -14,6 +14,7 @@ init: $(mk_link) $(SRC_DIR)/vimrc ~/.vimrc $(mk_link) $(SRC_DIR)/vimrc.d $(TARGET_DIR)/vimrc.d $(mk_link) $(SRC_DIR)/spell $(TARGET_DIR)/spell + $(mk_link) $(SRC_DIR)/ftplugin $(TARGET_DIR)/ftplugin ( mkdir -p $(TARGET_DIR)/backup \ && chmod 700 $(TARGET_DIR)/backup ) \ ; $(report) "setting up backup dir" From 1b3f1937b4ac5af11197851df68ee72fd48627f8 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 28 Aug 2021 12:45:59 -0400 Subject: [PATCH 04/25] Setting up golang --- emacs/init.el | 2 +- zsh/environment/host/wok/zshenv | 2 +- zsh/environment/host/zuk/zshenv | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 21c3ce7..a4a39d0 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -139,7 +139,7 @@ ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for - ;;(go +lsp) ; the hipster dialect + (go +lsp) ; the hipster dialect ;;(haskell +dante) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on diff --git a/zsh/environment/host/wok/zshenv b/zsh/environment/host/wok/zshenv index d8cb7af..7a7df05 100644 --- a/zsh/environment/host/wok/zshenv +++ b/zsh/environment/host/wok/zshenv @@ -3,7 +3,7 @@ export PSQLAPP="/Applications/Postgres.app/Contents/Versions/latest/bin" export JAVA_HOME=$(/usr/libexec/java_home -v 14) path=( - $GOPATH + $GOPATH/bin $PSQLAPP $JAVA_HOME/bin $path) diff --git a/zsh/environment/host/zuk/zshenv b/zsh/environment/host/zuk/zshenv index 677065a..f394a04 100644 --- a/zsh/environment/host/zuk/zshenv +++ b/zsh/environment/host/zuk/zshenv @@ -3,7 +3,7 @@ export GOPATH="$HOME/src/go" path=( - $GOPATH + $GOPATH/bin $GOLANG_PATH $path) # vim: syn=zsh From 8b1c3a80ad7e49c6ec1e99158c7088d8ba16438d Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 13 Sep 2021 20:08:28 -0400 Subject: [PATCH 05/25] Splitting out work stuff --- ssh/config | 2 ++ ssh/config.d/work.config | 11 +++++++++++ ssh/makefile | 1 + ssh/public_keys/wok/github.com.pub | 1 + 4 files changed, 15 insertions(+) create mode 100644 ssh/config.d/work.config create mode 100644 ssh/public_keys/wok/github.com.pub diff --git a/ssh/config b/ssh/config index 19f1765..880bb6b 100644 --- a/ssh/config +++ b/ssh/config @@ -12,3 +12,5 @@ Host *.greenfiling.com ForwardAgent yes Host * UseRoaming no + +Include config.d/* diff --git a/ssh/config.d/work.config b/ssh/config.d/work.config new file mode 100644 index 0000000..a793b0f --- /dev/null +++ b/ssh/config.d/work.config @@ -0,0 +1,11 @@ +Host journal_tunnel + HostName dev.greenfiling.com + LocalForward 127.0.0.1:1443 efm-lasc-stage-pub.journaltech.com:443 + +Host placer_tunnel + HostName dev.greenfiling.com + LocalForward 127.0.0.1:1444 efm-placer-court-aux.ecourt.com:443 + +Host riverside_tunnel + HostName dev.greenfiling.com + LocalForward 127.0.0.1:1445 riv-impl-efm-public.ecourt.com:443 diff --git a/ssh/makefile b/ssh/makefile index 9468803..47172dc 100644 --- a/ssh/makefile +++ b/ssh/makefile @@ -13,6 +13,7 @@ init: $(report) header "Setting up ssh" $(mk_link) $(CONFIG_SRC) $(CONFIG_TRGT) $(mk_link) $(SRC_DIR)/public_keys ~/.ssh/public_keys + $(mk_link) $(SRC_DIR)/config.d ~/.ssh/config.d $(MAKE) -C $(SRC_DIR) init_git_key update: diff --git a/ssh/public_keys/wok/github.com.pub b/ssh/public_keys/wok/github.com.pub new file mode 100644 index 0000000..3842de1 --- /dev/null +++ b/ssh/public_keys/wok/github.com.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHbxQtU3f3ASNOSz9uSygKqm8P9DNJ5ITlBKrLE9ilnf wok: Fri Aug 21 14:06:42 EDT 2020 From 422c1f401a414ce5ecbd441a296d384f9e1a8ae2 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 13 Sep 2021 20:09:02 -0400 Subject: [PATCH 06/25] Automatically set to markdown when loading tridactyl redmine files. --- emacs/config.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs/config.el b/emacs/config.el index de947fd..2a311c6 100644 --- a/emacs/config.el +++ b/emacs/config.el @@ -19,6 +19,11 @@ ;; Use an image splash (setq fancy-splash-image (concat doom-private-dir "doom.png")) +(setq ispell-dictionary "en") + + +(add-to-list 'auto-mode-alist '("/\\(tmp\\|private/var\\)/.*/tmp_redmine.greenfiling.com.*\\.txt" . markdown-mode)) + (load! "+mail") (load! "+org") (load! "+company") From 11e3f154720a3b6e6ad2b3562d0000ff85e92e20 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 13 Sep 2021 20:10:25 -0400 Subject: [PATCH 07/25] delta is kind of being a pain. I'm gonna remove it --- git/gitconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/git/gitconfig b/git/gitconfig index c98de40..55c1da1 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -3,7 +3,6 @@ name = James Patrick [core] - pager = delta editor = vim [interactive] From 5799cbb1b45be9289432473215e71f4cdcfd8893 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 13 Sep 2021 20:10:46 -0400 Subject: [PATCH 08/25] Add work capture. --- emacs/+org.el | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/emacs/+org.el b/emacs/+org.el index d589057..69be4f7 100644 --- a/emacs/+org.el +++ b/emacs/+org.el @@ -2,14 +2,26 @@ (require 'org) (custom-set-variables '(org-directory "~/org/")) + +(defvar +org-capture-work-todo-file "work/todo.org" + "location for my work todo list. + +This is defined relative to the `org-directory' unless absolute.") + +(defun +org-capture-work-todo-file () + "Expand `+org-capture-work-todo-file' from `org-directory'. +If it is an absolute path return `+org-capture-work-todo-file' verbatim." + (expand-file-name +org-capture-work-todo-file org-directory)) + + (setq deft-directory org-directory org-download-image-dir (concat org-directory "resources") org-roam-directory org-directory) (setq org-agenda-files (list - (concat org-directory "work/todo.org") - (concat org-directory "todo.org") + (concat org-directory +org-capture-work-todo-file ) + ;;(concat org-directory "todo.org") ) ) ;(org-agenda-files (file-expand-wildcards (concat org-directory "*". )"~/ref/*.org") @@ -65,21 +77,11 @@ (0.5 . org-upcoming-deadline) (0.0 . org-upcoming-distant-deadline))) -;; Use appear to make org syntax easier to not fuck up. -;(use-package! org-appear -; :hook (org-mode . org-appear-mode) -; :config -; (setq org-appear-autoemphasis t -; org-appear-autosubmarkers t -; org-appear-autolinks nil) -; ;; for proper first-time setup, `org-appear--set-elements' -; ;; needs to be run after other hooks have acted. -; (run-at-time nil nil #'org-appear--set-elements)) - ;; Added Org-mode (add-hook 'org-mode-hook (lambda () - "Beautify Org Checkbox Symbol" + "Beautify Org Checkbox Symbol"` (push '("[ ]" . "☐") prettify-symbols-alist) + (push '("[_]" . "☐") prettify-symbols-alist) (push '("[X]" . "☑" ) prettify-symbols-alist) (push '("[-]" . "⊟" ) prettify-symbols-alist) (prettify-symbols-mode))) @@ -98,3 +100,13 @@ org-agenda-block-separator nil org-agenda-tags-column 100 ;; from testing this seems to be a good value org-agenda-compact-blocks t) + +(add-to-list 'org-capture-templates + '("w" "Work Todo" entry + (file+headline +org-capture-work-todo-file "Inbox") + "* [_] %?\n%i\n%a" :prepend t)) + +(setq org-roam-directory "~/org/roam") + + +(load! "org/+babel-diff") From c5ac68d5fa4636039c552fdde7f7a3df23d4f66d Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 13 Sep 2021 20:11:10 -0400 Subject: [PATCH 09/25] Fixed Typo in makefile for tridactyl --- tridactyl/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tridactyl/makefile b/tridactyl/makefile index e08a246..fd4ee86 100644 --- a/tridactyl/makefile +++ b/tridactyl/makefile @@ -8,7 +8,7 @@ SCRIPTS_TARGET := ~/.local/share/tridactyl/scripts install: | init update init: - if [[ $OSTYPE = darwin* ]] ; then + if [[ $$OSTYPE = darwin* ]] ; then $(MAKE) -C $(SRC_DIR) setup elif (( $$+commands[firefox] )) ; then $(MAKE) -C $(SRC_DIR) setup From 9569e99af7dfa4db89c89d3f0b77312d7027c3f5 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 13 Sep 2021 20:11:34 -0400 Subject: [PATCH 10/25] Work is now using jre 11. --- zsh/environment/host/wok/zshenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/environment/host/wok/zshenv b/zsh/environment/host/wok/zshenv index 7a7df05..b57639f 100644 --- a/zsh/environment/host/wok/zshenv +++ b/zsh/environment/host/wok/zshenv @@ -1,6 +1,6 @@ export GOPATH="${HOME}/.go" export PSQLAPP="/Applications/Postgres.app/Contents/Versions/latest/bin" -export JAVA_HOME=$(/usr/libexec/java_home -v 14) +export JAVA_HOME=$(/usr/libexec/java_home -v 11) path=( $GOPATH/bin From 7e6c9cc48cf350553b7d1b9db54d9514ac477301 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 13 Sep 2021 20:13:41 -0400 Subject: [PATCH 11/25] Fixed fix that was no longer needed and broke lsp --- emacs/+company.el | 8 -------- emacs/config.el | 1 - 2 files changed, 9 deletions(-) delete mode 100644 emacs/+company.el diff --git a/emacs/+company.el b/emacs/+company.el deleted file mode 100644 index b88a2af..0000000 --- a/emacs/+company.el +++ /dev/null @@ -1,8 +0,0 @@ -;;; +company.el -*- lexical-binding: t; -*- - -;; Make company a little faster to respond. -(after! company - (setq company-idle-delay 0.5 - company-minimum-prefix-length 2) - (setq company-show-numbers t) - (add-hook 'evil-normal-state-entry-hook #'company-abort)) ;; make aborting less annoying. diff --git a/emacs/config.el b/emacs/config.el index 2a311c6..a40a82c 100644 --- a/emacs/config.el +++ b/emacs/config.el @@ -26,6 +26,5 @@ (load! "+mail") (load! "+org") -(load! "+company") (load! "+modeline") (load! "+window") From 1ca305050b09e50af6cadb4534efd8ff71dcd2ea Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 11 Nov 2021 15:23:48 -0500 Subject: [PATCH 12/25] Enable JS & Json Support --- emacs/init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/init.el b/emacs/init.el index a4a39d0..96ea6cb 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -146,7 +146,8 @@ (json ; At least it ain't XML +lsp) ;;(java +meghanada) ; the poster child for carpal tunnel syndrome - ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) + (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) + (json +lsp) ;;julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) ;;latex ; writing papers in Emacs has never been so fun From 10a6f5a331875a58dc8c60ded08b237cdce9b457 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 11 Nov 2021 15:24:08 -0500 Subject: [PATCH 13/25] Fixed incorrect high lighting of every word. The hunspell module had an issue where aspell was being used for buffer spell linting, but not autocomplete or corrections. Since aspell is required, regardless lets use that for everything. --- emacs/init.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 96ea6cb..09ec126 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -87,8 +87,9 @@ :checkers syntax ; tasing you for every semicolon you forget (spell ; tasing you for misspelling mispelling - +hunspell - +everywhere) + +aspell + +everywhere + ) grammar ; tasing grammar mistake every you make :tools From 633f036cfa95e95972c473de056e0fddaada6278 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 11 Nov 2021 15:26:18 -0500 Subject: [PATCH 14/25] Attempting to find roam to be actually useful-again. --- emacs/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs/init.el b/emacs/init.el index 09ec126..ea956a2 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -166,6 +166,7 @@ +pandoc +pomodoro +pretty ;weirdly expensive + +roam2 ) ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more From 56c866b664af829c5938db58855f34132c35e2db Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 11 Nov 2021 15:27:29 -0500 Subject: [PATCH 15/25] Move whichkey out of the, did something break window. --- emacs/config.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emacs/config.el b/emacs/config.el index a40a82c..cd08906 100644 --- a/emacs/config.el +++ b/emacs/config.el @@ -3,6 +3,9 @@ ;; Use "," as leader. (setq doom-localleader-key ",") +;; Speed up which key response +(setq which-key-idle-delay 0.1) + ;; Firacode is broken with Emacs-plus on osx. Fallback to Hasklig (setq doom-font (font-spec :family "Hasklig" :size 12) doom-variable-pitch-font (font-spec :family "ETbembo" :size 16) From c00c8397691cd483200ca62e651d4a4b3523151b Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 11 Nov 2021 15:28:38 -0500 Subject: [PATCH 16/25] Fixed org capture template --- emacs/+org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/+org.el b/emacs/+org.el index 69be4f7..0cf1d8d 100644 --- a/emacs/+org.el +++ b/emacs/+org.el @@ -104,7 +104,7 @@ If it is an absolute path return `+org-capture-work-todo-file' verbatim." (add-to-list 'org-capture-templates '("w" "Work Todo" entry (file+headline +org-capture-work-todo-file "Inbox") - "* [_] %?\n%i\n%a" :prepend t)) + "* [_] %?%i\n%a" :prepend t)) (setq org-roam-directory "~/org/roam") From 618147c543defc96231274e151000af33e6cd416 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 20 Nov 2021 15:20:11 -0500 Subject: [PATCH 17/25] LFS support. --- git/gitconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git/gitconfig b/git/gitconfig index 55c1da1..119ef5d 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -1,5 +1,5 @@ [user] - email = james@jpatrick.io + email = subscriptions@jpatrick.io name = James Patrick [core] @@ -22,3 +22,8 @@ user = jamesepatrick [alias] root = rev-parse --show-toplevel +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true From ce1a6a6b97eb9f0f86f5a14a113712cd7b0a83ee Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 20 Nov 2021 15:21:08 -0500 Subject: [PATCH 18/25] Added support for nix. --- emacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/init.el b/emacs/init.el index ea956a2..8d0a189 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -158,7 +158,7 @@ ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c - ;;nix ; I hereby declare "nix geht mehr!" + nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org ; organize your plain life in plain text +dragndrop From 487e056acc97ed83ba4cd33c694fb27907d424d3 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 20 Nov 2021 15:22:17 -0500 Subject: [PATCH 19/25] Removed Org-Agenda for the time being. It was causing some preformance issues on OSX. I do like the package so I may try toubleshoot these later --- emacs/+org.el | 8 -------- emacs/packages.el | 1 - 2 files changed, 9 deletions(-) diff --git a/emacs/+org.el b/emacs/+org.el index 0cf1d8d..c774381 100644 --- a/emacs/+org.el +++ b/emacs/+org.el @@ -86,14 +86,6 @@ If it is an absolute path return `+org-capture-work-todo-file' verbatim." (push '("[-]" . "⊟" ) prettify-symbols-alist) (prettify-symbols-mode))) - - -;;; Org-Agenda Options -(use-package! org-super-agenda - :commands (org-super-agenda-mode)) -(after! org-agenda - (org-super-agenda-mode)) - (setq org-agenda-skip-scheduled-if-done t org-agenda-skip-deadline-if-done t org-agenda-include-deadlines t diff --git a/emacs/packages.el b/emacs/packages.el index 5150484..85db5f1 100644 --- a/emacs/packages.el +++ b/emacs/packages.el @@ -4,7 +4,6 @@ (package! vimrc-mode) (package! graphviz-dot-mode :pin "3642a0a5f4...") (package! systemd :pin "b6ae63a236...") -(package! org-super-agenda :pin "f5e80e4d0d...") (package! postcss-sorting) ;;; Examples: ;; (package! pretty-mode) From 8bfbfe48db844191531d1b6e785e3d296bf94e1e Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 20 Nov 2021 15:37:15 -0500 Subject: [PATCH 20/25] Added diff for babel tangle --- emacs/org/+babel-diff.el | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 emacs/org/+babel-diff.el diff --git a/emacs/org/+babel-diff.el b/emacs/org/+babel-diff.el new file mode 100644 index 0000000..3dd5f0d --- /dev/null +++ b/emacs/org/+babel-diff.el @@ -0,0 +1,9 @@ +(defun org-babel-execute:diff (body params) + "Applies diff patches. Use with care. +See https://emacs.stackexchange.com/questions/63517/org-mode-evaluate-diff-code-block" + (with-temp-buffer + (insert body "\n") + (shell-command-on-region (point-min) (point-max) "patch --strip=1" "*patch*") + (prog1 + (with-current-buffer "*patch*" (buffer-string)) + (kill-buffer "*patch*")))) From 8ca8c1f61249b9233e30e3ddecbaf968af917f45 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 20 Nov 2021 15:37:47 -0500 Subject: [PATCH 21/25] added personal todo to org-agenda --- emacs/+org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/+org.el b/emacs/+org.el index c774381..166e38a 100644 --- a/emacs/+org.el +++ b/emacs/+org.el @@ -21,7 +21,7 @@ If it is an absolute path return `+org-capture-work-todo-file' verbatim." (setq org-agenda-files (list (concat org-directory +org-capture-work-todo-file ) - ;;(concat org-directory "todo.org") + (concat org-directory "todo.org") ) ) ;(org-agenda-files (file-expand-wildcards (concat org-directory "*". )"~/ref/*.org") From 70f2826afec9a442912a999eb99afa82deef97e0 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sun, 28 Nov 2021 16:33:24 -0500 Subject: [PATCH 22/25] Refactored make targets. --- emacs/makefile | 33 ++++++++++++++++----------------- git/makefile | 6 ++---- jrnl/makefile | 6 ++---- kitty/makefile | 5 +++-- lib/makefile | 6 ++---- lib/post-merge | 8 +------- makefile | 20 +++++--------------- mako/makefile | 6 ++---- mbsync/makefile | 11 ++--------- pass/makefile | 9 ++------- rofi/makefile | 8 ++------ ssh/makefile | 20 +++++++++----------- sway/makefile | 43 +++++++++++++++++++++---------------------- tmux/makefile | 8 ++------ tridactyl/makefile | 15 ++++++--------- vim/makefile | 34 ++++++++++++++++------------------ waybar/makefile | 24 +++++++++++------------- zsh/makefile | 44 +++++++++++++++++++++----------------------- 18 files changed, 125 insertions(+), 181 deletions(-) diff --git a/emacs/makefile b/emacs/makefile index 455a7e6..c8f2009 100644 --- a/emacs/makefile +++ b/emacs/makefile @@ -6,12 +6,25 @@ EMACSD := ~/.emacs.d DOOMD := ~/.doom.d DOOM_URL := https://github.com/hlissner/doom-emacs - include ../lib/shared.mk -install: | init update +up: setup + if [ -e $(EMACSD)/bin/doom ] ; then + ~/.emacs.d/bin/doom --yes sync \ + ; $(report) "doom sync" + ~/.emacs.d/bin/doom --yes purge \ + ; $(report) "doom purge" + else + $(report) debug "doom not setup, so not updating." + fi -init: +down: + $(report) header "Removing Emacs configuration" + rm -rf $(EMACSD) ; $(report) "deleted $(EMACSD)" + $(rm_link) $(DOOMD) + + +setup: if (( ! $$+commands[emacs] )) ; then $(report) debug "Emacs not installed. Skipping install." elif [[ -v $$SSH_TTY ]] ; then @@ -33,17 +46,3 @@ doom_init: $(report) debug "emacsd already exists. Skipping" fi -update: - if [ -e $(EMACSD)/bin/doom ] ; then - ~/.emacs.d/bin/doom --yes sync \ - ; $(report) "doom sync" - ~/.emacs.d/bin/doom --yes purge \ - ; $(report) "doom purge" - else - $(report) debug "doom not setup, so not updating." - fi - -remove: - $(report) header "Removing Emacs configuration" - rm -rf $(EMACSD) ; $(report) "deleted $(EMACSD)" - $(rm_link) $(DOOMD) diff --git a/git/makefile b/git/makefile index b53cd09..6aed267 100644 --- a/git/makefile +++ b/git/makefile @@ -5,14 +5,12 @@ TARGET := ~/.gitconfig include ../lib/shared.mk -install: | init update - init: $(report) header "Setting up gitconfig" $(mk_link) $(SOURCE) $(TARGET) -update: +up: init -remove: +down: $(report) header "Removing gitconfig" $(rm_link) $(TARGET) diff --git a/jrnl/makefile b/jrnl/makefile index 1cc1a45..9eb2626 100644 --- a/jrnl/makefile +++ b/jrnl/makefile @@ -5,9 +5,7 @@ include ../lib/shared.mk CONFIG_DIR := $(XDG_DIR)/jrnl -install: | init update - -init: +up: if (( $$+commands[jrnl] )) ; then $(report) header "Setting up jrnl" mkdir $(CONFIG_DIR) @@ -16,5 +14,5 @@ init: $(report) debug "jrnl not installed. Skipping." fi -remove: +down: rm -rf $(CONFIG_DIR) diff --git a/kitty/makefile b/kitty/makefile index bece955..93fb395 100644 --- a/kitty/makefile +++ b/kitty/makefile @@ -1,13 +1,14 @@ # -*- mode: makefile-gmake; -*- SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +requires := kitty include ../lib/shared.mk CONFIG_DIR := $(XDG_DIR)/kitty install: | init update -init: +up: if (( $$+commands[kitty] )) ; then $(report) header "Setting up kitty" $(mk_link) $(SRC) $(CONFIG_DIR) @@ -15,6 +16,6 @@ init: $(report) debug "kitty not installed. Skipping." fi -remove: +down: $(report) header "removing up kitty" rm -r $(CONFIG_DIR) ; $(report) "removed dir" diff --git a/lib/makefile b/lib/makefile index 50e222a..fd22634 100644 --- a/lib/makefile +++ b/lib/makefile @@ -5,8 +5,6 @@ GIT_HOOK_TARGET = $(abspath $(SRC_DIR)/..)/.git/hooks/post-merge include ../lib/shared.mk -install: | init update - init: $(report) header "Setting up this stuff" $(report) pass "githook symlinked `ln -svf $(GIT_HOOK_SRC) $(GIT_HOOK_TARGET)`" @@ -21,8 +19,8 @@ fix_http_repo: $(report) debug "git repo deosn't start with http. So no need to reset remote." fi -update: +up: init -remove: +down: $(report) header "Removing githook" $(rm_link) $(GIT_HOOK_TARGET) diff --git a/lib/post-merge b/lib/post-merge index cb7c130..0caf503 100755 --- a/lib/post-merge +++ b/lib/post-merge @@ -1,9 +1,3 @@ #!/bin/zsh # -*- zsh -*- - -local_hook="$HOME"/.git_template.local/hooks/post-merge -[ -f "$local_hook" ] && . "$local_hook" - -.git/hooks/ctags >/dev/null 2>&1 & - -(($+commands[gmake])) && gmake update || make update +( ($+commands[gmake])) && gmake up || make update diff --git a/makefile b/makefile index 7853856..96e9227 100644 --- a/makefile +++ b/makefile @@ -6,23 +6,13 @@ include lib/shared.mk define recursive_make for i in */makefile; do echo "`dirname $$i` " - $(MAKE) -C $(SRC_DIR)/`dirname $$i` $1 + $(MAKE) --keep-going -C $(SRC_DIR)/`dirname $$i` $1 echo "" done endef -install: - $(info Initalizing) - $(call recursive_make,install) +up: + $(call recursive_make,up) -init: - $(info Initalizing) - $(call recursive_make,init) - -update: - $(info Updating) - $(call recursive_make,update) - -remove: - $(info Removing) - $(call recursive_make,remove) +down: + $(call recursive_make,down) diff --git a/mako/makefile b/mako/makefile index 499e83a..b3ca904 100644 --- a/mako/makefile +++ b/mako/makefile @@ -4,8 +4,6 @@ SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) include ../lib/shared.mk TARGET := $(XDG_DIR)/mako -install: | init update - init: if (( $$+commands[mako] )) ; then $(report) header "Setting up mako" @@ -14,7 +12,7 @@ init: $(report) warn "mako not installed. Skipping." fi -update: +up: init if (( $$+commands[makoctl] )) ; then $(report) header "Updating mako" if [[ -n `pgrep mako` ]] ; then @@ -25,6 +23,6 @@ update: fi -remove: +down: $(report) header "Removing mako" $(rm_link) $(TARGET) diff --git a/mbsync/makefile b/mbsync/makefile index b406ba3..c58971d 100644 --- a/mbsync/makefile +++ b/mbsync/makefile @@ -6,10 +6,7 @@ TARGET := $(XDG_DIR)/mbsync RC_TARGET := ~/.mbsyncrc TRANSIENT_DIR := $(SRC)/transient - -install: | init update - -init: +up: if (( $$+commands[mbsync] )) ; then $(report) header "Setting up mbsync" $(mk_link) $(SRC) $(TARGET) @@ -34,11 +31,7 @@ update_cert: && $(report) pass "Cert from proton bridge downloaded." \ || $(report) error "Error while fetching cert. Is bridge running?" - - -update: - -remove: +down: $(report) header "Removing mbsync" $(rm_link) $(TARGET) rm -rf $(TRANSIENT_DIR) ; $(report) "Deleting $(TRANSIENT_DIR)" diff --git a/pass/makefile b/pass/makefile index cbd40f0..657c3ae 100644 --- a/pass/makefile +++ b/pass/makefile @@ -4,9 +4,7 @@ SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) include ../lib/shared.mk TARGET := ~/.password-store -install: | init update - -init: +up: if (( $$+commands[pass] )) ; then $(report) header "Setting up pass" [ -e $(TARGET) ] \ @@ -16,9 +14,6 @@ init: $(report) debug " pass not installed. Skipping." fi -update: - - -remove: +down: $(report) header "Removing pass" $(rm_link) $(TARGET) diff --git a/rofi/makefile b/rofi/makefile index 956f97d..ea69901 100644 --- a/rofi/makefile +++ b/rofi/makefile @@ -7,9 +7,7 @@ TARGET := $(XDG_DIR)/rofi DESKTOP_SRC := $(SRC)/desktop DESKTOP_TARGET := ~/.local/share/applications -install: | init update - -init: +up: if (( $$+commands[rofi] )) ; then $(report) header "Setting up rofi" $(mk_link) $(SRC) $(TARGET) @@ -18,9 +16,7 @@ init: $(report) debug "rofi not installed. Skipping." fi -update: - -remove: +down: $(report) header "Removing rofi" $(rm_link) $(TARGET) $(MAKE) -C $(SRC) desktop_remove diff --git a/ssh/makefile b/ssh/makefile index 47172dc..7a650dd 100644 --- a/ssh/makefile +++ b/ssh/makefile @@ -7,16 +7,7 @@ GIT_KEY := ~/.ssh/git.jpatrick.io include ../lib/shared.mk -install: | init update - -init: - $(report) header "Setting up ssh" - $(mk_link) $(CONFIG_SRC) $(CONFIG_TRGT) - $(mk_link) $(SRC_DIR)/public_keys ~/.ssh/public_keys - $(mk_link) $(SRC_DIR)/config.d ~/.ssh/config.d - $(MAKE) -C $(SRC_DIR) init_git_key - -update: +up: init mkdir -p public_keys/`hostname` cd ~/.ssh $(report) header "Copying public keys" @@ -25,11 +16,18 @@ update: $(report) pass "Copied $$i" done -remove: +down: $(report) header "Removing ssh sym-links" $(rm_link) $(CONFIG_TRGT) $(report) warn "NOTE: All keys still remain." +init: + $(report) header "Setting up ssh" + $(mk_link) $(CONFIG_SRC) $(CONFIG_TRGT) + $(mk_link) $(SRC_DIR)/public_keys ~/.ssh/public_keys + $(mk_link) $(SRC_DIR)/config.d ~/.ssh/config.d + $(MAKE) -C $(SRC_DIR) init_git_key + init_git_key: if [[ -e $(GIT_KEY) ]] ; then $(report) debug "$(GIT_KEY) already installed." diff --git a/sway/makefile b/sway/makefile index 21979f5..3254374 100644 --- a/sway/makefile +++ b/sway/makefile @@ -7,7 +7,27 @@ TARGET := $(XDG_DIR)/sway PATH_ICON_BOSTON := "$$HOME/.icons/Boston" PATH_GTK_ANT_NEBULA := "$$HOME/.theme/Ant-Nebula" -install: | init update +up: init + if (( ! $$+commands[swaymsg] )) ; then + $(report) debug "swaymsg not installed. Skipping." + else + $(report) header "Reloading sway" + swaymsg reload ; $(report) "sway reload" + $(MAKE) -C $(SRC) update_icons + $(MAKE) -C $(SRC) update_theme + fi + +down: + $(report) header "Removing sway" + $(rm_link) $(TARGET) + if [ -e $(PATH_ICON_BOSTON) ] ; then + rm -rf $(PATH_ICON_BOSTON) \ + ; $(report) "Removed $(PATH_ICON_BOSTON)" + fi + if [ -e $(PATH_GTK_ANT_NEBULA) ] ; then + rm -rf $(PATH_GTK_ANT_NEBULA) \ + ; $(report) "Removed $(PATH_GTK_ANT_NEBULA)" + fi init: if (( ! $$+commands[sway] )) ; then @@ -42,16 +62,6 @@ init_theme: $(report) debug "gsettings not installed. Skipping" fi -update: - if (( ! $$+commands[swaymsg] )) ; then - $(report) debug "swaymsg not installed. Skipping." - else - $(report) header "Reloading sway" - swaymsg reload ; $(report) "sway reload" - $(MAKE) -C $(SRC) update_icons - $(MAKE) -C $(SRC) update_theme - fi - update_icons: if [ ! -e $(PATH_ICON_BOSTON) ] ; then cd $(PATH_ICON_BOSTON) @@ -64,14 +74,3 @@ update_theme: git pull ; $(report) "Updated Ant Nebula GTK." fi -remove: - $(report) header "Removing sway" - $(rm_link) $(TARGET) - if [ -e $(PATH_ICON_BOSTON) ] ; then - rm -rf $(PATH_ICON_BOSTON) \ - ; $(report) "Removed $(PATH_ICON_BOSTON)" - fi - if [ -e $(PATH_GTK_ANT_NEBULA) ] ; then - rm -rf $(PATH_GTK_ANT_NEBULA) \ - ; $(report) "Removed $(PATH_GTK_ANT_NEBULA)" - fi diff --git a/tmux/makefile b/tmux/makefile index 1dcaa3d..b46b364 100644 --- a/tmux/makefile +++ b/tmux/makefile @@ -6,9 +6,7 @@ TARGET := ~/.tmux.conf include ../lib/shared.mk -install: | init update - -init: +up: if (( ! $$+commands[tmux] )) ; then $(report) header "tmux not installed" else @@ -16,8 +14,6 @@ init: $(mk_link) $(SOURCE) $(TARGET) fi -update: - -remove: +down: $(report) header "Removing tmux config" $(rm_link) $(TARGET) diff --git a/tridactyl/makefile b/tridactyl/makefile index fd4ee86..47ab695 100644 --- a/tridactyl/makefile +++ b/tridactyl/makefile @@ -5,9 +5,7 @@ include ../lib/shared.mk RC_TARGET := $(XDG_DIR)/tridactyl SCRIPTS_TARGET := ~/.local/share/tridactyl/scripts -install: | init update - -init: +up: if [[ $$OSTYPE = darwin* ]] ; then $(MAKE) -C $(SRC_DIR) setup elif (( $$+commands[firefox] )) ; then @@ -16,14 +14,13 @@ init: $(report) debug "This doesn't seem to be an env for Tridactyl. Skipping." fi +down: + $(report) header "Removing Tridaycl" + $(rm_link) $(RC_TARGET) + $(rm_link) $(SCRIPTS_TARGET) + setup: $(report) header "Setting up Tridaycl" $(mk_link) $(SRC_DIR) $(RC_TARGET) $(mk_link) $(SRC_DIR)/scripts $(SCRIPTS_TARGET) -update: - -remove: - $(report) header "Removing Tridaycl" - $(rm_link) $(RC_TARGET) - $(rm_link) $(SCRIPTS_TARGET) diff --git a/vim/makefile b/vim/makefile index d997d9e..9492db5 100644 --- a/vim/makefile +++ b/vim/makefile @@ -5,7 +5,22 @@ PLUG_PATH := $(SRC_DIR)/autoload/plug.vim include ../lib/shared.mk -install: | init update +up: init + if (( $$+commands[vim] )) ; then + $(report) header "Upgrading vim" + curl -fsLo $(PLUG_PATH) $(PLUG_URL) \ + ; $(report) "vim plug setup" + vim +PlugInstall +PlugUpdate +PlugClean +qall \ + ; $(report) "downloading/updating plugins" + stty sane # dropping in & out causes some weird tty behavior. + else + $(report) warn "cannot find vim?" + fi + +down: + $(report) header "Removing vim config" + $(rm_link) ~/.vimrc + $(rm_link) $(TARGET_DIR) init: if (( $$+commands[vim] )) ; then @@ -22,20 +37,3 @@ init: $(report) warn "cannot find vim?" fi -update: - if (( $$+commands[vim] )) ; then - $(report) header "Upgrading vim" - curl -fsLo $(PLUG_PATH) $(PLUG_URL) \ - ; $(report) "vim plug setup" - vim +PlugInstall +PlugUpdate +PlugClean +qall \ - ; $(report) "downloading/updating plugins" - stty sane # dropping in & out causes some weird tty behavior. - else - $(report) warn "cannot find vim?" - fi - - -remove: - $(report) header "Removing vim config" - $(rm_link) ~/.vimrc - $(rm_link) $(TARGET_DIR) diff --git a/waybar/makefile b/waybar/makefile index 5e70a54..81a629a 100644 --- a/waybar/makefile +++ b/waybar/makefile @@ -4,7 +4,17 @@ SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) include ../lib/shared.mk TARGET := $(XDG_DIR)/waybar -install: | init update +up: init + if (( $$+commands[swaymsg] )) ; then + $(report) header "Reloading waybar" + swaymsg reload ; $(report) "sway reload" + else + $(report) debug "swaymsg not installed. Skipping." + fi + +down: + $(report) header "Removing waybar" + $(rm_link) $(TARGET) init: if (( $$+commands[waybar] )) ; then @@ -13,15 +23,3 @@ init: else $(report) debug "waybar not installed. Skipping." fi - -update: - if (( $$+commands[swaymsg] )) ; then - $(report) header "Reloading waybar" - swaymsg reload ; $(report) "sway reload" - else - $(report) debug "swaymsg not installed. Skipping." - fi - -remove: - $(report) header "Removing waybar" - $(rm_link) $(TARGET) diff --git a/zsh/makefile b/zsh/makefile index c52976b..27cdd4f 100644 --- a/zsh/makefile +++ b/zsh/makefile @@ -5,7 +5,27 @@ include ../lib/shared.mk ZSH_DIR := ~/.zsh ZPLUG_DIR := ~/.zplug -install: | init update +up: init + if [ ! -d $(ZPLUG_DIR) ] ; then + $(report) error "$(ZPLUG_DIR) doesn't exist - run init first." + return + fi + $(report) header "Updating zplug" + source $(ZPLUG_DIR)/init.zsh + source $(ZSH_DIR)/zplug + export zplugs + zplug install + zplug update ; $(report) "zplug upate" + zplug clean ; $(report) "zplug cleaned" + +down: + rm -rf $(ZPLUG_DIR) ; $(report) "deleting zplug dir" + $(rm_link) ~/.zprofile + $(rm_link) ~/.zlogin + $(rm_link) ~/.zshrc + $(rm_link) ~/.zsh + $(rm_link) ~/.zshenv + $(rm_link) ~/.zlogout init: $(info => Setting up zsh) @@ -28,25 +48,3 @@ init_zplug: git clone https://github.com/zplug/zplug $(ZPLUG_DIR) \ ; $(report) "zplug installed" - -update: - if [ ! -d $(ZPLUG_DIR) ] ; then - $(report) error "$(ZPLUG_DIR) doesn't exist - run init first." - return - fi - $(report) header "Updating zplug" - source $(ZPLUG_DIR)/init.zsh - source $(ZSH_DIR)/zplug - export zplugs - zplug install - zplug update ; $(report) "zplug upate" - zplug clean ; $(report) "zplug cleaned" - -remove: - rm -rf $(ZPLUG_DIR) ; $(report) "deleting zplug dir" - $(rm_link) ~/.zprofile - $(rm_link) ~/.zlogin - $(rm_link) ~/.zshrc - $(rm_link) ~/.zsh - $(rm_link) ~/.zshenv - $(rm_link) ~/.zlogout From 47eb4d062f628097811a158e4e5f325ef5eb9eea Mon Sep 17 00:00:00 2001 From: James Patrick Date: Wed, 5 Jan 2022 23:13:29 -0500 Subject: [PATCH 23/25] I Msipsell wrods somtimes --- lib/shared.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/shared.mk b/lib/shared.mk index 8f4bcac..c8a0317 100644 --- a/lib/shared.mk +++ b/lib/shared.mk @@ -19,7 +19,7 @@ mk_link := $(LIB_DIR)/helper/mk_link rm_link := $(LIB_DIR)/helper/rm_link report := LAST_RETURN=$$? $(LIB_DIR)/helper/report -# Shortcut for the XDG dir if it exist. default to ~/.confg +# Shortcut for the XDG dir if it exist. default to ~/.config XDG_DIR := $${XDG_CONFIG_HOME:-~/.config} From b5bdc49d47b573b810528bae3d2d28d1775c8a29 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Wed, 5 Jan 2022 23:14:20 -0500 Subject: [PATCH 24/25] Some work sideproject and actually use this mode. Its not much but I'm pretty stoked. --- emacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/init.el b/emacs/init.el index 8d0a189..188a8fe 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -146,7 +146,7 @@ ;;idris ; a language you can depend on (json ; At least it ain't XML +lsp) - ;;(java +meghanada) ; the poster child for carpal tunnel syndrome + (java +meghanada) ; the poster child for carpal tunnel syndrome (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) (json +lsp) ;;julia ; a better, faster MATLAB From 3556761ebde269cec8679f8ff542149574c6a9d1 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Wed, 5 Jan 2022 23:15:17 -0500 Subject: [PATCH 25/25] Changed how the mktemp trick work. This way actually has a couple of advantages. 1. With this you write something like $ _ vim file.xml. This is automatically drop you into a tmp dir then run the vim command. 2. zsh completions aren't still work. --- zsh/modules/alias/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/modules/alias/init.zsh b/zsh/modules/alias/init.zsh index 5ce7dbb..f0cbe24 100644 --- a/zsh/modules/alias/init.zsh +++ b/zsh/modules/alias/init.zsh @@ -15,7 +15,7 @@ alias docker="sudo docker" alias dc="sudo docker-compose" # Goes to a temp folder. This will be deleted on restart. -alias tmp="cd $(mktemp -d)" +alias _="cd `mktemp -d` ; " alias :q="exit"