From af65cb8121883c4531459753eda690c439ee213f Mon Sep 17 00:00:00 2001 From: "J. Lewis" <6710419+lewxdev@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:57:38 -0400 Subject: [PATCH] chore: initial commit starting fresh, fully rewriting the project from scratch --- .gitignore | 2 - .prettierrc | 4 - .vscode/extensions.json | 8 - .vscode/settings.json | 24 --- README.md | 27 --- git/commit-template | 16 -- git/gitconfig | 45 ----- hyper/hyper.js | 314 ----------------------------------- install-help.txt | 32 ---- install.zsh | 258 ---------------------------- oh-my-zsh/preferences.zsh | 98 ----------- src/aliases/applications.zsh | 27 --- src/aliases/clis.zsh | 4 - src/aliases/directories.zsh | 9 - src/bin/getnet | 52 ------ src/bin/hr | 40 ----- src/bin/pre | 107 ------------ src/functions/cdls.zsh | 15 -- src/functions/mkcd.zsh | 15 -- src/scripts/cdls.py | 45 ----- src/scripts/mkcd.py | 39 ----- src/startup.zsh | 6 - vscode/settings.jsonc | 134 --------------- zsh/zshrc | 98 ----------- 24 files changed, 1419 deletions(-) delete mode 100644 .gitignore delete mode 100644 .prettierrc delete mode 100644 .vscode/extensions.json delete mode 100644 .vscode/settings.json delete mode 100644 README.md delete mode 100644 git/commit-template delete mode 100644 git/gitconfig delete mode 100644 hyper/hyper.js delete mode 100644 install-help.txt delete mode 100755 install.zsh delete mode 100644 oh-my-zsh/preferences.zsh delete mode 100644 src/aliases/applications.zsh delete mode 100644 src/aliases/clis.zsh delete mode 100644 src/aliases/directories.zsh delete mode 100755 src/bin/getnet delete mode 100755 src/bin/hr delete mode 100755 src/bin/pre delete mode 100644 src/functions/cdls.zsh delete mode 100644 src/functions/mkcd.zsh delete mode 100755 src/scripts/cdls.py delete mode 100755 src/scripts/mkcd.py delete mode 100644 src/startup.zsh delete mode 100644 vscode/settings.jsonc delete mode 100644 zsh/zshrc diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5ca0973..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store - diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0ab5242..0000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -printWidth: 80 -tabWidth: 2 -trailingComma: none -useTabs: false diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 6696955..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,8 +0,0 @@ -// Learn more https://go.microsoft.com/fwlink/?LinkId=827846 -{ - "recommendations": [ - "bmalehorn.shell-syntax", - "redhat.vscode-yaml", - "streetsidesoftware.code-spell-checker" - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 4b12684..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "files.associations": { - ".prettierrc": "yaml", - "commit-template": "git-commit" - }, - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true, - - "json.schemas": [ - { - "fileMatch": ["vscode/settings.jsonc"], - "url": "vscode://schemas/settings/user" - } - ], - - "yaml.schemas": { - "https://json.schemastore.org/prettierrc.json": ".prettierrc" - }, - - "[plaintext]": { - "editor.rulers": [70] - } -} diff --git a/README.md b/README.md deleted file mode 100644 index fdd2398..0000000 --- a/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Development Environment Configurations - -**@[lewxdev](https://github.com/lewxdev)'s dotfiles** - -Contains an infrequently updated repository of configuration dotfiles for programs and environments on a macOS based system. An initializing shell script installs all necessary dependencies on a new or recently refreshed system. - -The following implementation is comprised solely of personal preferences. - -## Installation / Usage - -The following command will clone the dotfiles repository to the home directory and run the installation script: - -```shell -git clone https://github.com/lewxdev/dotfiles.git ~/dotfiles && cd ~/dotfiles && ./install.zsh -``` - -Provided no arguments, the installation script will run through the setup process in its entirety. However, for testing or tweaking after the initial installation process, arguments can be provided for specifying which procedure are run. See [install-help.txt](install-help.txt) or run `./install.zsh --help` - -## Smart Symlinks - -Any valid file in the repository[^1] can generate a symlink as long as a valid designator is found. Essentially a comment in the head of the file which points to where to create the symbolic link. Consider the following example for a JavaScript file "application_config.js": - -```js -// DEST:~/config/.application_config.js -``` - -[^1]: Files and folders with preceding "."—hidden/dotfiles, or any file in the "src" directory are ignored diff --git a/git/commit-template b/git/commit-template deleted file mode 100644 index 18208b6..0000000 --- a/git/commit-template +++ /dev/null @@ -1,16 +0,0 @@ -# DEST:~/.commit-template -# -# Guided commit message template -# learn more: https://cbea.ms/git-commit/ -# also see: https://www.freshconsulting.com/atomic-commits/ -# -# Summarize changes in 50 characters or less (use imperative mood) - - -# (Optional) provide a detailed explanation, focus on the "why" rather -# than the "how", and address potential consequences - - -# (Optional) provide references to an issue tracker (if applicable) -# GitHub uses the keywords (close(s|d)?|fix(es|ed)?|resolve(s|d)?) -# learn more: https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword diff --git a/git/gitconfig b/git/gitconfig deleted file mode 100644 index 1278699..0000000 --- a/git/gitconfig +++ /dev/null @@ -1,45 +0,0 @@ -# DEST:~/.gitconfig - -[user] - name = J. Lewis - email = 6710419+lewxdev@users.noreply.github.com - signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGfHRIgsMtzS02D77/sXvBdXjaf+bmVJss4ifaWSZBhO - -[core] - editor = code --wait - -[init] - defaultBranch = main - -[commit] - gpgsign = true - template = ~/.commit-template - -[push] - autoSetupRemote = true - -[gpg] - format = ssh -[gpg "ssh"] - program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign - -[url "git@github.com:lewxdev/"] - insteadOf = gh:@/ - insteadOf = github:@/ -[url "git@github.com:"] - insteadOf = gh: - insteadOf = github: -[url "git@gist.github.com:"] - insteadOf = gist: -[url "https://github.com/lewxdev/"] - insteadOf = gh://@/ - insteadOf = github://@/ -[url "https://github.com/"] - insteadOf = gh:// - insteadOf = github:// -[url "https://gist.github.com/"] - insteadOf = gist:// - -# learn more: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases -[alias] - get-origin = remote get-url origin diff --git a/hyper/hyper.js b/hyper/hyper.js deleted file mode 100644 index 1043d6f..0000000 --- a/hyper/hyper.js +++ /dev/null @@ -1,314 +0,0 @@ -// DEST:~/.hyper.js - -// @ts-check -// Configuration flags: https://hyper.is/#cfg - -/** @type {Config} */ -module.exports = { - config: { - backgroundColor: "#181a1ff0", - bell: false, - borderColor: "#353944", - // source: https://hyper.is/store/hyper-one-dark/source?index.js - colors: { - black: "#000000", - red: "#e06c75", - green: "#98c379", - yellow: "#d19a66", - blue: "#56b6c2", - magenta: "#c678dd", - cyan: "#56b6c2", - white: "#d0d0d0", - lightBlack: "#808080", - lightRed: "#e06c75", - lightGreen: "#98c379", - lightYellow: "#d19a66", - lightBlue: "#56b6c2", - lightMagenta: "#c678dd", - lightCyan: "#56b6c2" - }, - copyOnSelect: false, - css: ` - .line { - justify-content: center; - padding: 1.5em 0; - font-weight: 100; - } - `, - cursorAccentColor: "#000000", - cursorBlink: true, - cursorColor: "#ffffffff", - cursorShape: "BLOCK", - defaultSSHApp: true, - env: {}, - fontFamily: "'PowerlineSymbols', 'ProFontIIx', monospace", - fontSize: 16, - fontWeight: "normal", - fontWeightBold: "bold", - foregroundColor: "#ffffff", - letterSpacing: 0, - lineHeight: 1, - macOptionSelectionMode: "vertical", - padding: "16px", - preserveCWD: true, - quickEdit: false, - scrollback: 5000, - selectionColor: "#ffffff40", - shell: "/bin/zsh", - shellArgs: ["--login"], - termCSS: "", - uiFontFamily: "-apple-system, BlinkMacSystemFont, Segoe UI, Roboto", - updateChannel: "stable", - webGLRenderer: false, - windowSize: [1200, 700], - - hyperline: { - // Add plugins in display order (from left to right) - plugins: [ - "spotify", - "hostname", - "ip", - "network", - "memory", - "Uptime", - "cpu", - "battery" - ] - } - }, - - plugins: [], - - localPlugins: [], - - keymaps: {} -}; - -/** - * @typedef Config - * @property {ConfigOptions=} config - * - * @property {string[]=} plugins - * a list of plugins to fetch and install from npm - * - * format: `"[@org/]project[#version]"` - * - * examples: - * - `"hyperpower"` - * - `"@company/project"` - * - `"project#1.0.1"` - * - * @property {string[]=} localPlugins - * in development, you can create a directory under `plugins/local/` and include - * it here to load it and avoid it being `npm install`ed - * - * @see {@link https://github.com/vercel/hyper/blob/master/app/keymaps/linux.json} - * @property {Record=} keymaps - * example: - * - "window:devtools": "cmd+alt+o", - */ - -/** - * @see {@link https://github.com/vercel/hyper/blob/canary/lib/config.d.ts#L22} - * @typedef ConfigOptions - * - * @property {boolean | string} autoUpdatePlugins - * if `true` (default), Hyper will update plugins every 5 hours you can also set - * it to a custom time e.g. `"1d"` or `"2h"` - * - * @property {string} backgroundColor - * terminal background color (opacity is only supported on macOS) - * - * @property {"SOUND" | false} bell - * Supported Options: - * - `"SOUND"` enables the bell as a sound - * - `false` turns off the bell - * - * @property {string | null} bellSound - * base64 encoded string of the sound file to use for the bell if null, the - * default bell will be used - * - * @property {string | null} bellSoundURL - * An absolute file path to a sound file on the machine. - * - * @property {string} borderColor - * border color (window, tabs) - * - * @property {ColorMap} colors - * the full list. if you're going to provide the full color palette, including - * the 6 x 6 color cubes and the grayscale map, just provide an array here - * instead of a color map object - * - * @property {boolean} copyOnSelect - * if `true` selected text will automatically be copied to the clipboard - * - * @property {string} css - * custom CSS to embed in the main window - * - * @property {string} cursorAccentColor - * terminal text color under BLOCK cursor - * - * @property {boolean} cursorBlink - * set to `true` for blinking cursor - * - * @property {string} cursorColor - * terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) - * - * @property {"BEAM" | "UNDERLINE" | "BLOCK"} cursorShape - * `"BEAM"` for |, `"UNDERLINE"` for _, `"BLOCK"` for █ - * - * @property {boolean} defaultSSHApp - * if `true` hyper will be set as the default protocol client for SSH - * - * @property {boolean} disableAutoUpdates - * if `true` hyper will not check for updates - * - * @property {boolean} disableLigatures - * if `false` Hyper will use ligatures provided by some fonts - * - * @property {Record} env - * for environment variables - * - * @property {string} fontFamily - * font family with optional fallbacks - * - * @property {number} fontSize - * default font size in pixels for all tabs - * - * @property {FontWeight} fontWeight - * default font weight eg: `"normal"`, `"400"`, `"bold"` - * - * @property {FontWeight} fontWeightBold - * font weight for bold characters eg: `"normal"`, `"600"`, `"bold"` - * - * @property {string} foregroundColor - * color of the text - * - * @property {boolean} imageSupport - * Whether to enable Sixel and iTerm2 inline image protocol support or not. - * - * @property {number} letterSpacing - * letter spacing as a relative unit - * - * @property {number} lineHeight - * line height as a relative unit - * - * @property {string} macOptionSelectionMode - * choose either `"vertical"`, if you want the column mode when Option key is - * hold during selection (default) or `"force"`, if you want to force selection - * regardless of whether the terminal is in mouse events mode (inside tmux or - * vim with mouse mode enabled for example). - * - * @property {{ altIsMeta: boolean, cmdIsMeta: boolean }=} modifierKeys - * - * @property {string} padding - * custom padding (CSS format, i.e.: `top right bottom left` or `top horizontal - * bottom` or `vertical horizontal` or `all`) - * - * @property {boolean} preserveCWD - * set to true to preserve working directory when creating splits or tabs - * - * @property {boolean} quickEdit - * if `true` on right click selected text will be copied or pasted if no - * selection is present (`true` by default on Windows and disables the context - * menu feature) - * - * @property {boolean} screenReaderMode - * set to true to enable screen reading apps (like NVDA) to read the contents of - * the terminal - * - * @property {number} scrollback - * - * @property {string} selectionColor - * terminal selection color - * - * @property {string} shell - * the shell to run when spawning a new session (e.g. /usr/local/bin/fish) - * if left empty, your system's login shell will be used by default - * - * Windows - * - Make sure to use a full path if the binary name doesn't work - * - Remove `--login` in shellArgs - * - * Windows Subsystem for Linux (WSL) - previously Bash on Windows - * - Example: `C:\\Windows\\System32\\wsl.exe` - * - * Git-bash on Windows - * - Example: `C:\\Program Files\\Git\\bin\\bash.exe` - * - * PowerShell on Windows - * - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe` - * - * Cygwin - * - Example: `C:\\cygwin64\\bin\\bash.exe` - * - * Git Bash - * - Example: `C:\\Program Files\\Git\\git-cmd.exe` - * Then Add `--command=usr/bin/bash.exe` to shellArgs - * - * @property {string[]} shellArgs - * for setting shell arguments (e.g. for using interactive shellArgs: `["-i"]`) - * by default `["--login"]` will be used - * - * @property {boolean | ""} showHamburgerMenu - * if you're using a Linux setup which show native menus, set to `false` - * - * default: `true` on Linux, `true` on Windows, ignored on macOS - * - * @property {boolean | "left" | ""} showWindowControls - * set to `false` if you want to hide the minimize, maximize and close buttons - * - * additionally, set to `"left"` if you want them on the left, like in Ubuntu - * - * default: `true` on Windows and Linux, ignored on macOS - * - * @property {string} termCSS - * custom CSS to embed in the terminal window - * - * @property {string=} uiFontFamily - * - * @property {"stable" | "canary"} updateChannel - * choose either `"stable"` for receiving highly polished, or `"canary"` for - * less polished but more frequent updates - * - * @property {boolean=} useConpty - * - * @property {boolean} webGLRenderer - * Whether to use the WebGL renderer. Set it to false to use canvas-based - * rendering (slower, but supports transparent backgrounds) - * - * @property {"ctrl" | "alt" | "meta" | "shift" | ""} webLinksActivationKey - * keypress required for weblink activation: [ctrl | alt | meta | shift] - * - * @property {[number, number]=} windowSize - * Initial window size in pixels - * - * @property {string} workingDirectory - * set custom startup directory (must be an absolute path) - */ - -/** - * @see {@link https://github.com/vercel/hyper/blob/canary/lib/config.d.ts#L3} - * @typedef ColorMap - * @property {string} black - * @property {string} blue - * @property {string} cyan - * @property {string} green - * @property {string} lightBlack - * @property {string} lightBlue - * @property {string} lightCyan - * @property {string} lightGreen - * @property {string} lightMagenta - * @property {string} lightRed - * @property {string} lightWhite - * @property {string} lightYellow - * @property {string} magenta - * @property {string} red - * @property {string} white - * @property {string} yellow - */ - -/** - * @see {@link https://github.com/xtermjs/xterm.js/blob/master/typings/xterm.d.ts#L16} - * @typedef {"normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | number} FontWeight - */ diff --git a/install-help.txt b/install-help.txt deleted file mode 100644 index f46f499..0000000 --- a/install-help.txt +++ /dev/null @@ -1,32 +0,0 @@ -An executable shell script (zsh) that initializes a new macOS machine -for development with a configurable/complete set of preferred -applications installations and general configurations - -usage: ./install.zsh [options] - -options: - --help, -h Display this message and exit - - --brew Installs and/or updates Homebrew - (learn more: https://brew.sh/) - - --brew-formulae Installs provided formula identifiers - (see: $BREW_FORMULAE) - - --brew-casks Installs provided cask identifiers - (see: $BREW_CASKS) - - --brew-cask-drivers Installs provided cask driver identifiers - (see: $BREW_CASK_DRIVERS) - - --vscode-extensions Installs provided extension identifiers - (see: $VSCODE_EXTENSIONS) - - --omz Installs and/or updates Oh My Zsh - (learn more: https://ohmyz.sh/) - - --omz-plugins Installs provided plugins for Oh My Zsh - (see: $INSTALL_URIS) - - --symlinks Creates symbolic links from all valid files to - the respective dotfiles diff --git a/install.zsh b/install.zsh deleted file mode 100755 index 6b69f89..0000000 --- a/install.zsh +++ /dev/null @@ -1,258 +0,0 @@ -#!/bin/zsh - -# Help message -# this can definitely be done better, but idfk how to do that rn -if (( $@[(I)--help|-h] )); then - echo "$(cat install-help.txt)" && exit -elif ! (( $@[(I)--help|-h|--brew|--brew-formulae|--brew-casks|--brew-cask-drivers|--vscode-extensions|--omz|--omz-plugins|--symlinks] )); then - echo "unknown option\n\n$(cat install-help.txt)" && exit -fi - -# Installation identifiers - -local BREW_FORMULAE=( - "android-platform-tools" - "figlet" - "gh" - "imagemagick" - "node" - "nvm" - "pnpm" -) - -local BREW_CASKS=( - "1password" - "1password/tap/1password-cli" - "affinity-designer" - "cleanmymac" - "discord" - "docker" - "google-chrome" - "google-drive" - "hyper" - "loopback" - "notion" - "replacicon" - "shureplus-motiv" - "slack" - "spotify" - "via" - "visual-studio-code" - "zoom" -) - -local BREW_CASK_DRIVERS=( - "canon-eos-webcam-utility" - "logi-options-plus" -) - -local VSCODE_EXTENSIONS=( - "alexperronnet.spectrum-vscode-icons" - "dbaeumer.vscode-eslint" - "eamodio.gitlens" - "esbenp.prettier-vscode" - "figma.figma-vscode-extension" - "github.vscode-pull-request-github" - "icrawl.discord-vscode" - "joelcrosby.one-dark-darker" - "ms-vsliveshare.vsliveshare" - "pflannery.vscode-versionlens" - "rangav.vscode-thunder-client" - "redhat.vscode-yaml" - "ritwickdey.liveserver" - "streetsidesoftware.code-spell-checker" - "wallabyjs.quokka-vscode" - "wix.vscode-import-cost" - "yoavbls.pretty-ts-errors" -) - -declare -rA INSTALL_URIS=( - [homebrew]="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh" - [omz]="https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/HEAD/tools/install.sh" - [zsh_syntax_highlighting]="https://github.com/zsh-users/zsh-syntax-highlighting.git" -) - -colorize() { echo $(./src/bin/pre $2 -c $1); } -input() { read -qs "?$(colorize blue dotfiles) $@ (y/N) "; } -output() { if [[ $# -gt 0 ]]; then echo -e "$(colorize blue dotfiles)" "$@"; else echo; fi; } - -# Homebrew installation -# see: https://github.com/Homebrew/install/blob/master/README.md -if (( $@[(I)--brew] )) || [[ $# -eq 0 ]]; then - output "Checking if Homebrew is installed..." - which -s brew &>/dev/null - - if [[ $? != 0 ]]; then - output "Homebrew installation couldn't be found. Attempting install..." - NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL ${INSTALL_URIS[homebrew]})" && \ - brew update - else - output "Homebrew already installed. Attempting update..." - brew update - fi - output -fi - -# Homebrew formulae installation -if (( $@[(I)--brew-formulae] )) || [[ $# -eq 0 ]]; then - output "Installing Homebrew formulae..." - - for formula in ${BREW_FORMULAE[@]}; do - local prefix=$(colorize cyan $formula) - - if input $prefix "Homebrew formula will install or upgrade, proceed?"; then - >&2 echo $REPLY - if brew list $formula &>/dev/null; then - output $prefix "Homebrew formula already installed. Attempting upgrade..." - brew upgrade $formula - else - output $prefix "Installing Homebrew formula..." - brew install $formula - fi - else - >&2 echo $REPLY - fi - done - output -fi - -# Homebrew casks installation -if (( $@[(I)--brew-casks] )) || [[ $# -eq 0 ]]; then - output "Installing Homebrew casks..." - - for cask in ${BREW_CASKS[@]}; do - local prefix=$(colorize cyan $cask) - - if input $prefix "Homebrew cask will install or upgrade, proceed?"; then - >&2 echo $REPLY - if ! brew info $cask &>/dev/null; then - output $prefix "Homebrew cask already installed. Attempting upgrade..." - brew upgrade $cask - else - output $prefix "Installing Homebrew cask..." - brew install --cask $cask - fi - else - >&2 echo $REPLY - fi - done - output -fi - -# Homebrew cask drivers installation -if (( $@[(I)--brew-cask-drivers] )) || [[ $# -eq 0 ]]; then - brew tap homebrew/cask-drivers - output "Installing Homebrew cask-drivers..." - - for cask_driver in ${BREW_CASK_DRIVERS[@]}; do - local prefix=$(colorize cyan $cask_driver) - - if input $prefix "Homebrew cask-driver will install or upgrade, proceed?"; then - >&2 echo $REPLY - if brew list $cask_driver &>/dev/null; then - output $prefix "Homebrew cask-driver already installed. Attempting upgrade..." - brew upgrade $cask_driver - else - output $prefix "Installing Homebrew cask-driver..." - brew install $cask_driver - fi - else - >&2 echo $REPLY - fi - done - output -fi - -# Visual Studio Code extensions installation -if (( $@[(I)--vscode-extensions] )) || [[ $# -eq 0 ]]; then - output "Installing Visual Studio Code extensions..." - - # At this point, VS Code should have been installed by Homebrew - # Extensions can be installed via the "code" command (made available here) - alias code="/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" - which -s code &>/dev/null - - if [[ $? != 0 ]]; then - output "Couldn't find \"code\" command (is Visual Studio Code installed?)." - output "Skipping extension installation." - else - for extension_id in ${VSCODE_EXTENSIONS[@]}; do - local prefix=$(colorize cyan $extension_id) - - if input $prefix "Proceed with extension installation?"; then - >&2 echo $REPLY - if code --list-extensions | grep "$extension_id" &>/dev/null; then - output $prefix "Extension already installed." - else - output $prefix "Attempting extension install..." - code --install-extension $extension_id - fi - else - >&2 echo $REPLY - fi - done - fi - output -fi - -# Oh My Zsh installation -if (( $@[(I)--omz] )) || [[ $# -eq 0 ]]; then - output "Checkiing if Oh My Zsh is installed..." - - if [[ -d $ZSH ]]; then - output "Oh My Zsh is already installed. Attempting upgrade..." - $ZSH/tools/upgrade.sh - else - output "Oh My Zsh installation couldn't be found. Attempting install..." - sh -c "$(curl -fsSL ${INSTALL_URIS[omz]})" - fi - output -fi - -# Oh My Zsh plugins installation -if (( $@[(I)--omz-plugins] )) || [[ $# -eq 0 ]]; then - output "Attempting Oh My Zsh plugin installations..." - - # https://github.com/zsh-users/zsh-syntax-highlighting/ - local target_dir=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting - if [[ -d $target_dir ]]; then - output "Oh My Zsh plugin: \"zsh-syntax-highlighting\" is already installed." - else - git clone ${INSTALL_URIS[zsh_syntax_highlighting]} $target_dir - fi - output -fi - -# Configuration files setup -if (( $@[(I)--symlinks] )) || [[ $# -eq 0 ]]; then - output "Installing symlinks to configuration files..." - - for file in $(find . -type f ! \( -path "./.*" -o -path "./src/*" \)); do - reference=$(echo "$(head -2 $file)" | grep -o "DEST:.*" | sed "s/DEST://") - reference_path="${reference/\~/$HOME}" - file_path="${file/\./$PWD}" - - if ! [[ -z "$reference" ]]; then - output "Linking configuration file: $file -> $reference..." - - if [[ "$file_path" -ef "$reference_path" ]]; then - output "Symlink to \"$file\" already exists." - else - ln -sf "$file_path" "$reference_path" - fi - fi - done - output -fi - -for count in {29..0}; do - echo -ne "$(colorize blue dotfiles) Process complete, refreshing... ($count)\033[0K\r" - sleep 1 -done - -unset colorize -unset input -unset output - -# Complete installation with the welcome screen :) -source ~/.zshrc diff --git a/oh-my-zsh/preferences.zsh b/oh-my-zsh/preferences.zsh deleted file mode 100644 index b5ae51e..0000000 --- a/oh-my-zsh/preferences.zsh +++ /dev/null @@ -1,98 +0,0 @@ -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -ZSH_THEME="bureau" - -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment one of the following lines to change the auto-update behavior -# zstyle ':omz:update' mode disabled # disable automatic updates -# zstyle ':omz:update' mode auto # update automatically without asking -zstyle ':omz:update' mode reminder # just remind me to update when it's time - -# Uncomment the following line to change how often to auto-update (in days). -# zstyle ':omz:update' frequency 13 - -# Uncomment the following line if pasting URLs and other text is messed up. -# DISABLE_MAGIC_FUNCTIONS="true" - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# You can also set it to another string to have that shown instead of the default red dots. -# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" -# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? -# Standard plugins can be found in $ZSH/plugins/ -# Custom plugins may be added to $ZSH_CUSTOM/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=( - git - zsh-syntax-highlighting -) - -source $ZSH/oh-my-zsh.sh - -# User configuration - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/src/aliases/applications.zsh b/src/aliases/applications.zsh deleted file mode 100644 index a6085b7..0000000 --- a/src/aliases/applications.zsh +++ /dev/null @@ -1,27 +0,0 @@ -# Application aliases - -# Native macOS applications... - -alias chrome="open ${DIR[APPS]}/Google\ Chrome.app" -alias logi="open ${DIR[APPS]}/Logi\ Options+.app" -alias slack="open ${DIR[APPS]}/Slack.app" -alias spotify="open ${DIR[APPS]}/Spotify.app" -alias zoom="open ${DIR[APPS]}/zoom.us.app" - -# Chrome applications (Progressive Web Apps / Shortcuts)... - -# Developer -alias devdocs="open ${DIR[PWA]}/DevDocs.app" -alias mui="open ${DIR[PWA]}/MUI.app" - -# Google -alias calendar="open ${DIR[PWA]}/Google\ Calendar.app" -alias drive="open ${DIR[PWA]}/Google\ Drive.app" -alias gmail="open ${DIR[PWA]}/Gmail.app" -alias meet="open ${DIR[PWA]}/Google\ Meet.app" -alias messages="open ${DIR[PWA]}/Messages.app" -alias photos="open ${DIR[PWA]}/Google\ Photos.app" -alias youtube="open ${DIR[PWA]}/YouTube.app" - -# Misc -alias soundcloud="open ${DIR[PWA]}/SoundCloud.app" diff --git a/src/aliases/clis.zsh b/src/aliases/clis.zsh deleted file mode 100644 index 87b3911..0000000 --- a/src/aliases/clis.zsh +++ /dev/null @@ -1,4 +0,0 @@ -# CLI aliases - -# See https://www.chromium.org/developers/how-tos/run-chromium-with-flags/ -alias chrome-cli="${APP[CHROME]}/Contents/MacOS/Google\ Chrome" diff --git a/src/aliases/directories.zsh b/src/aliases/directories.zsh deleted file mode 100644 index 10becf1..0000000 --- a/src/aliases/directories.zsh +++ /dev/null @@ -1,9 +0,0 @@ -# Google -alias chrome/apps="cdls \"${DIR[PWA]}/\"" - -# Documents -alias docs/="cdls \"${DIR[DOCS]}/\"" -alias dl/="cdls \"${DIR[DL]}/\"" -alias dl/docs="cdls \"${DIR[DL]}/Documents/\"" -alias dl/imgs="cdls \"${DIR[DL]}/Images/\"" -alias dl/misc="cdls \"${DIR[DL]}/Misc/\"" diff --git a/src/bin/getnet b/src/bin/getnet deleted file mode 100755 index 7cb7d7c..0000000 --- a/src/bin/getnet +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -from argparse import ArgumentParser -from subprocess import Popen, PIPE - -""" -`getnet` command -Returns a specified available property of the currently connected -network (its SSID by default). -""" - - -def do_getnet(property: str): - AIRPORT_PATH = "/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport" - process = Popen((AIRPORT_PATH, "-I"), stdout=PIPE) - output, error = process.communicate() - process.wait() - - network_properties = {} - for line in output.decode("utf-8").strip().split("\n"): - key, value = map(lambda text: text.strip(), line.split(":")) - network_properties[key] = value - - if not error: - value = network_properties.get(property) - if value: - print(value) - else: - raise SystemExit(f"Error: Couldn't get property \"{property}\"") - else: - raise SystemExit("Error: Something went wrong :(") - - -def get_cli_args(): - """Process the provided command-line arguments and return a valid - Namespace for the CLI - """ - - parser = ArgumentParser(description="Gets a property of connected network") - - parser.add_argument( - "property", - default="SSID", - help="The property of the currently connected network to retrieve", - nargs="?" - ) - - return parser.parse_args() - - -if __name__ == "__main__": - ns = get_cli_args() - do_getnet(ns.property) diff --git a/src/bin/hr b/src/bin/hr deleted file mode 100755 index 18f43aa..0000000 --- a/src/bin/hr +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -from argparse import ArgumentParser -from os import get_terminal_size - -""" -`hr` command -Prints a horizontal rule (hr) on the terminal with optionally specified -length and symbol. Provides helpful visual for long custom CLI programs. -""" - - -def create_hr(symbol: str, quantifier: int = None): - return symbol * (quantifier or get_terminal_size().columns // len(symbol)) - - -def get_cli_args(): - """Process the provided command-line arguments and return a valid - Namespace for the CLI - """ - - parser = ArgumentParser(description="Produces visual horizontal rule (hr)") - - parser.add_argument( - "--symbol", "-s", - default="-", - help="The string / symbol to build a horizontal rule with", - ) - - parser.add_argument( - "--quantifier", "-q", - help="The number of repeats of the provided symbol", - type=int - ) - - return parser.parse_args() - - -if __name__ == "__main__": - ns = get_cli_args() - print(create_hr(ns.symbol, ns.quantifier)) diff --git a/src/bin/pre b/src/bin/pre deleted file mode 100755 index 9d40585..0000000 --- a/src/bin/pre +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python3 -from argparse import ArgumentParser -from enum import Enum - -""" -`pre` command -Returns a zsh-ready string for CLI prefixes (colored names surrounded by square -brackets "[]"). Helps denote command output and info from custom CLIs in large -programs. -""" - - -# Color scheme via: -# https://chrisyeh96.github.io/2020/03/28/terminal-colors.html#my-preferred-color-scheme -class COLOR_SCHEME: - class Color(str, Enum): - BLACK = "black" - GRAY = "gray" - RED = "red" - GREEN = "green" - YELLOW = "yellow" - BLUE = "blue" - MAGENTA = "magenta" - CYAN = "cyan" - WHITE = "white" - LIGHT_RED = "light-red" - LIGHT_GREEN = "light-green" - LIGHT_YELLOW = "light-yellow" - LIGHT_BLUE = "light-blue" - LIGHT_MAGENTA = "light-magenta" - LIGHT_CYAN = "light-cyan" - LIGHT_GRAY = "light-gray" - - def __str__(self): - return self.value - - MAP = { - Color.BLACK: (0, 0, 0), - Color.GRAY: (85, 87, 83), - Color.RED: (204, 0, 0), - Color.GREEN: (78, 154, 6), - Color.YELLOW: (196, 160, 0), - Color.BLUE: (114, 159, 207), - Color.MAGENTA: (117, 80, 123), - Color.CYAN: (6, 152, 154), - Color.WHITE: (255, 255, 255), - Color.LIGHT_RED: (239, 41, 41), - Color.LIGHT_GREEN: (138, 226, 52), - Color.LIGHT_YELLOW: (252, 233, 79), - Color.LIGHT_BLUE: (50, 175, 255), - Color.LIGHT_MAGENTA: (173, 127, 168), - Color.LIGHT_CYAN: (52, 226, 226), - Color.LIGHT_GRAY: (211, 215, 207), - } - - -def create_sequence(text: str, *params: int, - color: COLOR_SCHEME.Color = None, reset: bool = True): - """Creates a simple ANSI escape sequence for terminal coloring - [Learn more](https://en.wikipedia.org/wiki/ANSI_escape_code) - """ - - color_params = (38, 2, *COLOR_SCHEME.MAP[color]) if color else None - parsed_params = ";".join(map(lambda p: f"{p}", color_params or params)) - reset_suffix = r"\e[0m" if reset else "" - - return rf"\e[{parsed_params}m{text}{reset_suffix}" - - -def get_cli_args(): - """Process the provided command-line arguments and return a valid - Namespace for the CLI - """ - - parser = ArgumentParser(description="Produces output prefixes for CLI") - parser.add_argument("name", nargs="+", help="The name of the program") - params = parser.add_mutually_exclusive_group(required=True) - - params.add_argument( - "--params", "-p", - help="Numeric parameters to pass to the ANSI escape sequence", - nargs="+", - type=int - ) - - color_choices = tuple(COLOR_SCHEME.Color) - options_str = ", ".join(map(lambda color: f"\"{color}\"", color_choices)) - params.add_argument( - "--color", "-c", - choices=color_choices, - help=f"The identifier of the color to use. One of: {options_str}.", - metavar="", - type=COLOR_SCHEME.Color - ) - - return parser.parse_args() - - -if __name__ == "__main__": - ns = get_cli_args() - output_name = create_sequence( - " ".join(ns.name), - *(ns.params or ()), - color=ns.color - ) - - print(rf"[{output_name}]") diff --git a/src/functions/cdls.zsh b/src/functions/cdls.zsh deleted file mode 100644 index 028875e..0000000 --- a/src/functions/cdls.zsh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/zsh - -# Performs a `cd` and `ls` in sequence on the given directory -# (with optional arguments to the `ls` command). -cdls() { - local output=$(python3 ${DIR[SHS]}/cdls.py "$@") - - if [[ $? -eq 0 ]]; then - if [[ $output =~ "^cd " ]]; then - eval $output - elif [[ $output =~ "^usage:" ]]; then - printf $output - fi - fi -} diff --git a/src/functions/mkcd.zsh b/src/functions/mkcd.zsh deleted file mode 100644 index 6cff164..0000000 --- a/src/functions/mkcd.zsh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/zsh - -# Performs a `mkdir` and `cd` in sequence on the given directory -# (with optional arguments to the `mkdir` command). -mkcd() { - local output=$(python3 ${DIR[SHS]}/mkcd.py "$@") - - if [[ $? -eq 0 ]]; then - if [[ $output =~ "^mkdir " ]]; then - eval $output - elif [[ $output =~ "^usage:" ]]; then - printf $output - fi - fi -} diff --git a/src/scripts/cdls.py b/src/scripts/cdls.py deleted file mode 100755 index e9ae791..0000000 --- a/src/scripts/cdls.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 -from argparse import ArgumentParser, REMAINDER -from pathlib import Path - -""" -`cdls` command -Produces a command for performing a `cd` and `ls` in sequence on the -given directory (with optional arguments to append to the `ls` command). -""" - - -def get_cdls(path: str, *args: str): - real_path = Path(path) - - if real_path.is_dir(): - ls_args = " ".join((*args, ".")) - print(f"cd {real_path} && ls {ls_args}") - else: - raise SystemExit(f"Error: Unable to find path: \"{path}\"") - - -def get_cli_args(): - """Process the provided command-line arguments and return a valid - Namespace for the CLI - """ - - parser = ArgumentParser(description="Performs a `cd` / `ls` sequence") - - parser.add_argument( - "path", - help="The relative or absolute path of the directory to navigate to" - ) - - parser.add_argument( - "arguments", - help="Arguments to pass directly to the subsequent `ls` command", - nargs=REMAINDER - ) - - return parser.parse_args() - - -if __name__ == "__main__": - ns = get_cli_args() - get_cdls(ns.path, *ns.arguments) diff --git a/src/scripts/mkcd.py b/src/scripts/mkcd.py deleted file mode 100755 index 7352939..0000000 --- a/src/scripts/mkcd.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -from argparse import ArgumentParser, REMAINDER - -""" -`mkcd` command -Produces a command for performing a `mkdir` and `cd` in sequence on the -given directory. (with optional arguments to append to the `mkdir` command) -""" - - -def get_mkcd(dirname: str, *args: str): - mkdir_args = " ".join((*args, dirname)) - print(f"mkdir {mkdir_args} && cd {dirname}") - - -def get_cli_args(): - """Process the provided command-line arguments and return a valid - Namespace for the CLI - """ - - parser = ArgumentParser(description="Performs a `mkdir` / `cd` sequence") - - parser.add_argument( - "dirname", - help="The name of the directory to create/move to" - ) - - parser.add_argument( - "arguments", - help="Arguments to pass directly to the subsequent `ls` command", - nargs=REMAINDER - ) - - return parser.parse_args() - - -if __name__ == "__main__": - ns = get_cli_args() - get_mkcd(ns.dirname, *ns.arguments) diff --git a/src/startup.zsh b/src/startup.zsh deleted file mode 100644 index 958013f..0000000 --- a/src/startup.zsh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/zsh - -# A brief startup script which shows a splash / welcome screen with the current uptime -clear -figlet -f slscript welcome -echo "$(date +"%A %d %B %Y") @$(uptime | cut -d"," -f 1 -f 2)\n" diff --git a/vscode/settings.jsonc b/vscode/settings.jsonc deleted file mode 100644 index 9d4b8fd..0000000 --- a/vscode/settings.jsonc +++ /dev/null @@ -1,134 +0,0 @@ -// DEST:~/Library/Application Support/Code/User/settings.json - -{ - "breadcrumbs.enabled": false, - - "cSpell.userWords": [ - "dotenv", - "dotfiles", - "freepik", - "iosevka", - "lewxdev", - "mixins", - "pinterest", - "venv", - "verbage" - ], - - "editor.bracketPairColorization.enabled": false, - "editor.cursorStyle": "block-outline", - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.detectIndentation": true, - "editor.fontFamily": "'Iosevka Idios', 'Monaco', monospace", - "editor.fontLigatures": true, - "editor.fontSize": 20, - "editor.fontWeight": "500", - "editor.formatOnSave": true, - "editor.insertSpaces": true, - "editor.lineNumbers": "interval", - "editor.minimap.enabled": false, - "editor.occurrencesHighlight": false, - "editor.renderWhitespace": "trailing", - "editor.rulers": [80, 100], - "editor.tabSize": 2, - - "emmet.includeLanguages": { - "django-html": "html" - }, - - "explorer.compactFolders": false, - "explorer.confirmDelete": false, - "explorer.confirmDragAndDrop": false, - "explorer.incrementalNaming": "smart", - - "files.autoSave": "afterDelay", - "files.enableTrash": false, - "files.hotExit": "off", - "files.insertFinalNewline": true, - "files.simpleDialog.enable": true, - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true, - - "javascript.updateImportsOnFileMove.enabled": "always", - - "jupyter.askForKernelRestart": false, - "jupyter.interactiveWindowMode": "perFile", - - "liveServer.settings.donotShowInfoMsg": true, - "liveServer.settings.donotVerifyTags": true, - - "python.defaultInterpreterPath": "~/.pyenv/versions/3.9.0/bin/python", - "python.experiments.optOutFrom": ["pythonDeprecatePythonPath"], - "python.languageServer": "Pylance", - "python.linting.flake8Enabled": true, - "python.pythonPath": "~/.pyenv/versions/3.9.0/bin/python", - "python.showStartPage": false, - "python.venvFolders": ["~/.local/share/virtualenvs"], - - "redhat.telemetry.enabled": false, - - "remote.SSH.remotePlatform": { - "MORPHEUS/local": "linux", - "MORPHEUS/remote": "linux" - }, - "remote.SSH.useLocalServer": false, - - "security.workspace.trust.untrustedFiles": "open", - - "task.problemMatchers.neverPrompt": { - "shell": true - }, - - "terminal.explorerKind": "external", - "terminal.external.osxExec": "~/Applications/Hyper.app", - "terminal.integrated.cursorBlinking": true, - "terminal.integrated.fontSize": 16, - "terminal.integrated.tabs.enabled": true, - - "window.openFoldersInNewWindow": "on", - "window.restoreWindows": "folders", - "window.zoomLevel": 2, - - "workbench.colorCustomizations": { - "activityBar.background": "#14161a", - "activityBar.border": "#353944", - "button.background": "#272a32", - "editor.background": "#14161a", - "editor.lineHighlightBackground": "#14161a", - "editor.lineHighlightBorder": "#353944", - "editorIndentGuide.activeBackground": "#25282e", - "editorIndentGuide.background": "#212329", - "list.activeSelectionBackground": "#14161a", - "list.focusAndSelectionOutline": "#353944", - "list.focusOutline": "#353944", - "list.hoverBackground": "#101114", - "list.inactiveSelectionBackground": "#212329", - "sideBar.background": "#14161a", - "sideBar.border": "#353944", - "sideBarSectionHeader.background": "#14161a", - "statusBar.border": "#353944", - "tab.activeBackground": "#14161a", - "tab.hoverBackground": "#101114", - "titleBar.border": "#353944" - }, - "workbench.colorTheme": "One Dark Darker", - "workbench.editor.tabCloseButton": "off", - "workbench.editor.untitled.hint": "hidden", - "workbench.fontAliasing": "antialiased", - "workbench.iconTheme": "spectrum-vscode-icons", - "workbench.settings.editor": "json", - "workbench.startupEditor": "newUntitledFile", - - "[django-html]": { - "editor.defaultFormatter": "vscode.html-language-features" - }, - - "[json]": { - "editor.defaultFormatter": "vscode.json-language-features" - }, - - "[python]": { - "editor.rulers": [72, 79], - "editor.tabSize": 4 - } -} diff --git a/zsh/zshrc b/zsh/zshrc deleted file mode 100644 index 715bc49..0000000 --- a/zsh/zshrc +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/zsh -# DEST:~/.zshrc - -# Environment constants... - -# An associative array of common directories -# accessed like "${DIR[KEY]}" -declare -xrA DIR=( - # Applications - [APPS]=/Applications - [PWAS]=~/Applications/Chrome\ Apps.localized - - # Documents - [DESK]=~/Desktop - [DLS]=~/Downloads - [DOCS]=~/Documents - - # Developer Modules - [DEV]=~/Developer - [DOTF]=~/dotfiles - [SHM]=~/dotfiles/src - [SHB]=~/dotfiles/src/bin - [SHS]=~/dotfiles/src/scripts -) - -# Paths, etc. -local VSCBIN=${DIR[APPS]}/Visual\ Studio\ Code.app/Contents/Resources/app/bin -export PATH=$PATH:$VSCBIN -export EDITOR="code --wait" -export SSH_AUTH_SOCK=~/.1password/agent.sock - -# Conditional setup... -# Allows for multi-device usage where some utilities are not available -# or configured in the same way as other devices - -# 1password -if mdfind -name kMDItemFSName=="1Password.app" | grep . &>/dev/null; then - local OP_DIR=~/.1password - if ! [[ -d $OP_DIR ]]; then - mkdir $OP_DIR - ln -s ~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock $OP_DIR/agent.sock - fi - - export SSH_AUTH_SOCK=$OP_DIR/agent.sock - - local OP_PLUGINS=~/.config/op/plugins.sh - if [[ -e $OP_PLUGINS ]]; then - source $OP_PLUGINS - fi -fi - -# direnv -if which direnv &>/dev/null; then - eval "$(direnv hook zsh)" - - # we provide our own initial logs - export DIRENV_LOG_FORMAT="" -fi - -# homebrew (latest) -local BREW_EXEC=/opt/homebrew/bin/brew -if [[ -x $BREW_EXEC ]]; then - eval "$(/opt/homebrew/bin/brew shellenv)" -fi - -# oh-my-zsh -local OMZ_DIR=~/.oh-my-zsh -if [[ -d $OMZ_DIR ]]; then - export ZSH=$OMZ_DIR - source ${DIR[DOTF]}/oh-my-zsh/preferences.zsh -fi - -# pyenv -local PYENV_DIR=~/.pyenv -if [[ -d $PYENV_DIR ]]; then - export PYENV=$PYENV_DIR - export PATH=$PYENV/bin:$PATH - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" -fi - -# Source customizations... - -# Ensure all files in "src/bin" are executable -for bin in $(find ${DIR[SHB]} -type f -not -name "*.*"); do - if [[ ! -x $bin ]]; then - chmod +x $bin - fi -done -export PATH=${DIR[SHB]}:$PATH - -# Source all custom functions, aliases, etc. -for module in $(find ${DIR[SHM]} -type f -name "*.zsh"); do - # Added a conditional to ignore certain files w/ designator - if [[ ! $(head -2 $module) =~ "^# SOURCE-IGNORE$" ]]; then - source $module - fi -done