diff options
author | Jacob Janzen <jjanzenn@proton.me> | 2024-08-09 22:11:23 -0500 |
---|---|---|
committer | Jacob Janzen <jjanzenn@proton.me> | 2024-08-09 22:11:23 -0500 |
commit | e6e8ebe10aa40e5a3be2b94cdf3b324f3d3e52e0 (patch) | |
tree | aca3b279520b76d918ce603d47981f1d23dbd1af | |
parent | 40f02bc8088ca93224bf65f083c4ab3b17eaf435 (diff) |
split-dotfiles
-rw-r--r-- | common/.config/emacs/feed.org (renamed from gentoo/.config/emacs/feed.org) | 0 | ||||
-rw-r--r-- | common/.config/emacs/force-custom-file.org (renamed from gentoo/.config/emacs/force-custom-file.org) | 0 | ||||
-rw-r--r-- | common/.config/emacs/init.org (renamed from gentoo/.config/emacs/init.org) | 0 | ||||
-rw-r--r-- | common/.config/emacs/languages.org (renamed from gentoo/.config/emacs/languages.org) | 0 | ||||
-rw-r--r-- | common/.config/emacs/package-setup.org (renamed from gentoo/.config/emacs/package-setup.org) | 0 | ||||
-rw-r--r-- | common/.config/emacs/tools.org (renamed from gentoo/.config/emacs/tools.org) | 4 | ||||
-rw-r--r-- | common/.config/emacs/user-interface.org (renamed from gentoo/.config/emacs/user-interface.org) | 11 | ||||
-rw-r--r-- | common/.config/fastfetch/config.org (renamed from gentoo/.config/fastfetch/config.org) | 0 | ||||
-rw-r--r-- | common/.config/nvim/init.org (renamed from gentoo/.config/nvim/init.org) | 5 | ||||
-rw-r--r-- | common/.config/nvim/lua/appearance.org (renamed from gentoo/.config/nvim/lua/appearance.org) | 2 | ||||
-rw-r--r-- | common/.config/nvim/lua/behaviour.org (renamed from gentoo/.config/nvim/lua/behaviour.org) | 0 | ||||
-rw-r--r-- | common/.config/nvim/lua/plugins.org (renamed from gentoo/.config/nvim/lua/plugins.org) | 0 | ||||
-rw-r--r-- | common/.local/share/fonts/ComputerModern.tar.gz (renamed from gentoo/.local/share/fonts/ComputerModern.tar.gz) | bin | 6553600 -> 6553600 bytes | |||
-rw-r--r-- | common/.local/share/fonts/NFM.tar.gz (renamed from gentoo/.local/share/fonts/NFM.tar.gz) | bin | 2150400 -> 2150400 bytes | |||
-rw-r--r-- | common/.local/share/fonts/SauceCodePro.tar.gz (renamed from gentoo/.local/share/fonts/SauceCodePro.tar.gz) | bin | 90941440 -> 90941440 bytes | |||
-rw-r--r-- | common/.wallpaper | bin | 0 -> 14122059 bytes | |||
-rw-r--r-- | common/clang-format.org | 9 | ||||
-rw-r--r-- | common/gitconfig.org | 18 | ||||
l--------- | gentoo/.config/emacs | 1 | ||||
l--------- | gentoo/.config/fastfetch | 1 | ||||
l--------- | gentoo/.config/nvim | 1 | ||||
l--------- | gentoo/.local/share/fonts | 1 | ||||
l---------[-rw-r--r--] | gentoo/.wallpaper | bin | 14122059 -> 20 bytes | |||
l---------[-rw-r--r--] | gentoo/clang-format.org | 10 | ||||
l---------[-rw-r--r--] | gentoo/gitconfig.org | 19 | ||||
-rw-r--r-- | gentoo/install | 58 | ||||
-rw-r--r-- | gentoo/install.org | 93 | ||||
-rwxr-xr-x | install | 67 | ||||
-rw-r--r-- | macos/.config/alacritty/alacritty.org | 55 | ||||
l--------- | macos/.config/emacs | 1 | ||||
l--------- | macos/.config/fastfetch | 1 | ||||
l--------- | macos/.config/nvim | 1 | ||||
-rw-r--r-- | macos/.config/skhd/skhdrc.org | 80 | ||||
-rw-r--r-- | macos/.config/yabai/yabairc.org | 63 | ||||
-rw-r--r-- | macos/.local/bin/launcher.org | 13 | ||||
l--------- | macos/.local/share/fonts | 1 | ||||
-rw-r--r-- | macos/.ssh/config.org | 12 | ||||
l--------- | macos/.wallpaper | 1 | ||||
-rw-r--r-- | macos/Applications/Emacs.app/Contents/MacOS/Emacs.org | 7 | ||||
-rw-r--r-- | macos/Library/LaunchAgents/gnu.emacs.daemon.org | 23 | ||||
l--------- | macos/clang-format.org | 1 | ||||
l--------- | macos/gitconfig.org | 1 | ||||
-rw-r--r-- | macos/profile.org | 7 | ||||
-rw-r--r-- | macos/zshrc.org | 106 |
44 files changed, 490 insertions, 183 deletions
diff --git a/gentoo/.config/emacs/feed.org b/common/.config/emacs/feed.org index 9cf8cb6..9cf8cb6 100644 --- a/gentoo/.config/emacs/feed.org +++ b/common/.config/emacs/feed.org diff --git a/gentoo/.config/emacs/force-custom-file.org b/common/.config/emacs/force-custom-file.org index 8b8a418..8b8a418 100644 --- a/gentoo/.config/emacs/force-custom-file.org +++ b/common/.config/emacs/force-custom-file.org diff --git a/gentoo/.config/emacs/init.org b/common/.config/emacs/init.org index 7eec368..7eec368 100644 --- a/gentoo/.config/emacs/init.org +++ b/common/.config/emacs/init.org diff --git a/gentoo/.config/emacs/languages.org b/common/.config/emacs/languages.org index a0a19e4..a0a19e4 100644 --- a/gentoo/.config/emacs/languages.org +++ b/common/.config/emacs/languages.org diff --git a/gentoo/.config/emacs/package-setup.org b/common/.config/emacs/package-setup.org index 6ed238c..6ed238c 100644 --- a/gentoo/.config/emacs/package-setup.org +++ b/common/.config/emacs/package-setup.org diff --git a/gentoo/.config/emacs/tools.org b/common/.config/emacs/tools.org index 54da2b4..488378e 100644 --- a/gentoo/.config/emacs/tools.org +++ b/common/.config/emacs/tools.org @@ -98,8 +98,8 @@ Set up fonts. Don't use =monospace= by default. Do use it where necessary though #+begin_src emacs-lisp :tangle ~/.config/emacs/tools.el :mkdirp yes (add-hook 'org-mode-hook 'variable-pitch-mode) (custom-set-faces - '(variable-pitch ((t (:family "CMU Serif" :height 130 :weight thin)))) - '(fixed-pitch ((t (:family "SauceCodePro Nerd Font" :height 110 :weight regular)))) + '(variable-pitch ((t :font "CMU Serif-18:weight=thin"))) + '(fixed-pitch ((t :font "SauceCodePro Nerd Font-14:weight=regular"))) '(org-block ((t (:inherit fixed-pitch)))) '(org-code ((t (:inherit (shadow fixed-pitch))))) '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch))))) diff --git a/gentoo/.config/emacs/user-interface.org b/common/.config/emacs/user-interface.org index b5a860d..77ae0e2 100644 --- a/gentoo/.config/emacs/user-interface.org +++ b/common/.config/emacs/user-interface.org @@ -3,10 +3,11 @@ * Theming Set the default font to the Source Code Pro nerd font variant. I use size 14 font. #+begin_src emacs-lisp :tangle ~/.config/emacs/user-interface.el :mkdirp yes - (set-face-attribute 'default t :font "Sauce Code Pro Nerd Font-14") + (add-to-list 'default-frame-alist + '(font . "SauceCodePro Nerd Font-14")) #+end_src -Use my custom Emacs theme. +Use the Doom Nord light theme. #+begin_src emacs-lisp :tangle ~/.config/emacs/user-interface.el :mkdirp yes (use-package doom-themes :straight (doom-themes :type git :host github :repo "doomemacs/themes" @@ -27,6 +28,12 @@ Use =doom-modeline= for a nicer modeline. :init (doom-modeline-mode 1)) #+end_src +Remove the titlebar. +#+begin_src emacs-lisp :tangle ~/.config/emacs/user-interface.el :mkdirp yes + (add-to-list 'default-frame-alist '(undecorated . t)) +#+end_src + + * Clean UI Disable the Emacs start screen and make the =scratch= buffer default to empty. #+begin_src emacs-lisp :tangle ~/.config/emacs/user-interface.el :mkdirp yes diff --git a/gentoo/.config/fastfetch/config.org b/common/.config/fastfetch/config.org index 7a2d099..7a2d099 100644 --- a/gentoo/.config/fastfetch/config.org +++ b/common/.config/fastfetch/config.org diff --git a/gentoo/.config/nvim/init.org b/common/.config/nvim/init.org index 9c15739..0f7dffa 100644 --- a/gentoo/.config/nvim/init.org +++ b/common/.config/nvim/init.org @@ -6,6 +6,11 @@ Disable timeout to speed things up. vim.cmd([[set notimeout]]) #+end_src +Fix unable to open swap file issue. +#+begin_src lua :tangle ~/.config/nvim/init.lua :mkdirp yes + vim.cmd([[set directory=~/.local/share/nvim/swap//]]) +#+end_src + Install plugins in the [[./lua/plugins.org][plugins.lua]] file. #+begin_src lua :tangle ~/.config/nvim/init.lua :mkdirp yes require('plugins') diff --git a/gentoo/.config/nvim/lua/appearance.org b/common/.config/nvim/lua/appearance.org index 274f438..1f1d534 100644 --- a/gentoo/.config/nvim/lua/appearance.org +++ b/common/.config/nvim/lua/appearance.org @@ -7,7 +7,7 @@ Use line numbers. Turn on syntax highlighting. #+begin_src lua :tangle ~/.config/nvim/lua/appearance.lua :mkdirp yes vim.cmd([[ - set termguicolors + set notermguicolors syntax on colorscheme default set background=light diff --git a/gentoo/.config/nvim/lua/behaviour.org b/common/.config/nvim/lua/behaviour.org index 871b65e..871b65e 100644 --- a/gentoo/.config/nvim/lua/behaviour.org +++ b/common/.config/nvim/lua/behaviour.org diff --git a/gentoo/.config/nvim/lua/plugins.org b/common/.config/nvim/lua/plugins.org index f3027f9..f3027f9 100644 --- a/gentoo/.config/nvim/lua/plugins.org +++ b/common/.config/nvim/lua/plugins.org diff --git a/gentoo/.local/share/fonts/ComputerModern.tar.gz b/common/.local/share/fonts/ComputerModern.tar.gz Binary files differindex f84d106..f84d106 100644 --- a/gentoo/.local/share/fonts/ComputerModern.tar.gz +++ b/common/.local/share/fonts/ComputerModern.tar.gz diff --git a/gentoo/.local/share/fonts/NFM.tar.gz b/common/.local/share/fonts/NFM.tar.gz Binary files differindex b862584..b862584 100644 --- a/gentoo/.local/share/fonts/NFM.tar.gz +++ b/common/.local/share/fonts/NFM.tar.gz diff --git a/gentoo/.local/share/fonts/SauceCodePro.tar.gz b/common/.local/share/fonts/SauceCodePro.tar.gz Binary files differindex d3451f3..d3451f3 100644 --- a/gentoo/.local/share/fonts/SauceCodePro.tar.gz +++ b/common/.local/share/fonts/SauceCodePro.tar.gz diff --git a/common/.wallpaper b/common/.wallpaper Binary files differnew file mode 100644 index 0000000..e67150d --- /dev/null +++ b/common/.wallpaper diff --git a/common/clang-format.org b/common/clang-format.org new file mode 100644 index 0000000..6c38b3b --- /dev/null +++ b/common/clang-format.org @@ -0,0 +1,9 @@ +#+title: Clang-Format Settings +Use a style similar to Linux kernel style (but with 4-wide indents and spaces over tabs). +#+begin_src yaml :tangle ~/.clang-format +BasedOnStyle: LLVM +IndentWidth: 4 +BreakBeforeBraces: Linux +AllowShortIfStatementsOnASingleLine: false +IndentCaseLabels: false +#+end_src diff --git a/common/gitconfig.org b/common/gitconfig.org new file mode 100644 index 0000000..c907204 --- /dev/null +++ b/common/gitconfig.org @@ -0,0 +1,18 @@ +#+title: Git Configuration +Define my full name and email. +#+begin_src conf :tangle ~/.gitconfig + [user] + name = Jacob Janzen + email = jjanzenn@proton.me +#+end_src +Use =main= over =master=. +#+begin_src conf :tangle ~/.gitconfig + [init] + defaultBranch = main +#+end_src + +Make =pull= rebase on conflict. +#+begin_src conf :tangle ~/.gitconfig + [pull] + rebase = true +#+end_src diff --git a/gentoo/.config/emacs b/gentoo/.config/emacs new file mode 120000 index 0000000..f4e5e56 --- /dev/null +++ b/gentoo/.config/emacs @@ -0,0 +1 @@ +../../common/.config/emacs
\ No newline at end of file diff --git a/gentoo/.config/fastfetch b/gentoo/.config/fastfetch new file mode 120000 index 0000000..a73d684 --- /dev/null +++ b/gentoo/.config/fastfetch @@ -0,0 +1 @@ +../../common/.config/fastfetch
\ No newline at end of file diff --git a/gentoo/.config/nvim b/gentoo/.config/nvim new file mode 120000 index 0000000..a0abd03 --- /dev/null +++ b/gentoo/.config/nvim @@ -0,0 +1 @@ +../../common/.config/nvim
\ No newline at end of file diff --git a/gentoo/.local/share/fonts b/gentoo/.local/share/fonts new file mode 120000 index 0000000..9ab89c4 --- /dev/null +++ b/gentoo/.local/share/fonts @@ -0,0 +1 @@ +../../../common/.local/share/fonts
\ No newline at end of file diff --git a/gentoo/.wallpaper b/gentoo/.wallpaper Binary files differindex e67150d..ec41b94 100644..120000 --- a/gentoo/.wallpaper +++ b/gentoo/.wallpaper diff --git a/gentoo/clang-format.org b/gentoo/clang-format.org index 6c38b3b..960b79e 100644..120000 --- a/gentoo/clang-format.org +++ b/gentoo/clang-format.org @@ -1,9 +1 @@ -#+title: Clang-Format Settings -Use a style similar to Linux kernel style (but with 4-wide indents and spaces over tabs). -#+begin_src yaml :tangle ~/.clang-format -BasedOnStyle: LLVM -IndentWidth: 4 -BreakBeforeBraces: Linux -AllowShortIfStatementsOnASingleLine: false -IndentCaseLabels: false -#+end_src +../common/clang-format.org
\ No newline at end of file diff --git a/gentoo/gitconfig.org b/gentoo/gitconfig.org index c907204..e4e5534 100644..120000 --- a/gentoo/gitconfig.org +++ b/gentoo/gitconfig.org @@ -1,18 +1 @@ -#+title: Git Configuration -Define my full name and email. -#+begin_src conf :tangle ~/.gitconfig - [user] - name = Jacob Janzen - email = jjanzenn@proton.me -#+end_src -Use =main= over =master=. -#+begin_src conf :tangle ~/.gitconfig - [init] - defaultBranch = main -#+end_src - -Make =pull= rebase on conflict. -#+begin_src conf :tangle ~/.gitconfig - [pull] - rebase = true -#+end_src +../common/gitconfig.org
\ No newline at end of file diff --git a/gentoo/install b/gentoo/install deleted file mode 100644 index 09b2efd..0000000 --- a/gentoo/install +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh - -mv ~/.update-home.log ~/.update-home.log.old - -if ! test -d ~/.dotfiles; then - echo Installing dotfiles... - git clone git@git.sr.ht:~jjanzen/.dotfiles ~/.dotfiles >> ~/.update-home.log -fi - -CWD=$(pwd) -cd ~/.dotfiles || exit - -{ - git stash - git checkout main - git pull --rebase -} >> ~/.update-home.log - -if ! diff ~/.dotfiles/install ~/.local/bin/update-home >> ~/.update-home.log; then - cp ~/.dotfiles/install ~/.local/bin/update-home || exit 1 - echo Changes have been made to the install script. - echo Running the new install script. - chmod +x ~/.local/bin/update-home - ~/.local/bin/update-home - exit -fi - -echo Installing configuration files... -find -- . -type f -name "*.org" | while read -r file; do - emacs --batch "${file}" -f package-initialize --eval '(org-babel-tangle)' >> ~/.update-home.log -done - -echo Installing wallpaper... -cp .wallpaper ~/.wallpaper - -fonts_changed=false -if ! test -d ~/.local/share/fonts/ComputerModern; then - echo Computer Modern font missing. Installing... - tar xf ~/.dotfiles/.local/share/fonts/ComputerModern.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log - fonts_changed=true -fi -if ! test -f ~/.local/share/fonts/NFM.ttf; then - echo Nerd Font Mono font missing. Installing... - tar xf ~/.dotfiles/.local/share/fonts/NFM.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log - fonts_changed=true -fi -if ! test -d ~/.local/share/fonts/SauceCodePro; then - echo Source Code Pro Nerd Font missing. Installing... - tar xf ~/.dotfiles/.local/share/fonts/SauceCodePro.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log - fonts_changed=true -fi - -if [ $fonts_changed = true ]; then - echo Updating the font cache... - fc-cache -f >> ~/.update-home.log -fi - -cd "${CWD}" || exit diff --git a/gentoo/install.org b/gentoo/install.org deleted file mode 100644 index 9a9c0aa..0000000 --- a/gentoo/install.org +++ /dev/null @@ -1,93 +0,0 @@ -#+title: Install Script - -This can be run as =./install=, so make it explicit what binary to run it with (POSIX shell). -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - #!/bin/sh -#+end_src - -Save the old log file. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - mv ~/.update-home.log ~/.update-home.log.old -#+end_src - -Install the dotfiles repository at =~/.dotfiles= if it doesn't already exist. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - if ! test -d ~/.dotfiles; then - echo Installing dotfiles... - git clone git@git.sr.ht:~jjanzen/.dotfiles ~/.dotfiles >> ~/.update-home.log - fi -#+end_src - -POSIX shell doesn't have =pushd= and =popd=. We do it manually by saving the current path before moving to =~/.dotfiles=. Exit if the =cd= call fails (it shouldn't). -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - CWD=$(pwd) - cd ~/.dotfiles || exit -#+end_src - -Stash any existing changes before moving to the main branch and pulling any new changes from the remote. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - { - git stash - git checkout main - git pull --rebase - } >> ~/.update-home.log -#+end_src - -If the =update-home= executable has changed, replace it and bootstrap into the new one. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - if ! diff ~/.dotfiles/install ~/.local/bin/update-home >> ~/.update-home.log; then - cp ~/.dotfiles/install ~/.local/bin/update-home || exit 1 - echo Changes have been made to the install script. - echo Running the new install script. - chmod +x ~/.local/bin/update-home - ~/.local/bin/update-home - exit - fi -#+end_src - -Extract each configuration file from its literate =.org= file into its correct location by running =org-babel-tangle= on each =.org= file. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - echo Installing configuration files... - find -- . -type f -name "*.org" | while read -r file; do - emacs --batch "${file}" -f package-initialize --eval '(org-babel-tangle)' >> ~/.update-home.log - done -#+end_src - -Install the [[./wallpaper.png][wallpaper]] file. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - echo Installing wallpaper... - cp .wallpaper ~/.wallpaper -#+end_src - -Install any missing fonts by extracting the corresponding =tar.gz= archive. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - fonts_changed=false - if ! test -d ~/.local/share/fonts/ComputerModern; then - echo Computer Modern font missing. Installing... - tar xf ~/.dotfiles/.local/share/fonts/ComputerModern.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log - fonts_changed=true - fi - if ! test -f ~/.local/share/fonts/NFM.ttf; then - echo Nerd Font Mono font missing. Installing... - tar xf ~/.dotfiles/.local/share/fonts/NFM.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log - fonts_changed=true - fi - if ! test -d ~/.local/share/fonts/SauceCodePro; then - echo Source Code Pro Nerd Font missing. Installing... - tar xf ~/.dotfiles/.local/share/fonts/SauceCodePro.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log - fonts_changed=true - fi -#+end_src - -If any missing fonts were installed, update the font cache. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - if [ $fonts_changed = true ]; then - echo Updating the font cache... - fc-cache -f >> ~/.update-home.log - fi -#+end_src - -Move the user back to where they came from. -#+begin_src sh :tangle ~/.dotfiles/install :mkdirp yes - cd "${CWD}" || exit -#+end_src @@ -0,0 +1,67 @@ +#!/bin/sh + +echo 'backing up previous log file to ~/.update-home-old.log' +mv ~/.update-home.log ~/.update-home-old.log &>> /dev/null + +if ! test -d ~/.dotfiles; then + echo '.dotfiles should be at ~/.dotfiles; reinstalling dotfiles at ~/.dotfiles...' + git clone git@git.sr.ht:~jjanzen/.dotfiles ~/.dotfiles >> ~/.update-home.log 2>&1 +fi + +echo 'retrieving the latest changes (any unmerged local changes will be stashed)...' +{ + git stash + git checkout main + git pull --rebase +} >> ~/.update-home.log 2>&1 + +CWD=$(pwd) + +if [ "$(uname)" = 'Darwin' ]; then + echo 'detected Mac OS; installing Mac OS configuration...' + cd ~/.dotfiles/macos/ || exit +elif [ "$(uname)" = 'Linux' ] && grep 'ID=gentoo' /etc/os-release; then + echo 'detected Gentoo; installing Gentoo configuration...' + cd ~/.dotfiles/gentoo/ || exit +else + echo 'unsupported operating system' + exit 1 +fi + +echo 'installing configuration files...' +find -- . -type f -name "*.org" | while read -r file; do + echo " installing $file..." + emacs --batch "$file" -f package-initialize --eval '(org-babel-tangle)' >> ~/.update-home.log 2>&1 +done + +echo 'installing wallpaper...' +cp .wallpaper ~/.wallpaper +if [ "$(uname)" = 'Darwin' ]; then + osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"/$HOME/.wallpaper\" as POSIX file" +fi + +echo 'installing fonts...' +fonts_changed=false +mkdir -p ~/.local/share/fonts +if ! test -d ~/.local/share/fonts/ComputerModern; then + echo ' Computer Modern font missing. Installing...' + tar xf .local/share/fonts/ComputerModern.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1 + fonts_changed=true +fi +if ! test -f ~/.local/share/fonts/NFM.ttf; then + echo ' Nerd Font Mono font missing. Installing...' + tar xf .local/share/fonts/NFM.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1 + fonts_changed=true +fi +if ! test -d ~/.local/share/fonts/SauceCodePro; then + echo ' Source Code Pro Nerd Font missing. Installing...' + tar xf .local/share/fonts/SauceCodePro.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1 + fonts_changed=true +fi + +if [ $fonts_changed = true ]; then + echo ' updating the font cache...' + fc-cache -f >> ~/.update-home.log +fi + +cd "$CWD" || exit diff --git a/macos/.config/alacritty/alacritty.org b/macos/.config/alacritty/alacritty.org new file mode 100644 index 0000000..992ed63 --- /dev/null +++ b/macos/.config/alacritty/alacritty.org @@ -0,0 +1,55 @@ +#+title: Alacritty Configuration + +Remove window decorations. +#+begin_src conf :tangle ~/.config/alacritty/alacritty.toml :mkdirp yes + [window] + decorations = "None" +#+end_src + +Make the window slightly transparent. +#+begin_src conf :tangle ~/.config/alacritty/alacritty.toml :mkdirp yes + opacity = 0.9 +#+end_src + +Add slight padding around the text. +#+begin_src conf :tangle ~/.config/alacritty/alacritty.toml :mkdirp yes + padding = { x = 6, y = 6 } +#+end_src + +Allow use of option as an alt key on Mac OS. +#+begin_src conf :tangle ~/.config/alacritty/alacritty.toml :mkdirp yes + option_as_alt = "Both" +#+end_src + +Use the same font as normal. +#+begin_src conf :tangle ~/.config/alacritty/alacritty.toml :mkdirp yes + [font] + normal = { family = "SauceCodePro Nerd Font", style = "Regular" } + size = 14 +#+end_src + +#+begin_src conf :tangle ~/.config/alacritty/alacritty.toml :mkdirp yes + [colors.primary] + background = '#ece0c9' + foreground = '#191916' + + [colors.normal] + black = '#191916' + red = '#ac4438' + green = '#354d52' + yellow = '#ba9151' + blue = '#465b91' + magenta = '#5b5489' + cyan = '#4e6062' + white = '#c9ad7a' + + [colors.bright] + black = '#293c3c' + red = '#d8611c' + green = '#4b7b53' + yellow = '#d8974b' + blue = '#2f3d91' + magenta = '#735e82' + cyan = '#6b8f92' + white = '#ece0c9' +#+end_src diff --git a/macos/.config/emacs b/macos/.config/emacs new file mode 120000 index 0000000..f4e5e56 --- /dev/null +++ b/macos/.config/emacs @@ -0,0 +1 @@ +../../common/.config/emacs
\ No newline at end of file diff --git a/macos/.config/fastfetch b/macos/.config/fastfetch new file mode 120000 index 0000000..a73d684 --- /dev/null +++ b/macos/.config/fastfetch @@ -0,0 +1 @@ +../../common/.config/fastfetch
\ No newline at end of file diff --git a/macos/.config/nvim b/macos/.config/nvim new file mode 120000 index 0000000..a0abd03 --- /dev/null +++ b/macos/.config/nvim @@ -0,0 +1 @@ +../../common/.config/nvim
\ No newline at end of file diff --git a/macos/.config/skhd/skhdrc.org b/macos/.config/skhd/skhdrc.org new file mode 100644 index 0000000..0d83fce --- /dev/null +++ b/macos/.config/skhd/skhdrc.org @@ -0,0 +1,80 @@ +#+title: =skhd= Configuration + +Add keybinding to open a terminal emulator. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd - return : /opt/homebrew/bin/alacritty +#+end_src + +Add keybinding for killing a window. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd + shift - q : yabai -m window --close +#+end_src + +Add keybinding for opening an app launcher. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd - d : ~/.local/bin/launcher +#+end_src + +Add keybinding for reloading the configuration. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd + shift - c : yabai --restart-service && skhd --restart-service +#+end_src + +Change focus keybindings. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd - h : yabai -m window --focus west || yabai -m display --focus west + cmd - j : yabai -m window --focus south || yabai -m display --focus south + cmd - k : yabai -m window --focus north || yabai -m display --focus north + cmd - l : yabai -m window --focus east || yabai -m display --focus east +#+end_src + +Move window keybindings. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + shift + cmd - h : yabai -m window --warp west + shift + cmd - j : yabai -m window --warp south + shift + cmd - k : yabai -m window --warp north + shift + cmd - l : yabai -m window --warp east +#+end_src + +Change workspace keybindings. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd - 1 : yabai -m space --focus 1 + cmd - 2 : yabai -m space --focus 2 + cmd - 3 : yabai -m space --focus 3 + cmd - 4 : yabai -m space --focus 4 + cmd - 5 : yabai -m space --focus 5 + cmd - 6 : yabai -m space --focus 6 + cmd - 7 : yabai -m space --focus 7 + cmd - 8 : yabai -m space --focus 8 + cmd - 9 : yabai -m space --focus 9 + cmd - 0 : yabai -m space --focus 10 +#+end_src + +Move window to workspace keybindings. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd + shift - 1 : yabai -m window --space 1 + cmd + shift - 2 : yabai -m window --space 2 + cmd + shift - 3 : yabai -m window --space 3 + cmd + shift - 4 : yabai -m window --space 4 + cmd + shift - 5 : yabai -m window --space 5 + cmd + shift - 6 : yabai -m window --space 6 + cmd + shift - 7 : yabai -m window --space 7 + cmd + shift - 8 : yabai -m window --space 8 + cmd + shift - 9 : yabai -m window --space 9 + cmd + shift - 0 : yabai -m window --space 10 +#+end_src + +Define full screen keybinding. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd + shift - f : yabai -m window --toggle zoom-fullscreen +#+end_src + +Define toggle floating keybinding. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + cmd + shift - space : yabai -m window --toggle float +#+end_src + +Add screenshot keybinding. +#+begin_src conf :tangle ~/.config/skhd/skhdrc :mkdirp yes + shift + ctrl - s : open /System/Applications/Utilities/Screenshot.app +#+end_src diff --git a/macos/.config/yabai/yabairc.org b/macos/.config/yabai/yabairc.org new file mode 100644 index 0000000..47f728f --- /dev/null +++ b/macos/.config/yabai/yabairc.org @@ -0,0 +1,63 @@ +#+title: Yabai Configuration + +Load script additions automatically. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m signal --add event=dock_did_restart action="sudo /opt/homebrew/bin/yabai --load-sa" + sudo /opt/homebrew/bin/yabai --load-sa +#+end_src + +Tile the windows. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config layout bsp +#+end_src + +Automatically balance window sizes. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config auto_balance on +#+end_src + +Use 10 pixel gaps. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config top_padding 10 + yabai -m config bottom_padding 10 + yabai -m config left_padding 10 + yabai -m config right_padding 10 + yabai -m config window_gap 10 +#+end_src + +Remove window shadows unless the window is floating. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config window_shadow float +#+end_src + +Move mouse to focused window anad focus on the window that the mouse is on. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config focus_follows_mouse autoraise + yabai -m config mouse_follows_focus on +#+end_src + +Control windows if =cmd= is held. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config mouse_modifier cmd +#+end_src + +Move windows with left click. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config mouse_action1 move +#+end_src + +Resize windows with right click. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m config mouse_action2 resize +#+end_src + +Update Positions when the window is dropped. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m mouse_drop_action swap +#+end_src + +Don't manage some apps. +#+begin_src sh :tangle ~/.config/yabai/yabairc :mkdirp yes + yabai -m rule --add app="^System Settings$" manage=off + yabai -m rule --add app="^Calculator$" manage=off +#+end_src diff --git a/macos/.local/bin/launcher.org b/macos/.local/bin/launcher.org new file mode 100644 index 0000000..f74d094 --- /dev/null +++ b/macos/.local/bin/launcher.org @@ -0,0 +1,13 @@ +#+title: Application Launcher Script + +Search several locations for applications with =choose=. +#+begin_src sh :tangle ~/.local/bin/launcher :mkdirp yes :tangle-mode o755 + #!/bin/sh + app="$(ls /Applications/ /Applications/Utilities/ /System/Applications/ /System/Applications/Utilities/ ~/Applications/ | grep '\.app$' | sed 's/\.app$//g' | choose -f "SauceCodePro Nerd Font" -s 15 -b ece0c9).app" +#+end_src + +Try opening the app in each location. +#+begin_src sh :tangle ~/.local/bin/launcher :mkdirp yes :tangle-mode o755 + open -n "$HOME/Applications/$app" || open -n "/Applications/$app" || open -n "/System/Applications/Utilities/$app" || open -n "/System/Applications/$app" || open -n "/Applications/Utilities/$app" + +#+end_src diff --git a/macos/.local/share/fonts b/macos/.local/share/fonts new file mode 120000 index 0000000..9ab89c4 --- /dev/null +++ b/macos/.local/share/fonts @@ -0,0 +1 @@ +../../../common/.local/share/fonts
\ No newline at end of file diff --git a/macos/.ssh/config.org b/macos/.ssh/config.org new file mode 100644 index 0000000..e78c4fb --- /dev/null +++ b/macos/.ssh/config.org @@ -0,0 +1,12 @@ +#+title: SSH Configuration +Keys should be added to the SSH agent. +#+begin_src conf :tangle ~/.ssh/config :mkdirp yes + Host * + UseKeychain yes + AddKeysToAgent yes + IdentityFile ~/.ssh/id_ed25519 + + Host aviary + HostName aviary.cs.umanitoba.ca + User janzenj2 +#+end_src diff --git a/macos/.wallpaper b/macos/.wallpaper new file mode 120000 index 0000000..ec41b94 --- /dev/null +++ b/macos/.wallpaper @@ -0,0 +1 @@ +../common/.wallpaper
\ No newline at end of file diff --git a/macos/Applications/Emacs.app/Contents/MacOS/Emacs.org b/macos/Applications/Emacs.app/Contents/MacOS/Emacs.org new file mode 100644 index 0000000..c46a713 --- /dev/null +++ b/macos/Applications/Emacs.app/Contents/MacOS/Emacs.org @@ -0,0 +1,7 @@ +#+title: Emacs Client Application + +#+begin_src sh :tangle ~/Applications/Emacs.app/Contents/MacOS/Emacs :mkdirp yes :tangle-mode o755 + #!/bin/sh + /opt/homebrew/bin/emacsclient -c &> /dev/null & + disown +#+end_src diff --git a/macos/Library/LaunchAgents/gnu.emacs.daemon.org b/macos/Library/LaunchAgents/gnu.emacs.daemon.org new file mode 100644 index 0000000..f595c93 --- /dev/null +++ b/macos/Library/LaunchAgents/gnu.emacs.daemon.org @@ -0,0 +1,23 @@ +#+title: Emacs Daemon =launchd= Entry + +Create a =launchd= entry for Emacs daemon to run at login. +#+begin_src xml :tangle ~/Library/LaunchAgents/gnu.emacs.daemon.plist :mkdirp yes + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" + "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + <plist version="1.0"> + <dict> + <key>Label</key> + <string>gnu.emacs.daemon</string> + <key>ProgramArguments</key> + <array> + <string>/opt/homebrew/bin/emacs</string> + <string>--daemon</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>ServiceDescription</key> + <string>Gnu Emacs Daemon</string> + </dict> + </plist> +#+end_src diff --git a/macos/clang-format.org b/macos/clang-format.org new file mode 120000 index 0000000..960b79e --- /dev/null +++ b/macos/clang-format.org @@ -0,0 +1 @@ +../common/clang-format.org
\ No newline at end of file diff --git a/macos/gitconfig.org b/macos/gitconfig.org new file mode 120000 index 0000000..e4e5534 --- /dev/null +++ b/macos/gitconfig.org @@ -0,0 +1 @@ +../common/gitconfig.org
\ No newline at end of file diff --git a/macos/profile.org b/macos/profile.org new file mode 100644 index 0000000..2827dd8 --- /dev/null +++ b/macos/profile.org @@ -0,0 +1,7 @@ +#+TITLE: =.profile= Settings +* Path +Add items to the path. +#+begin_src sh :tangle ~/.profile + export PATH="$HOME/.local/share/fzf-zsh-plugin/bin:$HOME/node_modules/.bin:$HOME/gems/bin:$HOME/.local/bin:$HOME/go/bin:$PATH" + export PATH="/Users/jjanzen/Library/Python/3.12/bin:/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:$PATH" +#+end_src diff --git a/macos/zshrc.org b/macos/zshrc.org new file mode 100644 index 0000000..fc261f5 --- /dev/null +++ b/macos/zshrc.org @@ -0,0 +1,106 @@ +#+title: ZSH Configuration +Set up completions. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + zstyle ':completion:*' completer _expand _complete _ignored _approximate + zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' + zstyle :compinstall filename '/home/jjanzen/.zshrc' + autoload -U compinit promptinit + compinit + promptinit +#+end_src + +Set up the history with 1000 entries and ignored duplicate commands. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + HISTFILE=~/.histfile + HISTSIZE=1000 + SAVEHIST=1000 + setopt hist_ignore_all_dups +#+end_src + +Enable automatic =cd=. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + setopt autocd +#+end_src + +Enable extended glob. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + setopt extendedglob +#+end_src + +If a glob returns nothing, don't keep the =*=. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + setopt nullglob +#+end_src + +Report the status of background jobs immediately. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + setopt notify +#+end_src + +Disable the beep. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + unsetopt beep +#+end_src + +Use =vi= keybindings. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + bindkey -v +#+end_src + +Use =lesspipe= back end for =less= if it is installed. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" +#+end_src + +Use =eza= as my =ls= command if it is installed. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + which eza &> /dev/null && alias ls=eza +#+end_src + +Use Neovim as my =vi= and =vim= application if it is installed. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + which nvim &> /dev/null && alias vi=nvim && alias vim=nvim +#+end_src + +If the Firefox binary is called =firefox-bin=, let =firefox= also run =firefox-bin=. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + which firefox-bin &> /dev/null && alias firefox=firefox-bin +#+end_src + +Lazy =ls= shortcuts. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + alias ll='ls -alF' + alias la='ls -a' + alias l='ls -F' + alias sl='ls' +#+end_src + +*** Prompt +Define function to write out icons for the git status. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + parse_git_dirty() { + git_status="$(git status 2> /dev/null)" + [[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f" + [[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f" + [[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f" + [[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f" + } +#+end_src + +Enable git status in the prompt. +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + setopt prompt_subst + autoload -Uz vcs_info + precmd () { vcs_info } + zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main) +#+end_src + +Define the prompt as follows: +- Error code (if applicable) +- Path using =~= for the home directory and truncating if too long +- Git branch +- Git status +- =$= to mark the start of the prompt +#+begin_src sh :tangle ~/.zshrc :mkdirp yes + PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ ' +#+end_src |