diff --git a/.chezmoi.yaml.tmpl b/.chezmoi.yaml.tmpl index c69e426..a1d8aff 100644 --- a/.chezmoi.yaml.tmpl +++ b/.chezmoi.yaml.tmpl @@ -1,18 +1,29 @@ +{{- $encryption := promptBoolOnce . "encryption" "Decrypt the encrypted files with the key passphrase" true -}} +{{- $apps := false -}} +{{- if ne .chezmoi.os "linux" -}} +{{- $apps = promptBoolOnce . "apps" "Install the desktop apps" true -}} +{{- end -}} {{ if eq .chezmoi.os "windows" -}} cd: command: "pwsh" args: ["-NoLogo", "-NoExit", "-Command", "& {Set-Location $env:HOMEPATH/.local/share/chezmoi}"] interpreters: ps1: + # Skip the profile, which needs the tools that the scripts install command: "pwsh" - args: ["-NoLogo"] + args: ["-NoLogo", "-NoProfile"] {{ end -}} +data: + apps: {{ $apps }} + encryption: {{ $encryption }} diff: pager: "delta" edit: command: "nvim" encryption: "age" +# Decrypt with chezmoi's own age on every OS, even where the age command is installed +useBuiltinAge: true age: identity: "{{ .chezmoi.homeDir }}/.chezmoikey.txt" recipient: "age1tqerfm7h83nl3d6ewcmhze8jmndfaaznrt84e8r0cd9rux9l5cwq72c992" diff --git a/.chezmoidata/desktop-apps.toml b/.chezmoidata/desktop-apps.toml new file mode 100644 index 0000000..1d324bd --- /dev/null +++ b/.chezmoidata/desktop-apps.toml @@ -0,0 +1,22 @@ +# The desktop apps that chezmoi installs on macOS and Windows, if you answer yes +# to its prompt, skipping the ones that are already installed. Each app has a +# Homebrew cask or a Mac App Store ID for macOS, and a winget ID or a Microsoft +# Store ID for Windows. Leave them out for an OS that the app isn't on. Find +# more with `brew search`, `mas search` and `winget search`. +desktopApps = [ + # Bitwarden's Safari extension only comes with its Mac App Store app + { name = "Bitwarden", mas = 1352778147, winget = "Bitwarden.Bitwarden" }, + { name = "Docker Desktop", cask = "docker-desktop", winget = "Docker.DockerDesktop" }, + { name = "Ghostty", cask = "ghostty" }, + { name = "Microsoft To Do", mas = 1274495053, msstore = "9NBLGGH5R558" }, + { name = "Nextcloud", cask = "nextcloud", winget = "Nextcloud.NextcloudDesktop" }, + # The new Outlook for Windows, not classic Outlook + { name = "Outlook", winget = "Microsoft.Outlook" }, + { name = "Speedtest by Ookla", mas = 1153157709, winget = "Ookla.Speedtest.Desktop" }, + { name = "TorGuard", cask = "torguard", winget = "VPNetwork.TorGuard" }, + { name = "UniGetUI", winget = "Devolutions.UniGetUI" }, + { name = "Visual Studio Code", cask = "visual-studio-code", winget = "Microsoft.VisualStudioCode" }, + { name = "WireGuard", mas = 1451685025, winget = "WireGuard.WireGuard" }, + # WizTree for macOS isn't in Homebrew's casks, but in Antibody Software's tap + { name = "WizTree", cask = "antibodysw/tap/wiztree", winget = "AntibodySoftware.WizTree" }, +] diff --git a/.chezmoiexternal.toml b/.chezmoiexternal.toml index f945af8..aa3bfbb 100644 --- a/.chezmoiexternal.toml +++ b/.chezmoiexternal.toml @@ -1,8 +1,4 @@ {{ if or (eq .chezmoi.os "darwin") (eq .chezmoi.os "linux") -}} -[".local/share/zsh-nvm"] - type = "git-repo" - url = "https://github.com/lukechilds/zsh-nvm.git" - refreshPeriod = "168h" [".vim/pack/plugins/start/vim-tmux-navigator"] type = "git-repo" url = "https://github.com/christoomey/vim-tmux-navigator.git" diff --git a/.chezmoiignore b/.chezmoiignore index 5ca2e75..3ad4c32 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -4,28 +4,38 @@ reference_dotfiles # windows files {{ if ne .chezmoi.os "windows" -}} -.config/komorebi -.config/whkdrc Documents decrypt-private-key-windows.ps1 -install-windows.ps1 +install-cli-tools-windows.ps1 +install-desktop-apps-windows.ps1 +install-packages-windows.ps1 +{{- end }} + +# macOS files +{{ if ne .chezmoi.os "darwin" -}} +install-desktop-apps-macos.sh {{- end }} # unix files {{ if eq .chezmoi.os "windows" -}} -.config/atuin -.config/bpytop -.config/fzf -.config/tmuxinator .config/zsh .tmux.conf +.zshenv .zshrc decrypt-private-key-unix.sh -install-unix.sh +install-cli-tools-unix.sh +install-packages-unix.sh +{{- end }} + +# encrypted files +{{ if not .encryption -}} +.ssh +decrypt-private-key-unix.sh +decrypt-private-key-windows.ps1 {{- end }} -# linux without WSL files -{{ if or (ne .chezmoi.os "linux") (.chezmoi.kernel.osrelease | lower | contains "microsoft") -}} -.alacritty.toml -.config/zsh/openvpn3.zsh +# desktop apps +{{ if not .apps -}} +install-desktop-apps-macos.sh +install-desktop-apps-windows.ps1 {{- end }} diff --git a/.github/check-nvim.lua b/.github/check-nvim.lua new file mode 100644 index 0000000..668a3ba --- /dev/null +++ b/.github/check-nvim.lua @@ -0,0 +1,172 @@ +-- Checks that Neovim is ready to use the first time it starts after the +-- dotfiles install: lazy.nvim installs the plugins, Mason installs the tools +-- and language servers, nvim-treesitter builds the parsers, and the Python +-- language servers start. The test scripts run it on a new Python file: +-- nvim --headless check.py -S check-nvim.lua +-- It reports what it checked and the problems it finds on stderr, and exits +-- with status 1 if there are any. + +local report = {} ---@type string[] +local function say(message) + report[#report + 1] = message +end + +local problems = {} ---@type string[] +local function problem(message) + problems[#problems + 1] = message +end + +-- Waits until done() returns true, for at most the given number of minutes +local function wait(minutes, done) + return vim.wait(minutes * 60 * 1000, done, 1000) +end + +-- Opening the file already started Mason's installs, so record their errors +-- before they can fail. An error here would stop the check from running, so +-- it's reported instead +local install_errors = {} ---@type table +local watching, watch_error = pcall(function() + require("mason-registry"):on("package:install:failed", function(pkg, err) + install_errors[pkg.name] = type(err) == "string" and err or vim.inspect(err) + end) +end) +if not watching then + problem("Can't watch Mason's installs: " .. watch_error) +end + +local function check_plugins() + local count, installed = 0, 0 + for _, plugin in pairs(require("lazy.core.config").plugins) do + if plugin._.cond ~= false then + count = count + 1 + if not plugin._.installed then + problem("lazy.nvim didn't install " .. plugin.name) + elseif require("lazy.core.plugin").has_errors(plugin) then + problem("lazy.nvim couldn't install or build " .. plugin.name) + else + installed = installed + 1 + end + end + end + say(("lazy.nvim installed %d of %d plugins"):format(installed, count)) +end + +local function check_mason() + local registry = require("mason-registry") + -- mason-lspconfig only installs the language servers when Neovim has a UI, so + -- do what it does in a terminal + require("mason-lspconfig.features.ensure_installed")() + -- LazyVim's tools, and the language servers it has mason-lspconfig install + local names = vim.deepcopy(LazyVim.opts("mason.nvim").ensure_installed or {}) + local server_packages = require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package + for _, server in ipairs(require("mason-lspconfig.settings").current.ensure_installed) do + names[#names + 1] = server_packages[server] or server + end + + local packages = {} ---@type table + for _, name in ipairs(names) do + if registry.has_package(name) then + packages[name] = registry.get_package(name) + else + problem("Mason's registry doesn't have " .. name) + end + end + wait(10, function() + return vim.iter(packages):all(function(_, pkg) + return pkg:is_installed() or not pkg:is_installing() + end) + end) + + local installed = {} ---@type string[] + for _, pkg in pairs(packages) do + if pkg:is_installed() then + installed[#installed + 1] = pkg.name + else + local reason = install_errors[pkg.name] or (pkg:is_installing() and "timed out" or "didn't start") + problem(("Mason didn't install %s: %s"):format(pkg.name, reason)) + end + end + table.sort(installed) + say("Mason installed " .. table.concat(installed, ", ")) +end + +local function check_parsers() + local TS = require("nvim-treesitter") + -- The parsers LazyVim installs. Their dependencies only have queries + local langs = require("nvim-treesitter.config").norm_languages( + LazyVim.opts("nvim-treesitter").ensure_installed, + { unsupported = true, dependencies = true } + ) + local function missing() + local installed = TS.get_installed("parsers") + return vim.tbl_filter(function(lang) + return not vim.list_contains(installed, lang) + end, langs) + end + wait(10, function() + return #missing() == 0 + end) + + local missed = missing() + for _, lang in ipairs(missed) do + problem(("nvim-treesitter didn't install the %s parser"):format(lang)) + end + for _, lang in ipairs(langs) do + if not vim.list_contains(missed, lang) then + local ok, loaded, err = pcall(vim.treesitter.language.add, lang) + if not (ok and loaded) then + problem(("Neovim can't load the %s parser: %s"):format(lang, ok and err or loaded)) + end + end + end + say(("nvim-treesitter installed %d of %d parsers"):format(#langs - #missed, #langs)) +end + +local function check_language_servers(buf) + local names = { vim.g.lazyvim_python_lsp or "pyright", vim.g.lazyvim_python_ruff or "ruff" } + local function started(name) + return vim.iter(vim.lsp.get_clients({ bufnr = buf, name = name })):any(function(client) + return client.initialized + end) + end + wait(2, function() + return vim.iter(names):all(started) + end) + + for _, name in ipairs(names) do + if started(name) then + say(("The %s language server started"):format(name)) + else + problem(("The %s language server didn't start for %s"):format(name, vim.api.nvim_buf_get_name(buf))) + end + end +end + +local function check() + local buf = vim.api.nvim_get_current_buf() + check_plugins() + check_mason() + check_parsers() + check_language_servers(buf) +end + +-- Runs once startup finishes, like a session where you open a file +vim.api.nvim_create_autocmd("VimEnter", { + once = true, + callback = vim.schedule_wrap(function() + local ok, err = xpcall(check, debug.traceback) + if not ok then + problem("The check failed: " .. err) + end + if #problems == 0 then + say("Neovim is ready to use") + end + vim.list_extend(report, problems) + + -- On stderr, since the test scripts only show lazy.nvim's install log on + -- stdout if the check fails. Neovim's messages, which are also on stderr, + -- don't end with a newline, so the report starts with one + io.stderr:write("\n", table.concat(report, "\n"), "\n") + vim.cmd(#problems == 0 and "qall!" or "cquit") + end), +}) diff --git a/.github/lint.sh b/.github/lint.sh new file mode 100755 index 0000000..d089317 --- /dev/null +++ b/.github/lint.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# Renders the chezmoi templates for each OS, answering yes and then no to the +# prompts, and checks them along with the files that aren't templates: shell +# scripts with shellcheck, zsh files with zsh -n, PowerShell with its parser, +# and TOML, YAML and git config syntax. Needs chezmoi, zsh, shellcheck, pwsh, +# python3 and yq. +set -euo pipefail +cd "$(dirname "$0")/.." + +# Home folders without the age key, so that the decrypt scripts render +declare -A os_data=( + [linux]='{"os":"linux","homeDir":"/home/lint"}' + [darwin]='{"os":"darwin","homeDir":"/Users/lint"}' + [windows]='{"os":"windows","homeDir":"C:/Users/lint"}' +) +out=$(mktemp -d) +trap 'rm -rf "$out"' EXIT + +toml() { # toml FILE + python3 -c 'import sys, tomllib; tomllib.load(open(sys.argv[1], "rb"))' "$1" +} + +ps1() { # ps1 FILE + # shellcheck disable=SC2016 # PowerShell expands these + SCRIPT="$1" pwsh -NoProfile -Command ' + $errors = $null + [void][System.Management.Automation.Language.Parser]::ParseFile($env:SCRIPT, [ref]$null, [ref]$errors) + $errors | ForEach-Object { Write-Error $_.ToString() } + exit $errors.Count' +} + +check() { # check OS TEMPLATE RENDERED + case $2 in + *.sh.tmpl) [ "$1" = windows ] || shellcheck "$3" ;; + *.ps1.tmpl) [ "$1" != windows ] || ps1 "$3" ;; + *.toml.tmpl | .chezmoiexternal.toml) toml "$3" ;; + *.yaml.tmpl | *.yml.tmpl) yq . "$3" >/dev/null ;; + dot_config/git/config.tmpl) git config --file "$3" --list >/dev/null ;; + esac +} + +# The prompts change unrelated files, so answering all of them yes and then all +# of them no renders every branch +for os in "${!os_data[@]}"; do + for answer in true false; do + echo "# $os, answers: $answer" + chezmoi=(chezmoi --source . --override-data "{\"chezmoi\":${os_data[$os]},\"apps\":$answer,\"encryption\":$answer}") + for template in $(git ls-files '*.tmpl' .chezmoiexternal.toml .chezmoiignore); do + rendered="$out/$os-$answer/${template%.tmpl}" + mkdir -p "$(dirname "$rendered")" + if [ "$template" = .chezmoi.yaml.tmpl ]; then + "${chezmoi[@]}" execute-template --init \ + --promptBool "Decrypt the encrypted files with the key passphrase=$answer" \ + --promptBool "Install the desktop apps=$answer" \ + <"$template" >"$rendered" + else + "${chezmoi[@]}" execute-template <"$template" >"$rendered" + fi + check "$os" "$template" "$rendered" + done + done +done + +echo "# files that aren't templates" +git ls-files -z '*.sh' | xargs -0 shellcheck +for file in dot_zshenv dot_zshrc dot_config/zsh/*.zsh; do + zsh -n "$file" +done +for file in $(git ls-files '*.ps1'); do + ps1 "$file" +done +for file in $(git ls-files '*.toml' '*.lock' ':!:.chezmoiexternal.toml'); do + toml "$file" +done diff --git a/.github/test.ps1 b/.github/test.ps1 new file mode 100644 index 0000000..136aae4 --- /dev/null +++ b/.github/test.ps1 @@ -0,0 +1,132 @@ +# Installs the dotfiles from this checkout like the README does, then checks that +# applying again changes nothing, that PowerShell starts cleanly with the tools +# from mise, and that Neovim is ready to use. It replaces your dotfiles, so it +# only runs in CI. +$ErrorActionPreference = 'Stop' + +if ($env:CI -ne 'true') { + throw 'This replaces your dotfiles, so it only runs in CI (CI=true)' +} +$checkout = Split-Path -Parent $PSScriptRoot +$bin = "$HOME\.local\bin" +$env:Path = "$bin;$env:Path" + +$failed = $false +function Fail([string] $Message) { + Write-Host "::error::$Message" + $script:failed = $true +} + +# Encodes code for pwsh -EncodedCommand, so it doesn't need quoting +function ConvertTo-EncodedCommand([string] $Code) { + [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($Code)) +} + +# Runs code in a new PowerShell, which loads the profile like a new terminal +# does, and returns everything it printed +function Invoke-NewPowerShell([string] $Code) { + pwsh -NoLogo -EncodedCommand (ConvertTo-EncodedCommand $Code) 2>&1 | Out-String +} + +Write-Host '::group::Install the dotfiles' +New-Item -ItemType Directory -Force "$HOME\.local\share" | Out-Null +Copy-Item -Recurse -Force $checkout "$HOME\.local\share\chezmoi" +Invoke-Expression "&{$(Invoke-RestMethod https://get.chezmoi.io/ps1)} -b '$bin'" +# Without a terminal for input, like test.sh, so the scripts don't ask to log in +$null | chezmoi init --apply --promptBool 'Decrypt the encrypted files with the key passphrase=false' ` + --promptBool 'Install the desktop apps=false' +if ($LASTEXITCODE -ne 0) { throw "chezmoi init --apply failed with exit code $LASTEXITCODE" } +Write-Host '::endgroup::' + +Write-Host '::group::Check chezmoi' +$output = chezmoi apply 2>&1 | Out-String +if ($LASTEXITCODE -ne 0 -or $output.Trim()) { + Fail "Applying again should do nothing, but printed: $output" +} +$output = chezmoi status 2>&1 | Out-String +if ($output.Trim()) { Fail "chezmoi status should be empty, but printed: $output" } +chezmoi verify +if ($LASTEXITCODE -ne 0) { Fail 'chezmoi verify found differences' } +mise ls +Write-Host '::endgroup::' + +Write-Host "::group::Check git's GitHub credentials" +# git gets them from gh through mise's shim, and gh returns the token that CI +# sets in GITHUB_TOKEN +$env:GIT_TERMINAL_PROMPT = '0' +$request = "protocol=https`nhost=github.com`n" +$output = $request | git credential fill 2>&1 | Out-String +if ($output -notmatch '(?m)^password=.') { Fail "git didn't get GitHub credentials from gh: $output" } +# cmd, Windows PowerShell and VS Code don't activate mise, so check git there +# too: from cmd, with the Path that a new terminal gets +$sessionPath = $env:Path +$env:Path = [Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + + [Environment]::GetEnvironmentVariable('Path', 'User') +$output = $request | cmd /d /c 'git credential fill 2>&1' | Out-String +$env:Path = $sessionPath +if ($output -notmatch '(?m)^password=.') { Fail "git in cmd didn't get GitHub credentials from gh: $output" } +Write-Host '::endgroup::' + +Write-Host "::group::Check that tools' git settings stay out of the dotfiles" +# Tools like Git Credential Manager save their settings with git config +# --global, which writes to ~/.gitconfig rather than to the dotfiles' file +git config --global credential.azrepos:org/example.username user@example.com +$saved = git config --file "$HOME\.gitconfig" credential.azrepos:org/example.username +$output = chezmoi status 2>&1 | Out-String +if ($saved -ne 'user@example.com' -or $output.Trim()) { + Fail "git config --global should write to ~/.gitconfig, which chezmoi doesn't manage. chezmoi status: $output" +} +Write-Host '::endgroup::' + +Write-Host '::group::Check PowerShell' +$output = Invoke-NewPowerShell 'exit' +if ($LASTEXITCODE -ne 0 -or $output.Trim()) { Fail "PowerShell printed on startup: $output" } +# Prints the problems it finds +$checks = @' +$installs = Join-Path $env:LOCALAPPDATA 'mise\installs' +$tools = 'atuin', 'bat', 'delta', 'dust', 'fd', 'fzf', 'gh', 'go', 'lazygit', 'lsd', + 'node', 'npm', 'nvim', 'rg', 'starship', 'tree-sitter', 'uv', 'uvx', 'ya', 'yazi', 'zoxide' +foreach ($tool in $tools) { + $source = (Get-Command $tool -ErrorAction Ignore | Select-Object -First 1).Source + if ($source -notlike "$installs\*") { + "$tool should come from mise, but is $(if ($source) { $source } else { 'missing' })" + continue + } + $version = if ($tool -eq 'go') { & $tool version 2>&1 } else { & $tool --version 2>&1 } + if ($LASTEXITCODE -ne 0) { "$tool doesn't run: $version" } +} +# Vi insert mode's keys. Command mode's are listed as and +$ctrlR = (Get-PSReadLineKeyHandler -Chord 'Ctrl+r' | Where-Object Key -eq 'Ctrl+r').Function +if ($ctrlR -ne 'Runs Atuin search') { "Ctrl+r runs '$ctrlR', not Atuin" } +$upArrow = (Get-PSReadLineKeyHandler -Chord 'UpArrow' | Where-Object Key -eq 'UpArrow').Function +if ($upArrow -ne 'HistorySearchBackward') { "UpArrow runs '$upArrow', not HistorySearchBackward" } +if (-not (Get-Command __zoxide_z -ErrorAction Ignore)) { "zoxide isn't initialized" } +'@ +$output = Invoke-NewPowerShell $checks +if ($LASTEXITCODE -ne 0 -or $output.Trim()) { Fail "The PowerShell checks failed: $output" } +Write-Host '::endgroup::' + +Write-Host '::group::Check Neovim' +# Opening a file the first time installs the plugins, tools, language servers +# and parsers. The new PowerShell loads the profile, which sets XDG_CONFIG_HOME +# for Neovim. lazy.nvim's install log on stdout is mostly git's progress, so +# it's only shown on failure. The temp folder's path is shortened to RUNNER~1 +# on GitHub's runners, so the file goes in the home folder +$nvimDir = New-Item -ItemType Directory -Force (Join-Path $HOME 'nvim-check') +Set-Content (Join-Path $nvimDir 'check.py') 'print("Hello")' +$code = @" +Set-Location '$nvimDir' +nvim --headless check.py -S '$PSScriptRoot\check-nvim.lua' > lazy.log +exit `$LASTEXITCODE +"@ +pwsh -NoLogo -EncodedCommand (ConvertTo-EncodedCommand $code) +if ($LASTEXITCODE -ne 0) { + Get-Content (Join-Path $nvimDir 'lazy.log') + Fail "Neovim isn't ready to use" +} +Write-Host '::endgroup::' + +if ($failed) { + exit 1 +} +Write-Host 'All checks passed' diff --git a/.github/test.sh b/.github/test.sh new file mode 100755 index 0000000..f19b78c --- /dev/null +++ b/.github/test.sh @@ -0,0 +1,171 @@ +#!/bin/bash +# Installs the dotfiles from this checkout the way the README does, then checks +# that applying again changes nothing, that the shells start cleanly with the +# tools from mise, and that Neovim is ready to use. It replaces your dotfiles, so +# it only runs in CI. +set -euo pipefail + +if [ "${CI:-}" != true ]; then + echo "This replaces your dotfiles, so it only runs in CI (CI=true)" >&2 + exit 1 +fi +checkout=$(cd "$(dirname "$0")/.." && pwd) +bin=$HOME/.local/bin +export PATH="$bin:$PATH" + +failed=false +fail() { + echo "::error::$*" + failed=true +} + +# Runs a command in a pseudo-terminal, as a terminal emulator would, and prints +# its output without escape sequences. Stops it with exit status 124 if it takes +# over 2 minutes, which usually means it's waiting for input. +in_pty() { + python3 -c ' +import os, pty, re, signal, sys +pid, fd = pty.fork() +if pid == 0: + os.execvp(sys.argv[1], sys.argv[1:]) +output = [] +def finish(status): + text = re.sub(rb"\x1b(\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(\x07|\x1b\\)|[=>])|\r", b"", b"".join(output)) + sys.stdout.buffer.write(text) + sys.stdout.flush() + os._exit(status) +def timeout(*_): + os.kill(pid, signal.SIGKILL) + output.append(b"\n(timed out)") + finish(124) +signal.signal(signal.SIGALRM, timeout) +signal.alarm(120) +while True: + try: + data = os.read(fd, 4096) + except OSError: # Linux reports EIO once the command exits + break + if not data: + break + output.append(data) +finish(os.waitstatus_to_exitcode(os.waitpid(pid, 0)[1])) +' "$@" &1) || [ -n "$output" ]; then + fail "Applying again should do nothing, but printed: $output" +fi +output=$(chezmoi status) +[ -z "$output" ] || fail "chezmoi status should be empty, but printed: $output" +chezmoi verify || fail "chezmoi verify found differences" +mise ls +echo "::endgroup::" + +echo "::group::Check the login shell" +if [ "$(uname)" = Darwin ]; then + login_shell=$(dscl . -read "/Users/$(id -un)" UserShell | awk '{print $2}') +else + login_shell=$(getent passwd "$(id -un)" | cut -d: -f7) +fi +case $login_shell in + */zsh) echo "$login_shell" ;; + *) fail "The login shell is $login_shell, not zsh" ;; +esac +echo "::endgroup::" + +echo "::group::Check the C compiler" +# nvim-treesitter compiles its parsers with it +printf '#include \nint main(void) { return EXIT_SUCCESS; }\n' | cc -x c -o /dev/null - || + fail "cc can't compile a C program" +echo "::endgroup::" + +echo "::group::Check git's GitHub credentials" +# git gets them from gh through mise's shim, and gh returns the token that CI +# sets in GITHUB_TOKEN +output=$(printf 'protocol=https\nhost=github.com\n\n' | GIT_TERMINAL_PROMPT=0 git credential fill 2>&1) || true +grep -q '^password=.' <<<"$output" || fail "git didn't get GitHub credentials from gh: $output" +echo "::endgroup::" + +echo "::group::Check zsh" +# GitHub's Ubuntu image makes everything in /usr/share writable by everyone, +# including zsh's completion directories, so compinit would ask whether to use +# them and wait for an answer. Remove that access, as you would on your machine. +insecure=$(zsh -c 'autoload -Uz compaudit && compaudit' 2>/dev/null | sort -u) || true +if [ -n "$insecure" ]; then + echo "Removing write access for others from the directories compinit distrusts:" + echo "$insecure" + echo "$insecure" | xargs sudo chmod g-w,o-w +fi +output=$(in_pty zsh -i -c exit) && status=0 || status=$? +if [ "$status" -ne 0 ] || [ -n "$output" ]; then + fail "zsh should start without printing anything, but exited with $status and printed: $output" +fi +# On WSL, .zshrc keeps only the Windows folders it needs on PATH, in any case. +# It expands in zsh, not here: +# shellcheck disable=SC2016 +output=$(WSL_DISTRO_NAME=Ubuntu PATH="$PATH:/mnt/c/WINDOWS/system32:/mnt/c/Windows:/mnt/c/Tools:/mnt/c/Program Files/Microsoft VS Code/bin" \ + in_pty zsh -i -c 'print -rl -- ${(M)path:#/mnt/*}') || true +if [ "$output" != $'/mnt/c/WINDOWS/system32\n/mnt/c/Windows\n/mnt/c/Program Files/Microsoft VS Code/bin' ]; then + fail "On WSL, PATH should only keep System32, Windows and VS Code from /mnt, but has: $output" +fi +# Prints the problems it finds. It expands in zsh, not here: +# shellcheck disable=SC2016 +zsh_checks=' +mise_installs=${MISE_DATA_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/mise}/installs +tool_version() { + case $1 in + go) go version ;; + tmux) tmux -V ;; + *) $1 --version ;; + esac +} +for tool in "$@"; do + if [[ $commands[$tool] != $mise_installs/* ]]; then + print "$tool should come from mise, but is ${commands[$tool]:-missing}" + elif ! tool_version $tool >/dev/null 2>&1; then + print "$tool doesn'\''t run: $(tool_version $tool 2>&1)" + fi +done +for tool in atuin bat chezmoi delta dust fd gh lsd mise rg starship uv uvx ya yazi zoxide; do + [[ -s ~/.config/zsh/completions/_$tool ]] || print "~/.config/zsh/completions/_$tool is missing" + [[ $_comps[$tool] == _$tool ]] || print "$tool completes with ${_comps[$tool]:-nothing}, not _$tool" +done +[[ $(bindkey -M viins "^F") == *" fzf-file-widget" ]] || print "Ctrl-F: $(bindkey -M viins "^F")" +[[ $(bindkey -M viins "^T") == *" self-insert" ]] || print "Ctrl-T: $(bindkey -M viins "^T")" +[[ $(bindkey -M viins "^R") == *" atuin-"* ]] || print "Ctrl-R: $(bindkey -M viins "^R")" +(( $+functions[__zoxide_z] )) || print "zoxide isn'\''t initialized" +' +tools=(atuin bat delta dust fd fzf gh go lazygit lsd node npm nvim rg starship tmux tree-sitter uv uvx ya yazi zoxide) +output=$(in_pty zsh -i -c "$zsh_checks" zsh "${tools[@]}") && status=0 || status=$? +if [ "$status" -ne 0 ] || [ -n "$output" ]; then + fail "The zsh checks exited with $status and printed: $output" +fi +echo "::endgroup::" + +echo "::group::Check Neovim" +# Opening a file the first time installs the plugins, tools, language servers +# and parsers. mise exec puts the tools on the PATH, as zsh does. lazy.nvim's +# install log on stdout is mostly git's progress, so it's only shown on failure +nvim_dir=$(mktemp -d) +echo 'print("Hello")' >"$nvim_dir/check.py" +if ! (cd "$nvim_dir" && mise exec -- nvim --headless check.py -S "$checkout/.github/check-nvim.lua" \ + lazy.log); then + cat "$nvim_dir/lazy.log" + fail "Neovim isn't ready to use" +fi +echo "::endgroup::" + +if [ "$failed" = true ]; then + exit 1 +fi +echo "All checks passed" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ec60123 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +# Lints the rendered templates and installs the dotfiles on fresh machines +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + # shellcheck, pwsh, python3 and yq come with the runner + - name: Install zsh and chezmoi + run: | + sudo apt-get update + sudo apt-get install -y zsh + sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "$HOME/.local/bin" + echo "$HOME/.local/bin" >>"$GITHUB_PATH" + - run: .github/lint.sh + + apply: + name: apply (${{ matrix.name }}) + runs-on: ${{ matrix.os }} + container: ${{ matrix.container }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + include: + - name: ubuntu + os: ubuntu-latest + # Ubuntu 22.04 has an older glibc, and the container starts without + # the packages that GitHub's runners come with + - name: ubuntu 22.04 + os: ubuntu-latest + container: ubuntu:22.04 + - name: macos + os: macos-latest + - name: windows + os: windows-latest + env: + DEBIAN_FRONTEND: noninteractive + GITHUB_TOKEN: ${{ github.token }} # raises mise's GitHub API rate limit + steps: + - name: Install curl and Python for the test + if: matrix.container + run: apt-get update && apt-get install -y ca-certificates curl python3 + - uses: actions/checkout@v7 + with: + persist-credentials: false + - if: runner.os != 'Windows' + run: .github/test.sh + - if: runner.os == 'Windows' + shell: pwsh + run: .github/test.ps1 diff --git a/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 b/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 index d14eb44..04493e7 100644 --- a/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 +++ b/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 @@ -1,20 +1,13 @@ -#$executionTime = Measure-Command ` -#{ - -# Imports -# - Slowest imports are posh-git, Terminal-Icons -# Import-Module git-aliases -DisableNameChecking -#Import-Module posh-git -Import-Module PSReadLine -#Import-Module Terminal-Icons - -$ProfilePath=Split-Path -parent $profile +# This file's folder. $profile isn't, when PowerShell loads this file from a +# profile elsewhere, such as in a Documents folder that's in OneDrive +$ProfilePath = $PSScriptRoot # Functions . $ProfilePath/functions.ps1 . $ProfilePath/ssh.autocomplete.ps1 ## PSReadLine configuration +# PSReadLine comes with PowerShell 7, which loads it without Import-Module Set-PSReadLineOption -EditMode Vi # Shows navigable menu of all options when hitting Tab Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete @@ -22,30 +15,33 @@ Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward Set-PSReadLineOption -HistorySearchCursorMovesToEnd -Set-PSReadlineKeyHandler -Chord 'Ctrl+r' -Function SwitchPredictionView Set-PSReadlineKeyHandler -Chord 'Ctrl+j' -Function NextSuggestion Set-PSReadlineKeyHandler -Chord 'Ctrl+k' -Function PreviousSuggestion -## Zoxide: https://github.com/ajeetdsouza/Zoxide -#Invoke-Expression (& { -# $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' } -# (zoxide init --hook $hook powershell | Out-String) -#}) - # Aliases . $ProfilePath/aliases.ps1 # Environment variables -$env:KOMOREBI_CONFIG_HOME = Join-Path $HOME ".config\komorebi" $env:YAZI_FILE_ONE = "C:\Program Files\Git\usr\bin\file.exe" $env:YAZI_CONFIG_HOME = Join-Path $HOME ".config\yazi" $env:XDG_CONFIG_HOME = Join-Path $HOME ".config" +# delta and bat page with less, which comes with Git but isn't on PATH. Without +# arguments, so that they add their own options for less, such as -R and +# --quit-if-one-screen. The quotes are for the space: they split it like a command +$env:DELTA_PAGER = '"C:\Program Files\Git\usr\bin\less.exe"' +$env:BAT_PAGER = $env:DELTA_PAGER + +# Tools installed by mise: https://mise.jdx.dev +# Before atuin, starship and zoxide, which it puts on PATH. Starship replaces +# mise's prompt hook, but mise still updates PATH on cd and after mise commands +(& "$HOME\.local\bin\mise.exe" activate pwsh) | Out-String | Invoke-Expression + +# Atuin: https://github.com/atuinsh/atuin +# Replaces Ctrl+r. The Up arrow keeps the prefix search above +atuin init powershell --disable-up-arrow --disable-ai | Out-String | Invoke-Expression # Prompt Invoke-Expression (&starship init powershell) # Zoxide Invoke-Expression (& { (zoxide init powershell | Out-String) }) - -#} -#Write-Host "$PSCommandPath execution time: $executionTime" diff --git a/Documents/PowerShell/aliases.ps1 b/Documents/PowerShell/aliases.ps1 index 75a1e78..a3b7f73 100644 --- a/Documents/PowerShell/aliases.ps1 +++ b/Documents/PowerShell/aliases.ps1 @@ -61,14 +61,6 @@ function lt { ls -alhrt @args } -function kstart { - komorebic start --whkd -} - -function kstop { - komorebic stop --whkd -} - function ssh-copy-id($remote) { cat ~/.ssh/id_rsa.pub | ssh $remote "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" } diff --git a/README.md b/README.md index 12ae03a..d55f7ba 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,9 @@ My cross-platform, cross-shell configuration files and installation scripts managed with [chezmoi](https://www.chezmoi.io/): -- Zsh on Windows 11 WSL 2 Ubuntu 22.04 -- Zsh on MacOS -- Zsh on Ubuntu 22.04 -- Zsh on Fedora 36 -- Powershell 7 on Windows 11 +- Zsh on Ubuntu 22.04 or later, including in WSL 2 +- Zsh on macOS (Apple silicon) +- PowerShell 7 on Windows 11 (x64) ## Highlights @@ -17,79 +15,82 @@ The files I think are most notable are listed below: - Neovim configuration, based off [LazyVim](https://www.lazyvim.org): [`dot_config/nvim`](./dot_config/nvim) - Tmux configuration: [`dot_tmux.conf`](./dot_tmux.conf) - Integrated with neovim: uses same theme, seamless navigation between tmux and neovim splits - - Complex tmux sessions are managed easily using [tmuxinator](https://github.com/tmuxinator/tmuxinator): - [`dot_config/tmuxinator`](./dot_config/tmuxinator) -- Installation scripts: improve and standardize the CLI across operating systems - - [`.chezmoiexternal.toml`](./.chezmoiexternal.toml) - - To see what software is installed, search for `url` - - Unix-specific: [`run_install-unix.sh.tmpl`](./run_install-unix.sh.tmpl) - - To see what software is installed, search for `dependencies` - - Does not require Sudo privileges - - Windows-specific: [`run_install-windows.ps1`](./reference_dotfiles/run_install-windows.ps1) - - To see what software is installed, search for `wingetInstallIfNotInstalled`, `choco install`, and `Install-Module` - - I don't use this script anymore, in favor of [WingetUI](https://github.com/marticliment/WingetUI): [`wingetui/`](./reference_dotfiles/wingetui/) -- Encryption scripts: files with sensitive information are - [encrypted](https://www.chezmoi.io/user-guide/frequently-asked-questions/encryption/) - - Unix-specific: [`run_before_decrypt-private-key-unix.sh.tmpl`](./run_before_decrypt-private-key-unix.sh.tmpl) - - Windows-specific: [`run_before_decrypt-private-key-windows.ps1.tmpl`](./run_before_decrypt-private-key-windows.ps1.tmpl) +- Installation scripts: improve and standardize the CLI across operating systems. chezmoi reruns each one only when + it changes + - CLI tools are installed and updated with [mise](https://mise.jdx.dev), with their versions pinned in its + lockfile: [`dot_config/mise`](./dot_config/mise) + - Desktop apps are listed once for macOS and Windows: + [`.chezmoidata/desktop-apps.toml`](./.chezmoidata/desktop-apps.toml) +- Encryption: files with sensitive information are + [encrypted](https://www.chezmoi.io/user-guide/frequently-asked-questions/encryption/) with age +- CI: lints the templates for each OS, then installs the dotfiles on fresh Ubuntu, macOS and Windows machines and + checks that Neovim is ready to use: [`.github/workflows/ci.yml`](./.github/workflows/ci.yml) - Configuration files for software that is not managed with chezmoi: [`reference_dotfiles`](./reference_dotfiles) ## Installation -### Zsh on Linux or MacOS +1. Install the prerequisites + - Ubuntu: [curl](https://curl.se/download.html), to install chezmoi. chezmoi installs git, zsh and the other + packages it needs with apt + - macOS: git, from the Xcode Command Line Tools: `xcode-select --install`. If you're installing the desktop apps, + sign in to the App Store, which some of them come from + - Windows: PowerShell 7, which the profile and chezmoi's scripts run in, and Git, which chezmoi, Neovim and yazi + use. Install them with winget: -1. Install prerequisites - 1. [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - 2. [age](https://github.com/FiloSottile/age#installation) - 3. On Linux, [xz-utils](https://repology.org/project/xz/versions) - 4. On a fresh Ubuntu install, this is how I install the above prerequisites and other packages I uses + ``` + winget install --exact --id Microsoft.PowerShell --source winget + winget install --exact --id Git.Git --source winget + ``` - ``` - sudo add-apt-repository ppa:neovim-ppa/unstable -y && sudo apt install git age xz-utils curl neovim tmux zsh -y - ``` - -2. Install chezmoi in `~/.local/bin`, pulling and applying the latest changes +2. Install chezmoi in `~/.local/bin`, pulling and applying the latest changes. On Ubuntu and macOS: ``` - pushd ~ - sh -c "$(curl -fsLS get.chezmoi.io/lb)" -- init --apply patrick-5546 - popd + sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "$HOME/.local/bin" init --apply patrick-5546 ``` - - To install without encrypted files, add `--branch no-encryption` to the init command + On Windows, in a new PowerShell 7 terminal: -3. If desired, manually install software with unique installation instructions - - [Alacritty](https://github.com/alacritty/alacritty/blob/master/INSTALL.md) - - [Neovim](https://github.com/neovim/neovim/wiki/Installing-Neovim) -4. Additional setup for Fedora - 1. [Enable RPM Fusion repositories](https://docs.fedoraproject.org/en-US/quick-docs/setup_rpmfusion/) - 2. [Install multimedia plugins](https://docs.fedoraproject.org/en-US/quick-docs/assembly_installing-plugins-for-playing-movies-and-music/) - 3. Configure dnf (run `man dnf.conf` to see options and defaults): append the following lines to `/etc/dnf/dnf.conf` + ``` + iex "&{$(irm 'https://get.chezmoi.io/ps1')} -b '~/.local/bin' -- init --apply patrick-5546" + ``` - ``` - max_parallel_downloads=10 - defaultyes=True - keepcache=True - ``` + - `chezmoi init` asks: + - Whether to decrypt the encrypted files with the key passphrase. Answer no if you don't have the passphrase + - On macOS and Windows, whether to install the [desktop apps](./.chezmoidata/desktop-apps.toml). It skips + the ones that are already installed -### PowerShell 7 on Windows + It saves the answers in `~/.config/chezmoi/chezmoi.yaml`. Run `chezmoi init --prompt` to answer again + - Then chezmoi's scripts install what's missing. Enter your password, or allow the installers that ask for + administrator rights, when they ask + - The packages that the dotfiles and Neovim need: with apt on Ubuntu, and gcc ([WinLibs](https://winlibs.com)) + and Python with winget on Windows. On Ubuntu and macOS, zsh becomes your login shell + - mise in `~/.local/bin`, and the tools in its config. On Windows, it adds `~\.local\bin` to your Path + - `gh auth login`, if you aren't logged in to GitHub. git gets its GitHub credentials from gh + - The desktop apps: with Homebrew on macOS, which it installs first if it's missing, and winget on Windows + - On Windows, if Documents is in OneDrive, PowerShell looks for its profile there instead of in `~\Documents`, + where chezmoi puts it. Add a profile there that loads chezmoi's: -1. Install PowerShell 7 from the Microsoft Store -2. Install git and gsudo using winget in PowerShell + ``` + New-Item -Force $PROFILE -Value '. "$HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"' + ``` - ``` - winget install --exact --id FiloSottile.age --interactive - winget install --exact --id twpayne.chezmoi --interactive - winget install --exact --id Git.Git --interactive - ``` + - Open a new terminal to start using them, or log out and back in if it doesn't start zsh -3. Clone this repository in PowerShell, pulling and applying the latest changes +3. Keep everything up to date ``` - chezmoi init --apply patrick-5546 + chezmoi update # pull and apply the latest changes + mise upgrade # upgrade the tools, which updates mise.lock + chezmoi re-add ~/.config/mise # save mise.lock, then commit and push it + chezmoi upgrade # upgrade chezmoi ``` -4. Optional: run [`run_install-windows.ps1`](./reference_dotfiles/run_install-windows.ps1) to match my unix developer experience - - Prerequisite: `winget install --exact --id gerardog.gsudo --interactive` - - Note: I do not run this automatically anymore because I do most of my development through WSL or VS Code. - Instead, I now manage the software I want through [WingetUI](https://github.com/marticliment/WingetUI) whenever possible + - If chezmoi says that the config file template has changed, run `chezmoi init --apply`. It asks only the + questions you haven't answered yet + - mise updates itself once a week. Like `mise upgrade`, it skips releases from the last 7 days + - To roll back an upgrade, revert its commit in the source directory (`chezmoi cd`) and run `chezmoi apply` + - Upgrade everything else with the OS's package managers: `sudo apt upgrade` on Ubuntu, `brew upgrade` and the + App Store on macOS, and winget or UniGetUI on Windows + +4. Optional: install the other software I've used, listed in + [`reference_dotfiles/software.md`](./reference_dotfiles/software.md) diff --git a/create_empty_dot_gitconfig b/create_empty_dot_gitconfig new file mode 100644 index 0000000..4e967b5 --- /dev/null +++ b/create_empty_dot_gitconfig @@ -0,0 +1,3 @@ +# This machine's git settings, which tools like Git Credential Manager save with +# git config --global. chezmoi creates this file but doesn't manage it: without +# it, git config --global writes to the dotfiles' ~/.config/git/config instead diff --git a/dot_alacritty.toml b/dot_alacritty.toml deleted file mode 100644 index fe92e42..0000000 --- a/dot_alacritty.toml +++ /dev/null @@ -1,34 +0,0 @@ -[cursor] -vi_mode_style = "Block" - -[font] -size = 11.0 - -[font.bold] -family = "FiraCode Nerd Font Mono" -style = "Bold" - -[font.bold_italic] -family = "FiraCode Nerd Font Mono" -style = "Bold Italic" - -[font.italic] -family = "FiraCode Nerd Font Mono" -style = "Italic" - -[font.normal] -family = "FiraCode Nerd Font Mono" -style = "Regular" - -[font.offset] -x = 1 -y = 1 - -[window] -decorations = "full" -opacity = 0.9 -startup_mode = "Maximized" - -[window.padding] -x = 10 -y = 10 diff --git a/dot_config/bpytop/bpytop.conf b/dot_config/bpytop/bpytop.conf deleted file mode 100644 index e129626..0000000 --- a/dot_config/bpytop/bpytop.conf +++ /dev/null @@ -1,153 +0,0 @@ -#? Config file for bpytop v. 1.0.68 - -#* Color theme, looks for a .theme file in "/usr/[local/]share/bpytop/themes" and "~/.config/bpytop/themes", "Default" for builtin default theme. -#* Prefix name by a plus sign (+) for a theme located in user themes folder, i.e. color_theme="+monokai" -color_theme="Default" - -#* If the theme set background should be shown, set to False if you want terminal background transparency -theme_background=False - -#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. -truecolor=True - -#* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace. -shown_boxes="cpu proc net mem" - -#* Update time in milliseconds, increases automatically if set below internal loops processing time, recommended 2000 ms or above for better sample times for graphs. -update_ms=2000 - -#* Processes update multiplier, sets how often the process list is updated as a multiplier of "update_ms". -#* Set to 2 or higher to greatly decrease bpytop cpu usage. (Only integers) -proc_update_mult=2 - -#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive", -#* "cpu lazy" updates top process over time, "cpu responsive" updates top process directly. -proc_sorting="memory" - -#* Reverse sorting order, True or False. -proc_reversed=False - -#* Show processes as a tree -proc_tree=False - -#* Which depth the tree view should auto collapse processes at -tree_depth=3 - -#* Use the cpu graph colors in the process list. -proc_colors=True - -#* Use a darkening gradient in the process list. -proc_gradient=True - -#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. -proc_per_core=False - -#* Show process memory as bytes instead of percent -proc_mem_bytes=True - -#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available, see: -#* https://psutil.readthedocs.io/en/latest/#psutil.cpu_times for attributes available on specific platforms. -#* Select from a list of detected attributes from the options menu -cpu_graph_upper="total" - -#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available, see: -#* https://psutil.readthedocs.io/en/latest/#psutil.cpu_times for attributes available on specific platforms. -#* Select from a list of detected attributes from the options menu -cpu_graph_lower="total" - -#* Toggles if the lower CPU graph should be inverted. -cpu_invert_lower=True - -#* Set to True to completely disable the lower CPU graph. -cpu_single_graph=False - -#* Shows the system uptime in the CPU box. -show_uptime=True - -#* Check cpu temperature, needs "osx-cpu-temp" on MacOS X. -check_temp=True - -#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. -cpu_sensor=Auto - -#* Show temperatures for cpu cores also if check_temp is True and sensors has been found -show_coretemp=True - -#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine" -temp_scale="celsius" - -#* Show CPU frequency, can cause slowdowns on certain systems with some versions of psutil -show_cpu_freq=True - -#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. -draw_clock="" - -#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. -background_update=True - -#* Custom cpu model name, empty string to disable. -custom_cpu_name="" - -#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with a comma ",". -#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot, /home/user" -disks_filter="" - -#* Show graphs instead of meters for memory values. -mem_graphs=False - -#* If swap memory should be shown in memory box. -show_swap=True - -#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. -swap_disk=True - -#* If mem box should be split to also show disks info. -show_disks=True - -#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. -only_physical=True - -#* Read disks list from /etc/fstab. This also disables only_physical. -use_fstab=False - -#* Toggles if io stats should be shown in regular disk usage view -show_io_stat=True - -#* Toggles io mode for disks, showing only big graphs for disk read/write speeds. -io_mode=True - -#* Set to True to show combined read/write io graphs in io mode. -io_graph_combined=False - -#* Set the top speed for the io graphs in MiB/s (10 by default), use format "device:speed" separate disks with a comma ",". -#* Example: "/dev/sda:100, /dev/sdb:20" -io_graph_speeds="" - -#* Set fixed values for network graphs, default "10M" = 10 Mibibytes, possible units "K", "M", "G", append with "bit" for bits instead of bytes, i.e "100mbit" -net_download="10M" -net_upload="10M" - -#* Start in network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. -net_auto=True - -#* Sync the scaling for download and upload to whichever currently has the highest scale -net_sync=False - -#* If the network graphs color gradient should scale to bandwidth usage or auto scale, bandwidth usage is based on "net_download" and "net_upload" values -net_color_fixed=False - -#* Starts with the Network Interface specified here. -net_iface="" - -#* Show battery stats in top right if battery is present -show_battery=False - -#* Show init screen at startup, the init screen is purely cosmetical -show_init=False - -#* Enable check for new version from github.com/aristocratos/bpytop at start. -update_check=False - -#* Set loglevel for "~/.config/bpytop/error.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". -#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. -log_level=WARNING diff --git a/dot_config/fzf/key-bindings.zsh b/dot_config/fzf/key-bindings.zsh deleted file mode 100644 index 10cd2a3..0000000 --- a/dot_config/fzf/key-bindings.zsh +++ /dev/null @@ -1,187 +0,0 @@ -# ____ ____ -# / __/___ / __/ -# / /_/_ / / /_ -# / __/ / /_/ __/ -# /_/ /___/_/ key-bindings.zsh -# -# - $FZF_CTRL_T_COMMAND -# - $FZF_CTRL_T_OPTS -# - $FZF_CTRL_R_COMMAND -# - $FZF_CTRL_R_OPTS -# - $FZF_ALT_C_COMMAND -# - $FZF_ALT_C_OPTS - - -# Key bindings -# ------------ - -# The code at the top and the bottom of this file is the same as in completion.zsh. -# Refer to that file for explanation. -if 'zmodload' 'zsh/parameter' 2>'/dev/null' && (( ${+options} )); then - __fzf_key_bindings_options="options=(${(j: :)${(kv)options[@]}})" -else - () { - __fzf_key_bindings_options="setopt" - 'local' '__fzf_opt' - for __fzf_opt in "${(@)${(@f)$(set -o)}%% *}"; do - if [[ -o "$__fzf_opt" ]]; then - __fzf_key_bindings_options+=" -o $__fzf_opt" - else - __fzf_key_bindings_options+=" +o $__fzf_opt" - fi - done - } -fi - -'builtin' 'emulate' 'zsh' && 'builtin' 'setopt' 'no_aliases' - -{ -if [[ -o interactive ]]; then - -#----BEGIN INCLUDE common.sh -# NOTE: Do not directly edit this section, which is copied from "common.sh". -# To modify it, one can edit "common.sh" and run "./update.sh" to apply -# the changes. See code comments in "common.sh" for the implementation details. - -__fzf_defaults() { - builtin printf '%s\n' "--height ${FZF_TMUX_HEIGHT:-40%} --min-height 20+ --bind=ctrl-z:ignore $1" - command cat "${FZF_DEFAULT_OPTS_FILE-}" 2> /dev/null - builtin printf '%s\n' "${FZF_DEFAULT_OPTS-} $2" -} - -__fzf_exec_awk() { - if [[ -z ${__fzf_awk-} ]]; then - __fzf_awk=awk - if [[ $OSTYPE == solaris* && -x /usr/xpg4/bin/awk ]]; then - __fzf_awk=/usr/xpg4/bin/awk - elif command -v mawk > /dev/null 2>&1; then - local n x y z d - IFS=' .' read -r n x y z d <<< $(command mawk -W version 2> /dev/null) - [[ $n == mawk ]] && - (((x * 1000 + y) * 1000 + z >= 1003004)) 2> /dev/null && - ((d >= 20230302)) 2> /dev/null && - __fzf_awk=mawk - fi - fi - LC_ALL=C exec "$__fzf_awk" "$@" -} -#----END INCLUDE - -# CTRL-F - Paste the selected file path(s) into the command line -__fzf_select() { - setopt localoptions pipefail no_aliases 2> /dev/null - local item - FZF_DEFAULT_COMMAND=${FZF_CTRL_T_COMMAND:-} \ - FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --walker=file,dir,follow,hidden --scheme=path" "${FZF_CTRL_T_OPTS-} -m") \ - FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) "$@" < /dev/tty | while read -r item; do - echo -n -E "${(q)item} " - done - local ret=$? - echo - return $ret -} - -__fzfcmd() { - [ -n "${TMUX_PANE-}" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "${FZF_TMUX_OPTS-}" ]; } && - echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf" -} - -fzf-file-widget() { - LBUFFER="${LBUFFER}$(__fzf_select)" - local ret=$? - zle reset-prompt - return $ret -} -if [[ "${FZF_CTRL_T_COMMAND-x}" != "" ]]; then - zle -N fzf-file-widget - bindkey -M emacs '^F' fzf-file-widget - bindkey -M vicmd '^F' fzf-file-widget - bindkey -M viins '^F' fzf-file-widget -fi - -# ALT-C - cd into the selected directory -fzf-cd-widget() { - setopt localoptions pipefail no_aliases 2> /dev/null - local dir="$( - FZF_DEFAULT_COMMAND=${FZF_ALT_C_COMMAND:-} \ - FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --walker=dir,follow,hidden --scheme=path" "${FZF_ALT_C_OPTS-} +m") \ - FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) < /dev/tty)" - if [[ -z "$dir" ]]; then - zle redisplay - return 0 - fi - zle push-line # Clear buffer. Auto-restored on next prompt. - BUFFER="builtin cd -- ${(q)dir:a}" - zle accept-line - local ret=$? - unset dir # ensure this doesn't end up appearing in prompt expansion - zle reset-prompt - return $ret -} -if [[ "${FZF_ALT_C_COMMAND-x}" != "" ]]; then - zle -N fzf-cd-widget - bindkey -M emacs '\ec' fzf-cd-widget - bindkey -M vicmd '\ec' fzf-cd-widget - bindkey -M viins '\ec' fzf-cd-widget -fi - -# CTRL-R - Paste the selected command from history into the command line -fzf-history-widget() { - local selected extracted_with_perl=0 - setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases no_glob no_sh_glob no_ksharrays extendedglob 2> /dev/null - if zmodload -F zsh/parameter p:{commands,history} 2>/dev/null && (( ${+commands[perl]} )); then - selected="$(printf '%s\t%s\000' "${(kv)history[@]}" | - perl -0 -ne 'if (!$seen{(/^\s*[0-9]+\**\t(.*)/s, $1)}++) { s/\n/\n\t/gm; print; }' | - FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,alt-r:toggle-raw --wrap-sign '"$'\t'"↳ ' --highlight-line --multi ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} --read0") \ - FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd))" - extracted_with_perl=1 - else - selected="$(fc -rl 1 | __fzf_exec_awk '{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0 }' | - FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,alt-r:toggle-raw --wrap-sign '"$'\t'"↳ ' --highlight-line --multi ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER}") \ - FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd))" - fi - local ret=$? - local -a cmds - local -a mbegin mend match - if [ -n "$selected" ]; then - if ((( extracted_with_perl )) && [[ $selected == <->$'\t'* ]]) || - ((( ! extracted_with_perl )) && [[ $selected == [[:blank:]]#<->( |\* )* ]]); then - for line in ${(ps:\n:)selected}; do - if (( extracted_with_perl )); then - if [[ $line == (#b)(<->)(#B)$'\t'* ]]; then - (( ${+history[${match[1]}]} )) && cmds+=("${history[${match[1]}]}") - fi - elif [[ $line == [[:blank:]]#(#b)(<->)(#B)( |\* )* ]]; then - zle .push-line - zle vi-fetch-history -n ${match[1]} - (( ${#BUFFER} )) && cmds+=("${BUFFER}") - BUFFER="" - zle .get-line - fi - done - if (( ${#cmds[@]} )); then - BUFFER="${(pj:\n:)${(@)cmds%%$'\n'#}}" - CURSOR=${#BUFFER} - fi - else - LBUFFER="$selected" - fi - fi - zle reset-prompt - return $ret -} -if [[ ${FZF_CTRL_R_COMMAND-x} != "" ]]; then - if [[ -n ${FZF_CTRL_R_COMMAND-} ]]; then - echo "warning: FZF_CTRL_R_COMMAND is set to a custom command, but custom commands are not yet supported for CTRL-R" >&2 - fi - zle -N fzf-history-widget - bindkey -M emacs '^R' fzf-history-widget - bindkey -M vicmd '^R' fzf-history-widget - bindkey -M viins '^R' fzf-history-widget -fi -fi - -} always { - eval $__fzf_key_bindings_options - 'unset' '__fzf_key_bindings_options' -} diff --git a/dot_gitconfig.tmpl b/dot_config/git/config.tmpl similarity index 73% rename from dot_gitconfig.tmpl rename to dot_config/git/config.tmpl index c48c554..82f39dc 100644 --- a/dot_gitconfig.tmpl +++ b/dot_config/git/config.tmpl @@ -1,3 +1,5 @@ +# The dotfiles' git settings. git reads ~/.gitconfig after this file, and +# git config --global writes there, so tools' settings stay out of the dotfiles [user] email = pcreighton429@gmail.com name = Patrick Creighton @@ -40,6 +42,20 @@ autoStash = true [log] date = local +{{- $gh := printf "%s/.local/share/mise/shims/gh" .chezmoi.homeDir }} +{{- if eq .chezmoi.os "windows" }} +{{- $gh = printf "%s/AppData/Local/mise/shims/gh.exe" .chezmoi.homeDir }} +{{- end }} +# git gets GitHub credentials from gh, through mise's shim, which runs the gh in +# mise.lock. gh auth login leaves git's settings alone since gh is already the +# helper. gh auth setup-git would add the path of the gh it runs, which mise +# upgrade removes +[credential "https://github.com"] + helper = + helper = !'{{ $gh }}' auth git-credential +[credential "https://gist.github.com"] + helper = + helper = !'{{ $gh }}' auth git-credential [alias] # from https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git a = add diff --git a/dot_config/hatch/config.toml b/dot_config/hatch/config.toml deleted file mode 100644 index d41da07..0000000 --- a/dot_config/hatch/config.toml +++ /dev/null @@ -1,9 +0,0 @@ -[template] -name = "Patrick Creighton" -email = "pcreighton429@gmail.com" - -[template.plugins.default] -ci = true - -[dirs.env] -virtual = ".venv" diff --git a/dot_config/komorebi/applications.yaml b/dot_config/komorebi/applications.yaml deleted file mode 100644 index 549d575..0000000 --- a/dot_config/komorebi/applications.yaml +++ /dev/null @@ -1,1519 +0,0 @@ -- name: 1Password - identifier: - kind: Exe - id: 1Password.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: 1Password.exe - matching_strategy: Equals -- name: Ableton Live - identifier: - kind: Class - id: Ableton Live Window Class - matching_strategy: Legacy - float_identifiers: - - kind: Class - id: AbletonVstPlugClass - matching_strategy: Legacy - - kind: Class - id: Vst3PlugWindow - matching_strategy: Legacy -- name: Adobe Creative Cloud - identifier: - kind: Class - id: CreativeCloudDesktopWindowClass - matching_strategy: Legacy - options: - - tray_and_multi_window -- name: Adobe Photoshop - identifier: - kind: Class - id: Photoshop - matching_strategy: Legacy -- name: Adobe Premiere Pro - identifier: - kind: Class - id: Premiere Pro - matching_strategy: Legacy - float_identifiers: - - kind: Class - id: DroverLord - Window Class - matching_strategy: Equals -- name: Affinity Designer 2 - identifier: - kind: Title - id: Affinity Designer 2 - matching_strategy: Equals - options: - - force - float_identifiers: - - kind: Exe - id: Designer.exe - matching_strategy: Equals -- name: Affinity Photo 2 - identifier: - kind: Title - id: Affinity Photo 2 - matching_strategy: Equals - options: - - force - float_identifiers: - - kind: Exe - id: Photo.exe - matching_strategy: Equals -- name: Affinity Publisher 2 - identifier: - kind: Title - id: Affinity Publisher 2 - matching_strategy: Equals - options: - - force - float_identifiers: - - kind: Exe - id: Publisher.exe - matching_strategy: Equals -- name: Akiflow - identifier: - kind: Exe - id: Akiflow.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Amazon Chime - identifier: - kind: Exe - id: Chime.exe - matching_strategy: Equals - float_identifiers: - - kind: Title - id: Meeting Controls - matching_strategy: EndsWith -- name: Android Studio - identifier: - kind: Exe - id: studio64.exe - matching_strategy: Equals - options: - - object_name_change -- name: Anki - identifier: - kind: Exe - id: anki.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: ArmCord - identifier: - kind: Exe - id: ArmCord.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: AutoHotkey - identifier: - kind: Exe - id: AutoHotkeyU64.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Title - id: Window Spy - matching_strategy: StartsWith - - kind: Exe - id: AutoHotkeyUX.exe - matching_strategy: Equals -- name: Beeper - identifier: - kind: Exe - id: Beeper.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Bitwarden - identifier: - kind: Exe - id: Bitwarden.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Blitz - identifier: - kind: Exe - id: Blitz.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Bloxstrap - identifier: - kind: Exe - id: Bloxstrap.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Bloxstrap.exe - matching_strategy: Equals -- name: Brave Browser - identifier: - kind: Exe - id: brave.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: CLion - identifier: - kind: Exe - id: clion64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: SunAwtDialog - matching_strategy: Equals -- name: Calculator - identifier: - kind: Title - id: Calculator - matching_strategy: Equals - float_identifiers: - - kind: Title - id: Calculator - matching_strategy: Equals -- name: Citrix Receiver - identifier: - kind: Exe - id: SelfService.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: SelfService.exe - matching_strategy: Equals -- name: Clash Verge - identifier: - kind: Exe - id: Clash Verge.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Clementine - identifier: - kind: Exe - id: clementine.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: CopyQ - identifier: - kind: Exe - id: copyq.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Core Temp - identifier: - kind: Exe - id: Core Temp.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Core Temp.exe - matching_strategy: Equals -- name: Credential Manager UI Host - identifier: - kind: Exe - id: CredentialUIBroker.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: CredentialUIBroker.exe - matching_strategy: Equals -- name: Cron - identifier: - kind: Exe - id: Cron.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: DS4Windows - identifier: - kind: Exe - id: DS4Windows.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: DataGrip - identifier: - kind: Exe - id: datagrip64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window -- name: Delphi applications - identifier: - kind: Class - id: TApplication - matching_strategy: Legacy - float_identifiers: - - kind: Class - id: TApplication - matching_strategy: Legacy - - kind: Class - id: TWizardForm - matching_strategy: Legacy -- name: Discord - identifier: - kind: Exe - id: Discord.exe - matching_strategy: Equals - options: - - tray_and_multi_window - - layered -- name: Discord Bot Client - identifier: - kind: Exe - id: DiscordBotClient.exe - matching_strategy: Equals -- name: DiscordCanary - identifier: - kind: Exe - id: DiscordCanary.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: DiscordDevelopment - identifier: - kind: Exe - id: DiscordDevelopment.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: DiscordPTB - identifier: - kind: Exe - id: DiscordPTB.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Docker Desktop - identifier: - kind: Exe - id: Docker Desktop.exe - matching_strategy: Equals -- name: Dropbox - identifier: - kind: Exe - id: Dropbox.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Dropbox.exe - matching_strategy: Equals -- name: EA Desktop Client - identifier: - kind: Exe - id: EADesktop.exe - matching_strategy: Equals -- name: Eagle - identifier: - kind: Exe - id: Eagle.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: ElectronMail - identifier: - kind: Exe - id: ElectronMail.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Element - identifier: - kind: Exe - id: Element.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Elephicon - identifier: - kind: Exe - id: Elephicon.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Elephicon.exe - matching_strategy: Equals -- name: ElevenClock - identifier: - kind: Exe - id: ElevenClock.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Elgato Camera Hub - identifier: - kind: Exe - id: Camera Hub.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Camera Hub.exe - matching_strategy: Equals -- name: Elgato Control Center - identifier: - kind: Exe - id: ControlCenter.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: ControlCenter.exe - matching_strategy: Equals -- name: Elgato Wave Link - identifier: - kind: Exe - id: WaveLink.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: WaveLink.exe - matching_strategy: Equals -- name: Epic Games Launcher - identifier: - kind: Exe - id: EpicGamesLauncher.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Everything - identifier: - kind: Class - id: EVERYTHING - matching_strategy: Legacy - options: - - tray_and_multi_window -- name: Everything1.5a - identifier: - kind: Class - id: EVERYTHING_(1.5a) - matching_strategy: Legacy - options: - - force - - tray_and_multi_window -- name: FFMetrics - identifier: - kind: Exe - id: FFMetrics.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Figma - identifier: - kind: Exe - id: Figma.exe - matching_strategy: Equals -- name: Files - identifier: - kind: Exe - id: Files.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Flow Launcher - identifier: - kind: Exe - id: Flow.Launcher.exe - matching_strategy: Equals -- name: GOG Galaxy - identifier: - kind: Exe - id: GalaxyClient.exe - matching_strategy: Equals - options: - - force - - tray_and_multi_window - float_identifiers: - - kind: Class - id: Chrome_RenderWidgetHostHWND - matching_strategy: Legacy -- name: GitHub Credential Manager - identifier: - kind: Exe - id: git-credential-manager.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: git-credential-manager.exe - matching_strategy: Equals -- name: GitHub Desktop - identifier: - kind: Exe - id: GitHubDesktop.exe - matching_strategy: Equals -- name: GoPro Webcam - identifier: - kind: Class - id: GoPro Webcam - matching_strategy: Legacy - options: - - tray_and_multi_window -- name: Godot Manager - identifier: - kind: Exe - id: GodotManager.exe - matching_strategy: Equals - options: - - force - - object_name_change -- name: Golden Dict - identifier: - kind: Exe - id: GoldenDict.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Google Chrome - identifier: - kind: Exe - id: chrome.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Google Drive - identifier: - kind: Exe - id: GoogleDriveFS.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: GoogleDriveFS.exe - matching_strategy: Equals -- name: Guitar Rig 7 - identifier: - kind: Exe - id: Guitar Rig 7.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Guitar Rig 7.exe - matching_strategy: Equals -- name: Honeyview - identifier: - kind: Class - id: HoneyviewClassX - matching_strategy: Legacy -- name: Houdoku - identifier: - kind: Exe - id: Houdoku.exe - matching_strategy: Equals -- name: IntelliJ IDEA - identifier: - kind: Exe - id: idea64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: SunAwtDialog - matching_strategy: Equals -- name: Itch.io - identifier: - kind: Exe - id: itch.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: KOOK - identifier: - kind: Exe - id: KOOK.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Keyviz - identifier: - kind: Exe - id: keyviz.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: keyviz.exe - matching_strategy: Equals -- name: Kleopatra - identifier: - kind: Exe - id: kleopatra.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Kotatogram - identifier: - kind: Exe - id: Kotatogram.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: LocalSend - identifier: - kind: Exe - id: localsend_app.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Logi Bolt - identifier: - kind: Exe - id: LogiBolt.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: LogiBolt.exe - matching_strategy: Equals -- name: LogiTune - identifier: - kind: Exe - id: LogiTune.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: LogiTune.exe - matching_strategy: Equals -- name: Logitech G HUB - identifier: - kind: Exe - id: lghub.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Logitech Options - identifier: - kind: Exe - id: LogiOptionsUI.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: LogiOptionsUI.exe - matching_strategy: Equals -- name: Mailspring - identifier: - kind: Exe - id: mailspring.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: ManicTime - identifier: - kind: Exe - id: ManicTimeClient.exe - matching_strategy: Equals - options: - - force - - object_name_change - - tray_and_multi_window -- name: ManyCam - identifier: - kind: Exe - id: ManyCam.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Mattermost - identifier: - kind: Exe - id: Mattermost.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Mica For Everyone - identifier: - kind: Exe - id: MicaForEveryone.exe - matching_strategy: Equals -- name: Microsoft Active Accessibility - identifier: - kind: Class - id: '' - matching_strategy: Legacy - float_identifiers: - - kind: Class - id: '#32770' - matching_strategy: Legacy -- name: Microsoft Excel - identifier: - kind: Exe - id: EXCEL.EXE - matching_strategy: Equals - options: - - layered - float_identifiers: - - kind: Class - id: _WwB - matching_strategy: Legacy -- name: Microsoft Outlook - identifier: - kind: Exe - id: OUTLOOK.EXE - matching_strategy: Equals - options: - - layered - - tray_and_multi_window - float_identifiers: - - kind: Class - id: _WwB - matching_strategy: Legacy - - kind: Class - id: MsoSplash - matching_strategy: Equals -- name: Microsoft PC Manager - identifier: - kind: Exe - id: MSPCManager.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: MSPCManager.exe - matching_strategy: Equals -- name: Microsoft PowerPoint - identifier: - kind: Exe - id: POWERPNT.EXE - matching_strategy: Equals - options: - - layered - float_identifiers: - - kind: Class - id: _WwB - matching_strategy: Legacy -- name: Microsoft SQL Server Management Studio - identifier: - kind: Exe - id: Ssms.exe - matching_strategy: Equals -- name: Microsoft Teams - identifier: - kind: Class - id: TeamsWebView - matching_strategy: Legacy - options: - - tray_and_multi_window -- name: Microsoft Teams classic - identifier: - kind: Exe - id: Teams.exe - matching_strategy: Equals - float_identifiers: - - kind: Title - id: Microsoft Teams Notification - matching_strategy: Legacy - - kind: Title - id: Microsoft Teams Call - matching_strategy: Legacy -- name: Microsoft Word - identifier: - kind: Exe - id: WINWORD.EXE - matching_strategy: Equals - options: - - layered - float_identifiers: - - kind: Class - id: _WwB - matching_strategy: Legacy -- name: Modern Flyouts - identifier: - kind: Exe - id: ModernFlyoutsHost.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Morgen - identifier: - kind: Exe - id: Morgen.exe - matching_strategy: Equals -- name: Mozilla Firefox - identifier: - kind: Exe - id: firefox.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: MozillaTaskbarPreviewClass - matching_strategy: Legacy - - - kind: Title - id: Picture-in-Picture - matching_strategy: Equals - - kind: Exe - id: firefox.exe - matching_strategy: Equals -- name: MuseScore - identifier: - kind: Exe - id: MuseScore.exe - matching_strategy: Equals -- name: NVIDIA GeForce Experience - identifier: - kind: Exe - id: NVIDIA GeForce Experience.exe - matching_strategy: Equals -- name: NZXT CAM - identifier: - kind: Exe - id: NZXT CAM.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: NetEase Cloud Music - identifier: - kind: Exe - id: cloudmusic.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: NiceHash Miner - identifier: - kind: Exe - id: nhm_app.exe - matching_strategy: Equals - options: - - force -- name: NohBoard - identifier: - kind: Exe - id: NohBoard.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: NohBoard.exe - matching_strategy: Equals -- name: Notion Enhanced - identifier: - kind: Exe - id: Notion Enhanced.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: OBS Studio (32-bit) - identifier: - kind: Exe - id: obs32.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: OBS Studio (64-bit) - identifier: - kind: Exe - id: obs64.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: ONLYOFFICE Editors - identifier: - kind: Class - id: DocEditorsWindowClass - matching_strategy: Legacy - options: - - tray_and_multi_window -- name: Obsidian - identifier: - kind: Exe - id: Obsidian.exe - matching_strategy: Equals -- name: OneDrive - identifier: - kind: Exe - id: OneDrive.exe - matching_strategy: Equals - float_identifiers: - - kind: Class - id: OneDriveReactNativeWin32WindowClass - matching_strategy: Legacy -- name: OneQuick - identifier: - kind: Exe - id: OneQuick.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: OpenRGB - identifier: - kind: Exe - id: OpenRGB.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Paradox Launcher - identifier: - kind: Exe - id: Paradox Launcher.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Paradox Launcher.exe - matching_strategy: Equals -- name: Passware Kit Forensic - identifier: - kind: Exe - id: PasswareKitForensic.exe - matching_strategy: Equals -- name: PhpStorm - identifier: - kind: Exe - id: phpstorm64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: SunAwtDialog - matching_strategy: Equals -- name: Playnite - identifier: - kind: Exe - id: Playnite.DesktopApp.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: Playnite.FullscreenApp.exe - matching_strategy: Equals -- name: Plexamp - identifier: - kind: Exe - id: Plexamp.exe - matching_strategy: Equals -- name: Postman - identifier: - kind: Exe - id: Postman.exe - matching_strategy: Equals -- name: PowerToys - identifier: - kind: Exe - id: PowerToys.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: PowerToys.ColorPickerUI.exe - matching_strategy: Equals - - kind: Exe - id: PowerToys.CropAndLock.exe - matching_strategy: Equals - - kind: Exe - id: PowerToys.ImageResizer.exe - matching_strategy: Equals - - kind: Exe - id: PowerToys.Peek.UI.exe - matching_strategy: Equals - - kind: Exe - id: PowerToys.PowerLauncher.exe - matching_strategy: Equals - - kind: Exe - id: PowerToys.PowerAccent.exe - matching_strategy: Equals -- name: Process Hacker - identifier: - kind: Exe - id: ProcessHacker.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: ProcessHacker.exe - matching_strategy: Equals -- name: ProtonDrive - identifier: - kind: Exe - id: ProtonDrive.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: ProtonVPN - identifier: - kind: Exe - id: ProtonVPN.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: PyCharm - identifier: - kind: Exe - id: pycharm64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: SunAwtDialog - matching_strategy: Equals -- name: QQ - identifier: - kind: Exe - id: QQ.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Title - id: 图片查看器 - matching_strategy: Legacy - - kind: Title - id: 群聊的聊天记录 - matching_strategy: Legacy - - kind: Title - id: 语音通话 - matching_strategy: Legacy -- name: QtScrcpy - identifier: - kind: Exe - id: QtScrcpy.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: QuickLook - identifier: - kind: Exe - id: QuickLook.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: QuickLook.exe - matching_strategy: Equals -- name: RepoZ - identifier: - kind: Exe - id: RepoZ.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: RepoZ.exe - matching_strategy: Equals -- name: Rider - identifier: - kind: Exe - id: rider64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: SunAwtDialog - matching_strategy: Equals - - kind: Title - id: PopupMessageWindow - matching_strategy: Legacy -- name: Roblox FPS Unlocker - identifier: - kind: Exe - id: rbxfpsunlocker.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: RoundedTB - identifier: - kind: Exe - id: RoundedTB.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: RoundedTB.exe - matching_strategy: Equals -- name: RoundedTB - identifier: - kind: Exe - id: RoundedTB.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: RustRover - identifier: - kind: Exe - id: rustrover64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: SunAwtDialog - matching_strategy: Equals -- name: Sandboxie Plus - identifier: - kind: Exe - id: SandMan.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: ShareX - identifier: - kind: Exe - id: ShareX.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Sideloadly - identifier: - kind: Exe - id: sideloadly.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: sideloadly.exe - matching_strategy: Equals -- name: Signal - identifier: - kind: Exe - id: Signal.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: SiriKali - identifier: - kind: Exe - id: sirikali.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Slack - identifier: - kind: Exe - id: Slack.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Class - id: Chrome_RenderWidgetHostHWND - matching_strategy: Legacy -- name: Slack - identifier: - kind: Exe - id: slack.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Class - id: Chrome_RenderWidgetHostHWND - matching_strategy: Legacy -- name: Smart Install Maker - identifier: - kind: Exe - id: SIM.exe - matching_strategy: Equals - float_identifiers: - - kind: Class - id: obj_App - matching_strategy: Legacy - - kind: Class - id: obj_Form - matching_strategy: Legacy -- name: SnippingTool - identifier: - kind: Exe - id: SnippingTool.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: SnippingTool.exe - matching_strategy: Equals -- name: SoulseekQt - identifier: - kind: Exe - id: SoulseekQt.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: SpaceWalker.Desktop - identifier: - kind: Exe - id: SpaceWalker.Desktop.exe - matching_strategy: Equals -- name: SpaceWalker.Unity.exe - identifier: - kind: Exe - id: SpaceWalker.Unity.exe - matching_strategy: Equals -- name: Spotify - identifier: - kind: Exe - id: Spotify.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Steam - identifier: - kind: Class - id: vguiPopupWindow - matching_strategy: Legacy - float_identifiers: - - - kind: Exe - id: steamwebhelper.exe - matching_strategy: Equals - - kind: Title - id: Steam - matching_strategy: DoesNotEqual -- name: Steam Beta - identifier: - kind: Class - id: SDL_app - matching_strategy: Legacy - options: - - tray_and_multi_window - float_identifiers: - - kind: Title - id: notificationtoasts_ - matching_strategy: Legacy -- name: Stremio - identifier: - kind: Exe - id: stremio.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: System Informer - identifier: - kind: Exe - id: SystemInformer.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: SystemInformer.exe - matching_strategy: Equals -- name: SystemSettings - identifier: - kind: Exe - id: SystemSettings.exe - matching_strategy: Equals - float_identifiers: - - kind: Class - id: Shell_Dialog - matching_strategy: Legacy -- name: Task Manager - identifier: - kind: Exe - id: Taskmgr.exe - matching_strategy: Equals - float_identifiers: - - kind: Class - id: TaskManagerWindow - matching_strategy: Legacy -- name: Telegram - identifier: - kind: Exe - id: Telegram.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: TickTick - identifier: - kind: Exe - id: TickTick.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Total Commander - identifier: - kind: Exe - id: TotalCMD64.exe - matching_strategy: Equals - float_identifiers: - - kind: Class - id: TDLG2FILEACTIONMIN - matching_strategy: Equals -- name: TouchCursor - identifier: - kind: Exe - id: tcconfig.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: tcconfig.exe - matching_strategy: Equals -- name: TranslucentTB - identifier: - kind: Exe - id: TranslucentTB.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: TranslucentTB.exe - matching_strategy: Equals -- name: TranslucentTB - identifier: - kind: Exe - id: TranslucentTB.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Unity Hub - identifier: - kind: Exe - id: Unity Hub.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Unreal Editor - identifier: - kind: Exe - id: UnrealEditor.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: VMware Horizon Client - identifier: - kind: Exe - id: vmware-view.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: VRCX - identifier: - kind: Exe - id: VRCX.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Visual Studio - identifier: - kind: Exe - id: devenv.exe - matching_strategy: Equals - options: - - object_name_change -- name: Visual Studio Code - identifier: - kind: Exe - id: Code.exe - matching_strategy: Equals -- name: Visual Studio Code - Insiders - identifier: - kind: Exe - id: Code - Insiders.exe - matching_strategy: Equals -- name: Voice.ai - identifier: - kind: Exe - id: VoiceAI.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: WebStorm - identifier: - kind: Exe - id: webstorm64.exe - matching_strategy: Equals - options: - - object_name_change - - tray_and_multi_window - float_identifiers: - - kind: Class - id: SunAwtDialog - matching_strategy: Equals -- name: WebTorrent Desktop - identifier: - kind: Exe - id: WebTorrent.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: WinZip (32-bit) - identifier: - kind: Exe - id: winzip32.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: winzip32.exe - matching_strategy: Equals -- name: WinZip (64-bit) - identifier: - kind: Exe - id: winzip64.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: winzip64.exe - matching_strategy: Equals -- name: Windows Console (conhost.exe) - identifier: - kind: Class - id: ConsoleWindowClass - matching_strategy: Equals - options: - - force -- name: Windows Explorer - identifier: - kind: Exe - id: explorer.exe - matching_strategy: Equals - float_identifiers: - - kind: Class - id: OperationStatusWindow - matching_strategy: Legacy - - kind: Title - id: Control Panel - matching_strategy: Legacy -- name: Windows Installer - identifier: - kind: Exe - id: msiexec.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: msiexec.exe - matching_strategy: Equals -- name: Windows Subsystem for Android - identifier: - kind: Exe - id: WsaClient.exe - matching_strategy: Equals - float_identifiers: - - kind: Class - id: android(splash) - matching_strategy: Legacy -- name: Windows Update Standalone Installer - identifier: - kind: Exe - id: wusa.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: wusa.exe - matching_strategy: Equals -- name: WingetUI - identifier: - kind: Exe - id: WingetUI.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: WingetUI - identifier: - kind: Exe - id: wingetui.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Wox - identifier: - kind: Exe - id: Wox.exe - matching_strategy: Equals - float_identifiers: - - kind: Title - id: Hotkey sink - matching_strategy: Legacy -- name: XAMPP Control Panel - identifier: - kind: Exe - id: xampp-control.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: Zebar - identifier: - kind: Exe - id: Zebar.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Zebar.exe - matching_strategy: Equals -- name: Zoom - identifier: - kind: Exe - id: Zoom.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: Zoom.exe - matching_strategy: Equals -- name: komorebi-gui - identifier: - kind: Exe - id: komorebi-gui.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: komorebi-gui.exe - matching_strategy: Equals -- name: mpv - identifier: - kind: Class - id: mpv - matching_strategy: Legacy - options: - - object_name_change -- name: mpv.net - identifier: - kind: Exe - id: mpvnet.exe - matching_strategy: Equals - options: - - object_name_change -- name: paint.net - identifier: - kind: Exe - id: paintdotnet.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: paintdotnet.exe - matching_strategy: Equals -- name: pinentry - identifier: - kind: Exe - id: pinentry.exe - matching_strategy: Equals - float_identifiers: - - kind: Exe - id: pinentry.exe - matching_strategy: Equals -- name: qBittorrent - identifier: - kind: Exe - id: qbittorrent.exe - matching_strategy: Equals - options: - - tray_and_multi_window -- name: todoist - identifier: - kind: Exe - id: Todoist.exe - matching_strategy: Equals -- name: ueli - identifier: - kind: Exe - id: ueli.exe - matching_strategy: Equals - options: - - tray_and_multi_window - float_identifiers: - - kind: Exe - id: ueli.exe - matching_strategy: Equals diff --git a/dot_config/komorebi/komorebi.json b/dot_config/komorebi/komorebi.json deleted file mode 100644 index 2111233..0000000 --- a/dot_config/komorebi/komorebi.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.28/schema.json", - "app_specific_configuration_path": "$Env:USERPROFILE/.config/komorebi/applications.yaml", - "window_hiding_behaviour": "Cloak", - "cross_monitor_move_behaviour": "Insert", - "default_workspace_padding": 10, - "default_container_padding": 10, - "border": true, - "border_width": 8, - "border_offset": -1, - "border_colours": { - "single": "#42a5f5", - "stack": "#00a542", - "monocle": "#ff3399", - "unfocused": "#808080" - }, - "stackbar": { - "height": 40, - "mode": "OnStack", - "tabs": { - "width": 300, - "focused_text": "#00a542", - "unfocused_text": "#b3b3b3", - "background": "#141414" - } - }, - "monitors": [ - { - "workspaces": [ - { - "name": "I", - "layout": "BSP" - }, - { - "name": "II", - "layout": "VerticalStack" - }, - { - "name": "III", - "layout": "HorizontalStack" - }, - { - "name": "IV", - "layout": "UltrawideVerticalStack" - }, - { - "name": "V", - "layout": "Rows" - }, - { - "name": "VI", - "layout": "Grid" - }, - { - "name": "VII", - "layout": "RightMainVerticalStack" - } - ] - } - ] -} diff --git a/dot_config/mise/config.toml b/dot_config/mise/config.toml new file mode 100644 index 0000000..38d241a --- /dev/null +++ b/dot_config/mise/config.toml @@ -0,0 +1,60 @@ +# Tools that mise (https://mise.jdx.dev) installs. chezmoi applies this file and +# mise.lock to ~/.config/mise, and the run_onchange_after_install-cli-tools +# scripts install the tools whenever either changes. +# +# - mise installs the tools in ~/.local/share/mise/installs, or +# %LOCALAPPDATA%\mise\installs on Windows. `mise activate` in .zshrc and the +# PowerShell profile puts the versions in mise.lock on PATH. +# - mise.lock pins the version, URL and checksum of each tool, so that every +# machine installs the same builds. The install scripts only install what it +# lists (`mise install --locked`). +# - Add or change a tool with `mise use -g TOOL[@VERSION]`, and update the tools +# with `mise upgrade`. Both keep these comments and update mise.lock. After +# editing this file by hand, update mise.lock with `mise lock --global`. Then +# save the changes with `chezmoi re-add ~/.config/mise`, and commit them. +# - Roll back an update by reverting its commit and running `chezmoi apply`. +# - Run a tool once without adding it with `mise exec TOOL@VERSION -- COMMAND`. +# mise updates itself, or run `mise self-update`. +# +# See https://mise.jdx.dev/configuration.html +[settings] +# Platforms that mise.lock has downloads for. To set up another kind of machine, +# add its platform and run `mise lock --global`. +lockfile_platforms = ["linux-arm64", "linux-x64", "macos-arm64", "windows-x64"] +# Skip tool and mise releases from the last 7 days, which gives others time to +# find a compromised or broken release. It doesn't change the versions in +# mise.lock. Take a release early with `mise upgrade --minimum-release-age 0s TOOL`. +minimum_release_age = "7d" +# Update mise once a week, before a command that may download something, except +# in CI and scripts +self_update.auto = true + +[tools] +# On Linux, the glibc builds of atuin and yazi need glibc 2.39 (Ubuntu 24.04), +# so use their static musl builds until the dotfiles drop Ubuntu 22.04. mise +# uses glibc builds for the other tools, which matters for lsd: its musl build +# shows uid/gid instead of user names. mise skips tmux on Windows, which it has +# no builds for. +atuin = { version = "latest", libc = "musl" } +bat = "latest" +# The tree-sitter CLI, which nvim-treesitter builds parsers with. Its official +# builds need glibc 2.39 (Ubuntu 24.04) since 0.26.1, the oldest version +# nvim-treesitter supports, so use conda-forge's build until the dotfiles drop +# Ubuntu 22.04. Then switch to the official build: tree-sitter = "latest". +"conda:tree-sitter-cli" = "latest" +delta = "latest" +dust = "latest" +fd = "latest" +fzf = "latest" +gh = "latest" +go = "latest" +lazygit = "latest" +lsd = "latest" +neovim = "latest" +node = "lts" +ripgrep = "latest" +starship = "latest" +tmux = "latest" +uv = "latest" +yazi = { version = "latest", libc = "musl" } +zoxide = "latest" diff --git a/dot_config/mise/mise.lock b/dot_config/mise/mise.lock new file mode 100644 index 0000000..a336b11 --- /dev/null +++ b/dot_config/mise/mise.lock @@ -0,0 +1,531 @@ +# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html + +lockfile_version = 4 + +[conda-packages.linux-arm64."_openmp_mutex-4.5-20_gnu"] +url = "https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-20_gnu.conda" +checksum = "sha256:a2527b1d81792a0ccd2c05850960df119c2b6d8f5fdec97f2db7d25dc23b1068" + +[conda-packages.linux-arm64."libgcc-16.2.0-h205dda4_7"] +url = "https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.2.0-h205dda4_7.conda" +checksum = "sha256:eae7a3449d5a3b5351c5427137c076cc3fc826645c7bfc42dc10772b783826f1" + +[conda-packages.linux-arm64."libgomp-16.2.0-h8acb6b2_7"] +url = "https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.2.0-h8acb6b2_7.conda" +checksum = "sha256:4406fd67c5beeb99b9372f9bf07aa3e40ca141e337eceebac3ff64aa72799494" + +[conda-packages.linux-x64."_openmp_mutex-4.5-20_gnu"] +url = "https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda" +checksum = "sha256:1dd3fffd892081df9726d7eb7e0dea6198962ba775bd88842135a4ddb4deb3c9" + +[conda-packages.linux-x64."libgcc-16.2.0-ha9f2e26_7"] +url = "https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.2.0-ha9f2e26_7.conda" +checksum = "sha256:e031634c3a928f9594eba868bc46ef5230d6571a364a0c63215b06c4563bfcea" + +[conda-packages.linux-x64."libgomp-16.2.0-he0feb66_7"] +url = "https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.2.0-he0feb66_7.conda" +checksum = "sha256:92a0bb350c7be6a4eedcb4e111c60aefd176018e6b1c009a6e025dbe9bbcd758" + +[conda-packages.windows-x64."ucrt-10.0.26100.0-h57928b3_0"] +url = "https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda" +checksum = "sha256:3005729dce6f3d3f5ec91dfc49fc75a0095f9cd23bab49efb899657297ac91a5" + +[conda-packages.windows-x64."vc-14.5-hda273ae_43"] +url = "https://conda.anaconda.org/conda-forge/win-64/vc-14.5-hda273ae_43.conda" +checksum = "sha256:b021e65bf2240a3256639913aef12f14e63c396170a103285adecfbff9bb01ac" + +[conda-packages.windows-x64."vc14_runtime-14.51.36247-h072b54c_43"] +url = "https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.51.36247-h072b54c_43.conda" +checksum = "sha256:02e21ff2ff06c7e45e10b72953cb2b1739e8dad7a4a8a49c814897cfabefaada" + +[conda-packages.windows-x64."vcomp14-14.51.36247-h1c3f1cb_43"] +url = "https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.51.36247-h1c3f1cb_43.conda" +checksum = "sha256:159fe1bb304d6a8e82a0e4b71762c05325cff3d472e4a1d49465c9def61a785e" + +[[tools.atuin]] +version = "18.24.5" +backend = "aqua:atuinsh/atuin" +specifiers = ["latest"] + +[tools.atuin.options] +libc = "musl" + +[tools.atuin."platforms.linux-arm64"] +checksum = "sha256:b44b3f264652b847b2e524ec397aa498c13076ed75cf213239ed2b9a0de2f99d" +url = "https://github.com/atuinsh/atuin/releases/download/v18.24.5/atuin-aarch64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/atuinsh/atuin/releases/assets/707958969" +provenance = "github-attestations" + +[tools.atuin."platforms.linux-x64"] +checksum = "sha256:54182762c9d91a4f779748f622749ff6963956db005feb13e62d037196b05618" +url = "https://github.com/atuinsh/atuin/releases/download/v18.24.5/atuin-x86_64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/atuinsh/atuin/releases/assets/707959222" +provenance = "github-attestations" + +[tools.atuin."platforms.macos-arm64"] +checksum = "sha256:644e92d5667e2ebbc00758c71d5974bc907d238eaa6cdc32b24eb73dce7f9a5a" +url = "https://github.com/atuinsh/atuin/releases/download/v18.24.5/atuin-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/atuinsh/atuin/releases/assets/707958967" +provenance = "github-attestations" + +[tools.atuin."platforms.windows-x64"] +checksum = "sha256:8ec5f2519d8019c129d3fb83a6c97eca29aa23391d8802af306d0c6de8cde30e" +url = "https://github.com/atuinsh/atuin/releases/download/v18.24.5/atuin-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/atuinsh/atuin/releases/assets/707959190" +provenance = "github-attestations" + +[[tools.bat]] +version = "0.26.1" +backend = "aqua:sharkdp/bat" +specifiers = ["latest"] + +[tools.bat."platforms.linux-arm64"] +checksum = "sha256:422eb73e11c854fddd99f5ca8461c2f1d6e6dce0a2a8c3d5daade5ffcb6564aa" +url = "https://github.com/sharkdp/bat/releases/download/v0.26.1/bat-v0.26.1-aarch64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/323548647" + +[tools.bat."platforms.linux-x64"] +checksum = "sha256:726f04c8f576a7fd18b7634f1bbf2f915c43494c1c0f013baa3287edb0d5a2a3" +url = "https://github.com/sharkdp/bat/releases/download/v0.26.1/bat-v0.26.1-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/323549181" + +[tools.bat."platforms.macos-arm64"] +checksum = "sha256:e30beff26779c9bf60bb541e1d79046250cb74378f2757f8eb250afddb19e114" +url = "https://github.com/sharkdp/bat/releases/download/v0.26.1/bat-v0.26.1-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/323548442" + +[tools.bat."platforms.windows-x64"] +checksum = "sha256:0f729b4b6f5f28d395c641eacc2e9ff68d0096b85aa0eec344aa62425144b69b" +url = "https://github.com/sharkdp/bat/releases/download/v0.26.1/bat-v0.26.1-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/sharkdp/bat/releases/assets/323549116" + +[[tools."conda:tree-sitter-cli"]] +version = "0.27.2" +backend = "conda:tree-sitter-cli" +specifiers = ["latest"] + +[tools."conda:tree-sitter-cli".options] +channel = "conda-forge" + +[tools."conda:tree-sitter-cli"."platforms.linux-arm64"] +checksum = "sha256:1a88951d519eb3d755de0224d38b85a6bed4689f51e5f55e8cb58a613b20aab1" +url = "https://conda.anaconda.org/conda-forge/linux-aarch64/tree-sitter-cli-0.27.2-h4f14f73_0.conda" +conda_deps = [ + "libgcc-16.2.0-h205dda4_7", + "_openmp_mutex-4.5-20_gnu", + "libgomp-16.2.0-h8acb6b2_7", +] + +[tools."conda:tree-sitter-cli"."platforms.linux-x64"] +checksum = "sha256:86ef467d84625d866710e056471df1f3007e958bc16abd898400b25b7afd9867" +url = "https://conda.anaconda.org/conda-forge/linux-64/tree-sitter-cli-0.27.2-hc7555a6_0.conda" +conda_deps = [ + "libgcc-16.2.0-ha9f2e26_7", + "_openmp_mutex-4.5-20_gnu", + "libgomp-16.2.0-he0feb66_7", +] + +[tools."conda:tree-sitter-cli"."platforms.macos-arm64"] +checksum = "sha256:bb012eb0bbaf3fc315be06168906a62d12c856e1ea1cf903754165e0bd6645cc" +url = "https://conda.anaconda.org/conda-forge/osx-arm64/tree-sitter-cli-0.27.2-h9f3b986_0.conda" +conda_deps = [] + +[tools."conda:tree-sitter-cli"."platforms.windows-x64"] +checksum = "sha256:f1553e6aca03a74b5469fe397c468ad2e4083e6932369dab04274df778bef082" +url = "https://conda.anaconda.org/conda-forge/win-64/tree-sitter-cli-0.27.2-h18a1a76_0.conda" +conda_deps = [ + "vc-14.5-hda273ae_43", + "vc14_runtime-14.51.36247-h072b54c_43", + "vcomp14-14.51.36247-h1c3f1cb_43", + "ucrt-10.0.26100.0-h57928b3_0", +] + +[[tools.delta]] +version = "0.20.1" +backend = "aqua:dandavison/delta" +specifiers = ["latest"] + +[tools.delta."platforms.linux-arm64"] +checksum = "sha256:da7f4338f593572ff426ae153e0870e2fdc72729416eff551b40cdeb67940db8" +url = "https://github.com/dandavison/delta/releases/download/0.20.1/delta-0.20.1-aarch64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/dandavison/delta/releases/assets/610499593" + +[tools.delta."platforms.linux-x64"] +checksum = "sha256:50f08c879f84c81ceb220e476491a7f492d2c9c671e79918cc44badf961a6240" +url = "https://github.com/dandavison/delta/releases/download/0.20.1/delta-0.20.1-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/dandavison/delta/releases/assets/610498121" + +[tools.delta."platforms.macos-arm64"] +checksum = "sha256:bc1839cea69288d4673a24faffbb825d408ca907e0f7d33b1678c9e6cdd5e58e" +url = "https://github.com/dandavison/delta/releases/download/0.20.1/delta-0.20.1-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/dandavison/delta/releases/assets/610498923" + +[tools.delta."platforms.windows-x64"] +checksum = "sha256:c9af7484b33f1dbc1312a892fc7d5753a6d3365140a4000d49e575a2de742c25" +url = "https://github.com/dandavison/delta/releases/download/0.20.1/delta-0.20.1-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/dandavison/delta/releases/assets/610501426" + +[[tools.dust]] +version = "1.2.7" +backend = "aqua:bootandy/dust" +specifiers = ["latest"] + +[tools.dust."platforms.linux-arm64"] +checksum = "sha256:64496fe9e56dabb379308b3a079816818f6022d0b93638d06206a9144ca795d9" +url = "https://github.com/bootandy/dust/releases/download/v1.2.7/dust-v1.2.7-aarch64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/bootandy/dust/releases/assets/699455926" + +[tools.dust."platforms.linux-x64"] +checksum = "sha256:ec3bf712c660dcaa5578b996741f5cca36b30c021c1e4b49352b11137a95a96e" +url = "https://github.com/bootandy/dust/releases/download/v1.2.7/dust-v1.2.7-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/bootandy/dust/releases/assets/699456259" + +[tools.dust."platforms.macos-arm64"] +checksum = "sha256:38e1b3b4e5e6a5cdb044b5fdb32ea45f18dc78276711796214806f20f7705a99" +url = "https://github.com/bootandy/dust/releases/download/v1.2.7/dust-v1.2.7-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/bootandy/dust/releases/assets/699455834" + +[tools.dust."platforms.windows-x64"] +checksum = "sha256:d07a41521958895e701ad55f342302b7362799d6a328c843e8e2208ba0564c30" +url = "https://github.com/bootandy/dust/releases/download/v1.2.7/dust-v1.2.7-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/bootandy/dust/releases/assets/699459326" + +[[tools.fd]] +version = "10.5.2" +backend = "aqua:sharkdp/fd" +specifiers = ["latest"] + +[tools.fd."platforms.linux-arm64"] +checksum = "sha256:4b144f38bd7352cd4c95020b58e8e575476e60edcdf1dc5e0733e3d01efba6dd" +url = "https://github.com/sharkdp/fd/releases/download/v10.5.2/fd-v10.5.2-aarch64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/sharkdp/fd/releases/assets/719978299" + +[tools.fd."platforms.linux-x64"] +checksum = "sha256:985e24041e9ef6e9a38e9e088743405dde23d7220aa96740f091862167d9ff28" +url = "https://github.com/sharkdp/fd/releases/download/v10.5.2/fd-v10.5.2-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/sharkdp/fd/releases/assets/719976301" + +[tools.fd."platforms.macos-arm64"] +checksum = "sha256:81bf98a16d3d7230e4a9123fcede243d71ea31a577113476ed43f1cdf4773162" +url = "https://github.com/sharkdp/fd/releases/download/v10.5.2/fd-v10.5.2-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/sharkdp/fd/releases/assets/719971048" + +[tools.fd."platforms.windows-x64"] +checksum = "sha256:7edac75ef96b7e9a01ebb251a21ee86ea365a09adcfb865f1ec3346a906153b6" +url = "https://github.com/sharkdp/fd/releases/download/v10.5.2/fd-v10.5.2-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/sharkdp/fd/releases/assets/719974267" + +[[tools.fzf]] +version = "0.75.0" +backend = "aqua:junegunn/fzf" +specifiers = ["latest"] + +[tools.fzf."platforms.linux-arm64"] +checksum = "sha256:bd0717badb6a5620387e014bb94209aac4d9eab6ab77b5348eabb0833aeb4d59" +url = "https://github.com/junegunn/fzf/releases/download/v0.75.0/fzf-0.75.0-linux_arm64.tar.gz" +url_api = "https://api.github.com/repos/junegunn/fzf/releases/assets/720590838" + +[tools.fzf."platforms.linux-x64"] +checksum = "sha256:0d6640f83582d991cf429754baad64b07e3a4e439a6019670f4b91da1314141c" +url = "https://github.com/junegunn/fzf/releases/download/v0.75.0/fzf-0.75.0-linux_amd64.tar.gz" +url_api = "https://api.github.com/repos/junegunn/fzf/releases/assets/720590794" + +[tools.fzf."platforms.macos-arm64"] +checksum = "sha256:1e76698eb481436e42119bea6aa6e2bd9552ff090789d769c286e3c3a4e0ded6" +url = "https://github.com/junegunn/fzf/releases/download/v0.75.0/fzf-0.75.0-darwin_arm64.tar.gz" +url_api = "https://api.github.com/repos/junegunn/fzf/releases/assets/720590797" + +[tools.fzf."platforms.windows-x64"] +checksum = "sha256:e3fb809d48094bea7f9f4df03b2fea33ae6e28a6cd32fdad9970cd79e1103901" +url = "https://github.com/junegunn/fzf/releases/download/v0.75.0/fzf-0.75.0-windows_amd64.zip" +url_api = "https://api.github.com/repos/junegunn/fzf/releases/assets/720590885" + +[[tools.gh]] +version = "2.103.3" +backend = "aqua:cli/cli" +specifiers = ["latest"] + +[tools.gh."platforms.linux-arm64"] +checksum = "sha256:ee32df2323c8847f5fac6cb6b4b69ca75828e9329a8f22f677021f7b3306ce63" +url = "https://github.com/cli/cli/releases/download/v2.103.3/gh_2.103.3_linux_arm64.tar.gz" +url_api = "https://api.github.com/repos/cli/cli/releases/assets/679195636" + +[tools.gh."platforms.linux-x64"] +checksum = "sha256:4c806978ffce1cec70853302a56d70ac6da4f19bae7adca4e1a8ab00633dd91d" +url = "https://github.com/cli/cli/releases/download/v2.103.3/gh_2.103.3_linux_amd64.tar.gz" +url_api = "https://api.github.com/repos/cli/cli/releases/assets/679195621" + +[tools.gh."platforms.macos-arm64"] +checksum = "sha256:d700207eae9ae98fe2b89535c2c087c07823d4628c56364695a5a07ef311c062" +url = "https://github.com/cli/cli/releases/download/v2.103.3/gh_2.103.3_macOS_arm64.zip" +url_api = "https://api.github.com/repos/cli/cli/releases/assets/679195704" + +[tools.gh."platforms.windows-x64"] +checksum = "sha256:98d0cfa794721665d7973dd728c78aff7bd836d58f10f6d7a03568eccb0a22e0" +url = "https://github.com/cli/cli/releases/download/v2.103.3/gh_2.103.3_windows_amd64.zip" +url_api = "https://api.github.com/repos/cli/cli/releases/assets/679195750" + +[[tools.go]] +version = "1.27.4" +backend = "core:go" +specifiers = ["latest"] + +[tools.go."platforms.linux-arm64"] +checksum = "sha256:3392582988a273a87ab5043ee1b2c9c17a2c3c00580bf9326c47a2e0aaaeac92" +url = "https://dl.google.com/go/go1.27.4.linux-arm64.tar.gz" + +[tools.go."platforms.linux-x64"] +checksum = "sha256:7226736c2339719cda28fbf3a54d71aa63bcefe376e98cef00034268dab24840" +url = "https://dl.google.com/go/go1.27.4.linux-amd64.tar.gz" + +[tools.go."platforms.macos-arm64"] +checksum = "sha256:91a44a2b8a716600ad94a4f143e156116620db8828086a6e3602291be9bd0bb4" +url = "https://dl.google.com/go/go1.27.4.darwin-arm64.tar.gz" + +[tools.go."platforms.windows-x64"] +checksum = "sha256:178ab98950ac69ab25069307dc6ade79f3816e414cce95b4da166a115cde1e7e" +url = "https://dl.google.com/go/go1.27.4.windows-amd64.zip" + +[[tools.lazygit]] +version = "0.66.3" +backend = "aqua:jesseduffield/lazygit" +specifiers = ["latest"] + +[tools.lazygit."platforms.linux-arm64"] +checksum = "sha256:ac0b48237f3d0283813e7154ec063237e519532feb0470c0881a1793ee78fd42" +url = "https://github.com/jesseduffield/lazygit/releases/download/v0.66.3/lazygit_0.66.3_linux_arm64.tar.gz" +url_api = "https://api.github.com/repos/jesseduffield/lazygit/releases/assets/722269035" + +[tools.lazygit."platforms.linux-x64"] +checksum = "sha256:0a23f429a95f0d09db298b3c291536d818de066aa5a85c255806f0490ff6656b" +url = "https://github.com/jesseduffield/lazygit/releases/download/v0.66.3/lazygit_0.66.3_linux_x86_64.tar.gz" +url_api = "https://api.github.com/repos/jesseduffield/lazygit/releases/assets/722268995" + +[tools.lazygit."platforms.macos-arm64"] +checksum = "sha256:6873e6b7a538b521c4d7ff3f76ec49e6dcafa41e6053a6aae33c12f62663e163" +url = "https://github.com/jesseduffield/lazygit/releases/download/v0.66.3/lazygit_0.66.3_darwin_arm64.tar.gz" +url_api = "https://api.github.com/repos/jesseduffield/lazygit/releases/assets/722268996" + +[tools.lazygit."platforms.windows-x64"] +checksum = "sha256:a76fe17339fd387c20addc09060f07c240e4b20a9f55fee4ad7c86a251c0741e" +url = "https://github.com/jesseduffield/lazygit/releases/download/v0.66.3/lazygit_0.66.3_windows_x86_64.zip" +url_api = "https://api.github.com/repos/jesseduffield/lazygit/releases/assets/722269081" + +[[tools.lsd]] +version = "1.2.0" +backend = "aqua:lsd-rs/lsd" +specifiers = ["latest"] + +[tools.lsd."platforms.linux-arm64"] +checksum = "sha256:48c069cf73a8ed0851f366afeac86e3a9b7db416133f45d033d31d123f819f26" +url = "https://github.com/lsd-rs/lsd/releases/download/v1.2.0/lsd-v1.2.0-aarch64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/lsd-rs/lsd/releases/assets/303319672" + +[tools.lsd."platforms.linux-x64"] +checksum = "sha256:57d3b5859254adcfb8374ce98159cca97a14959997d2ae1176d2cff59556d829" +url = "https://github.com/lsd-rs/lsd/releases/download/v1.2.0/lsd-v1.2.0-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/lsd-rs/lsd/releases/assets/303319829" + +[tools.lsd."platforms.macos-arm64"] +checksum = "sha256:9e34a5d392ff913302098aad0543dafa1883c531eaf229b82f086c3fca675e3e" +url = "https://github.com/lsd-rs/lsd/releases/download/v1.2.0/lsd-v1.2.0-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/lsd-rs/lsd/releases/assets/303319340" + +[tools.lsd."platforms.windows-x64"] +checksum = "sha256:a65b9f457153934a7ce1f7e0fe1c4922a95bb2822222126e4fbaa6ee9c0d78e5" +url = "https://github.com/lsd-rs/lsd/releases/download/v1.2.0/lsd-v1.2.0-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/lsd-rs/lsd/releases/assets/303320206" + +[[tools.neovim]] +version = "0.12.6" +backend = "vfox:jdx/vfox-neovim" +specifiers = ["latest"] + +[tools.neovim."platforms.linux-arm64"] +checksum = "sha256:8f1f64a0bdb97247034038c3823c6cbad5bdf9ecd5751b85494b71c3ee04c815" +url = "https://github.com/neovim/neovim/releases/download/v0.12.6/nvim-linux-arm64.tar.gz" + +[tools.neovim."platforms.linux-x64"] +checksum = "sha256:474430d53e6264f6d6dd18db42d6dc9df3a1b56ca9e88a325bbf860e1a811d87" +url = "https://github.com/neovim/neovim/releases/download/v0.12.6/nvim-linux-x86_64.tar.gz" + +[tools.neovim."platforms.macos-arm64"] +checksum = "sha256:1dbd148222b051ba6c307c4d17a318ed083df018a4f6a5a0ce46955ffc9ab87b" +url = "https://github.com/neovim/neovim/releases/download/v0.12.6/nvim-macos-arm64.tar.gz" + +[tools.neovim."platforms.windows-x64"] +checksum = "sha256:4e12b7103b601ffc8f25954b4da100f339faa73dccb69a5b135e897fa3d893ed" +url = "https://github.com/neovim/neovim/releases/download/v0.12.6/nvim-win64.zip" + +[[tools.node]] +version = "26.13.0" +backend = "core:node" +specifiers = ["lts"] + +[tools.node."platforms.linux-arm64"] +checksum = "sha256:439e9c438acdf6a6ffe47418da709153d66c4bed812e30a473faacb107dd2791" +url = "https://nodejs.org/dist/v26.13.0/node-v26.13.0-linux-arm64.tar.gz" + +[tools.node."platforms.linux-x64"] +checksum = "sha256:5848553868b402d3fabb5b09270649977780a390f832155721025a08b5104455" +url = "https://nodejs.org/dist/v26.13.0/node-v26.13.0-linux-x64.tar.gz" + +[tools.node."platforms.macos-arm64"] +checksum = "sha256:d38bd5e5a2ddce6bbb5ce45e46e208337da4d51fffe611e567fd32073d6439f6" +url = "https://nodejs.org/dist/v26.13.0/node-v26.13.0-darwin-arm64.tar.gz" + +[tools.node."platforms.windows-x64"] +checksum = "sha256:dcc60d59a0746999f99064a01c020445d54d84228c691cdbf25b49ac3b59150a" +url = "https://nodejs.org/dist/v26.13.0/node-v26.13.0-win-x64.zip" + +[[tools.ripgrep]] +version = "15.2.0" +backend = "aqua:BurntSushi/ripgrep" +specifiers = ["latest"] + +[tools.ripgrep."platforms.linux-arm64"] +checksum = "sha256:a740b91c82eaf9914cfedd353572f2791cbe0162c84101ee0951058f4dcbc90d" +url = "https://github.com/BurntSushi/ripgrep/releases/download/15.2.0/ripgrep-15.2.0-aarch64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/BurntSushi/ripgrep/releases/assets/478119579" + +[tools.ripgrep."platforms.linux-x64"] +checksum = "sha256:33e15bcf1624b25cdd2a55813a47a2f95dbe126268203e76aa6a585d1e7b149c" +url = "https://github.com/BurntSushi/ripgrep/releases/download/15.2.0/ripgrep-15.2.0-x86_64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/BurntSushi/ripgrep/releases/assets/478120097" + +[tools.ripgrep."platforms.macos-arm64"] +checksum = "sha256:3750b2e93f37e0c692657da574d7019a101c0084da05a790c83fd335bad973e4" +url = "https://github.com/BurntSushi/ripgrep/releases/download/15.2.0/ripgrep-15.2.0-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/BurntSushi/ripgrep/releases/assets/478118851" + +[tools.ripgrep."platforms.windows-x64"] +checksum = "sha256:71b2fef860abe467217a538ff31de02f5258807c0129f771846f87bd029aafc5" +url = "https://github.com/BurntSushi/ripgrep/releases/download/15.2.0/ripgrep-15.2.0-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/BurntSushi/ripgrep/releases/assets/478119643" + +[[tools.starship]] +version = "1.27.0" +backend = "aqua:starship/starship" +specifiers = ["latest"] + +[tools.starship."platforms.linux-arm64"] +checksum = "sha256:341f5cbf24699fa0b27ec88965ad25f862ea09e15d35a543fd6ffdff1d2aa00d" +url = "https://github.com/starship/starship/releases/download/v1.27.0/starship-aarch64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/starship/starship/releases/assets/650074383" + +[tools.starship."platforms.linux-x64"] +checksum = "sha256:3b94758850901717eb36aa1b53f8492c1322506ec6d41273bc6151e79ed8e4a1" +url = "https://github.com/starship/starship/releases/download/v1.27.0/starship-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/starship/starship/releases/assets/650074501" + +[tools.starship."platforms.macos-arm64"] +checksum = "sha256:5362da8cb2928f98f3ce0ffda697cf0f8de70081db000dae316d6d3a404f6cf0" +url = "https://github.com/starship/starship/releases/download/v1.27.0/starship-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/starship/starship/releases/assets/650074353" + +[tools.starship."platforms.windows-x64"] +checksum = "sha256:7764f861805376af2812dd78c84fadc16b714cf3f346baed9b597bfda8484403" +url = "https://github.com/starship/starship/releases/download/v1.27.0/starship-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/starship/starship/releases/assets/650074470" + +[[tools.tmux]] +version = "3.8" +backend = "aqua:tmux/tmux-builds" +specifiers = ["latest"] + +[tools.tmux."platforms.linux-arm64"] +checksum = "sha256:f399311b1159705e69839eaf4f6f68c8b8540dc3a8538b87c30dedb9c3c7fc23" +url = "https://github.com/tmux/tmux-builds/releases/download/v3.8/tmux-3.8-linux-arm64.tar.gz" +url_api = "https://api.github.com/repos/tmux/tmux-builds/releases/assets/721688993" + +[tools.tmux."platforms.linux-x64"] +checksum = "sha256:147849ff18b62a8aa3d5d8f75dd07c3f9fdfad529f932236afdec838fc1d15e1" +url = "https://github.com/tmux/tmux-builds/releases/download/v3.8/tmux-3.8-linux-x86_64.tar.gz" +url_api = "https://api.github.com/repos/tmux/tmux-builds/releases/assets/721688991" + +[tools.tmux."platforms.macos-arm64"] +checksum = "sha256:ec926bbf28ddf55d0dc7c9791d43e03e251ddab392d763f7fbb38d4b8408d051" +url = "https://github.com/tmux/tmux-builds/releases/download/v3.8/tmux-3.8-macos-arm64.tar.gz" +url_api = "https://api.github.com/repos/tmux/tmux-builds/releases/assets/721688988" + +[[tools.uv]] +version = "0.13.7" +backend = "aqua:astral-sh/uv" +specifiers = ["latest"] + +[tools.uv."platforms.linux-arm64"] +checksum = "sha256:71279f8d3c67241e807b9d8db872d1bf541579fb9f08b7d1eb1682196d1e57dc" +url = "https://github.com/astral-sh/uv/releases/download/0.13.7/uv-aarch64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/astral-sh/uv/releases/assets/704009469" +provenance = "github-attestations" + +[tools.uv."platforms.linux-x64"] +checksum = "sha256:c5221ff41b7892bfc223543883600125f6a47fe845093e0f5bdff4f359196d83" +url = "https://github.com/astral-sh/uv/releases/download/0.13.7/uv-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/astral-sh/uv/releases/assets/704009823" +provenance = "github-attestations" + +[tools.uv."platforms.macos-arm64"] +checksum = "sha256:81b811b57e4624df7ed3aac148e0359100d9962f3d9dce00aec533dc2e086731" +url = "https://github.com/astral-sh/uv/releases/download/0.13.7/uv-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/astral-sh/uv/releases/assets/704009442" +provenance = "github-attestations" + +[tools.uv."platforms.windows-x64"] +checksum = "sha256:0cdc5b38fe5a8168ed6a25814f5ba43c21d313dd3187314fccb37b7cec46e021" +url = "https://github.com/astral-sh/uv/releases/download/0.13.7/uv-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/astral-sh/uv/releases/assets/704009796" +provenance = "github-attestations" + +[[tools.yazi]] +version = "26.9.1" +backend = "aqua:sxyazi/yazi" +specifiers = ["latest"] + +[tools.yazi.options] +libc = "musl" + +[tools.yazi."platforms.linux-arm64"] +checksum = "sha256:dd569daecaae914185f295634109295ccd25c1b42b02eb89a74f651970024f2e" +url = "https://github.com/sxyazi/yazi/releases/download/v26.9.1/yazi-aarch64-unknown-linux-musl.zip" +url_api = "https://api.github.com/repos/sxyazi/yazi/releases/assets/539261411" + +[tools.yazi."platforms.linux-x64"] +checksum = "sha256:9b9c39decccf8cb0ff53a7d637d38f8a79d93bbd0099f4ea9c619ef6bb392f5d" +url = "https://github.com/sxyazi/yazi/releases/download/v26.9.1/yazi-x86_64-unknown-linux-musl.zip" +url_api = "https://api.github.com/repos/sxyazi/yazi/releases/assets/539261404" + +[tools.yazi."platforms.macos-arm64"] +checksum = "sha256:3921182a21cceb0a505e5dac578e1487d48104caa5f114e9f8adf40b5a7289a9" +url = "https://github.com/sxyazi/yazi/releases/download/v26.9.1/yazi-aarch64-apple-darwin.zip" +url_api = "https://api.github.com/repos/sxyazi/yazi/releases/assets/539261410" + +[tools.yazi."platforms.windows-x64"] +checksum = "sha256:7c033e5f2de6355fd03d865319053fc97db780275974ed17653c057f5d0f8d21" +url = "https://github.com/sxyazi/yazi/releases/download/v26.9.1/yazi-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/sxyazi/yazi/releases/assets/539261401" + +[[tools.zoxide]] +version = "0.10.0" +backend = "aqua:ajeetdsouza/zoxide" +specifiers = ["latest"] + +[tools.zoxide."platforms.linux-arm64"] +checksum = "sha256:f1f16c5d6298d63dee467eedea1cdcd8490e43e493bea43acd416dc9033ef641" +url = "https://github.com/ajeetdsouza/zoxide/releases/download/v0.10.0/zoxide-0.10.0-aarch64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/ajeetdsouza/zoxide/releases/assets/466316402" + +[tools.zoxide."platforms.linux-x64"] +checksum = "sha256:2d93385b99f3e82cf2701609a1bffcad863fbeb75aa3fe7eb6be4d29be68b1ae" +url = "https://github.com/ajeetdsouza/zoxide/releases/download/v0.10.0/zoxide-0.10.0-x86_64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/ajeetdsouza/zoxide/releases/assets/466316293" + +[tools.zoxide."platforms.macos-arm64"] +checksum = "sha256:b55ae6f2f5f23d0a6ccb3bd4eeb2af9c7e0a6556e5255c82100e40305129bbb0" +url = "https://github.com/ajeetdsouza/zoxide/releases/download/v0.10.0/zoxide-0.10.0-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/ajeetdsouza/zoxide/releases/assets/466316174" + +[tools.zoxide."platforms.windows-x64"] +checksum = "sha256:f465ae548f8754c8e7edbc60b45fbf58c92bfe123db83d790252d6810fa5daf1" +url = "https://github.com/ajeetdsouza/zoxide/releases/download/v0.10.0/zoxide-0.10.0-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/ajeetdsouza/zoxide/releases/assets/466316769" diff --git a/dot_config/nvim/lua/config/lazy.lua b/dot_config/nvim/lua/config/lazy.lua index 8ff81ff..527cbb3 100644 --- a/dot_config/nvim/lua/config/lazy.lua +++ b/dot_config/nvim/lua/config/lazy.lua @@ -5,6 +5,10 @@ if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) +-- nvim-treesitter installs its parsers in site, which doesn't exist on the first +-- start. Neovim leaves out missing folders when it looks for runtime files, so it +-- wouldn't find the parsers until a restart: https://github.com/folke/lazy.nvim/issues/2153 +vim.fn.mkdir(vim.fn.stdpath("data") .. "/site", "p") require("lazy").setup({ spec = { diff --git a/dot_config/tmuxinator/champsim2.yml b/dot_config/tmuxinator/champsim2.yml deleted file mode 100644 index 29d760a..0000000 --- a/dot_config/tmuxinator/champsim2.yml +++ /dev/null @@ -1,61 +0,0 @@ -# /home/pcrei/.config/tmuxinator/champsim2.yml - -name: champsim2 -root: ~/school/cpen411/assignment2/ChampSim-Intel - -# Optional tmux socket -# socket_name: foo - -# Note that the pre and post options have been deprecated and will be replaced by -# project hooks. - -# Project hooks - -# Runs on project start, always -# on_project_start: command - -# Run on project start, the first time -# on_project_first_start: command - -# Run on project start, after the first time -# on_project_restart: command - -# Run on project exit ( detaching from tmux session ) -# on_project_exit: command - -# Run on project stop -# on_project_stop: command - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: editor - -# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. -# startup_pane: 1 - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -windows: - - nvim: - layout: main-vertical - panes: - - nvim - - buildnrun: - layout: even-horizontal - panes: - - - - cd simscript-testing && cls - - results: - root: ~/courses/cpen411/assignment2/ChampSim-Intel/results - layout: main-vertical - panes: - - nvim diff --git a/dot_config/tmuxinator/champsim3.yml b/dot_config/tmuxinator/champsim3.yml deleted file mode 100644 index 6e99373..0000000 --- a/dot_config/tmuxinator/champsim3.yml +++ /dev/null @@ -1,72 +0,0 @@ -# /home/pcrei/.config/tmuxinator/champsim3.yml - -name: champsim3 -root: ~/school/cpen411/assignment3/ChampSim - -# Optional tmux socket -# socket_name: foo - -# Note that the pre and post options have been deprecated and will be replaced by -# project hooks. - -# Project hooks - -# Runs on project start, always -# on_project_start: command - -# Run on project start, the first time -# on_project_first_start: command - -# Run on project start, after the first time -# on_project_restart: command - -# Run on project exit ( detaching from tmux session ) -# on_project_exit: command - -# Run on project stop -# on_project_stop: command - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: editor - -# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. -# startup_pane: 1 - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -windows: - - nvim: - layout: main-vertical - panes: - - nvim - - build: - layout: even-vertical - panes: - - bash compile_champsim.sh - - algorithms: - - cd algorithms - - clear - - make && bash runall.sh; bat ../output/* - - trace: - layout: even-vertical - panes: - - tracer: - - cd tracer - - clear - - ls -l gen*.sh - - ls -l run*.sh - - results: - root: ~/school/cpen411/assignment3/ChampSim/results - layout: main-vertical - panes: - - nvim diff --git a/dot_config/tmuxinator/champsim4.yml b/dot_config/tmuxinator/champsim4.yml deleted file mode 100644 index b940885..0000000 --- a/dot_config/tmuxinator/champsim4.yml +++ /dev/null @@ -1,63 +0,0 @@ -# /home/pcrei/.config/tmuxinator/champsim4.yml - -name: champsim4 -root: ~/school/cpen411/assignment4/ChampSim-Intel - -# Optional tmux socket -# socket_name: foo - -# Note that the pre and post options have been deprecated and will be replaced by -# project hooks. - -# Project hooks - -# Runs on project start, always -# on_project_start: command - -# Run on project start, the first time -# on_project_first_start: command - -# Run on project start, after the first time -# on_project_restart: command - -# Run on project exit ( detaching from tmux session ) -# on_project_exit: command - -# Run on project stop -# on_project_stop: command - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: editor - -# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. -# startup_pane: 1 - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -windows: - - nvim: - layout: main-vertical - panes: - - nvim - - buildnrun: - layout: even-horizontal - panes: - - ls -l build*.sh - - run: - - cd simscript - - ls -l runall*.sh - - results: - root: ~/school/cpen411/assignment4/ChampSim-Intel/results - layout: main-vertical - panes: - - nvim diff --git a/dot_config/tmuxinator/config.yml b/dot_config/tmuxinator/config.yml deleted file mode 100644 index 7ce86d5..0000000 --- a/dot_config/tmuxinator/config.yml +++ /dev/null @@ -1,64 +0,0 @@ -# /home/pcrei/.config/tmuxinator/config.yml - -name: config -root: ~/ - -# Optional tmux socket -# socket_name: foo - -# Note that the pre and post options have been deprecated and will be replaced by -# project hooks. - -# Project hooks - -# Runs on project start, always -# on_project_start: command - -# Run on project start, the first time -# on_project_first_start: command - -# Run on project start, after the first time -# on_project_restart: command - -# Run on project exit ( detaching from tmux session ) -# on_project_exit: command - -# Run on project stop -# on_project_stop: command - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: editor - -# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. -# startup_pane: 1 - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -windows: - - chezmoi: - root: ~/.local/share/chezmoi - layout: main-vertical - panes: - - nvim - - git status - - nvim: - root: ~/.config/nvim - layout: main-vertical - panes: - - nvim - - ls -la - - home: - layout: main-vertical - panes: - - nvim - - ls -la diff --git a/dot_config/tmuxinator/hdlbits.yml b/dot_config/tmuxinator/hdlbits.yml deleted file mode 100644 index a4d5d7e..0000000 --- a/dot_config/tmuxinator/hdlbits.yml +++ /dev/null @@ -1,55 +0,0 @@ -# /home/pcrei/.config/tmuxinator/hdlbits.yml - -name: hdlbits -root: ~/git/patrick-5546/hdlbits - -# Optional tmux socket -# socket_name: foo - -# Note that the pre and post options have been deprecated and will be replaced by -# project hooks. - -# Project hooks - -# Runs on project start, always -# on_project_start: command - -# Run on project start, the first time -# on_project_first_start: command - -# Run on project start, after the first time -# on_project_restart: command - -# Run on project exit ( detaching from tmux session ) -# on_project_exit: command - -# Run on project stop -# on_project_stop: command - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: editor - -# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. -# startup_pane: 1 - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -windows: - - hdlbits: - layout: main-horizontal - # Synchronize all panes of this window, can be enabled before or after the pane commands run. - # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after' - # synchronize: after - panes: - - nvim - - git status diff --git a/dot_config/tmuxinator/rustlings.yml b/dot_config/tmuxinator/rustlings.yml deleted file mode 100644 index 2e34c5d..0000000 --- a/dot_config/tmuxinator/rustlings.yml +++ /dev/null @@ -1,62 +0,0 @@ -# /home/pcrei/.config/tmuxinator/rustlings.yml - -name: rustlings -root: ~/git/forks/rustlings - -# Optional tmux socket -# socket_name: foo - -# Note that the pre and post options have been deprecated and will be replaced by -# project hooks. - -# Project hooks - -# Runs on project start, always -# on_project_start: command - -# Run on project start, the first time -# on_project_first_start: command - -# Run on project start, after the first time -# on_project_restart: command - -# Run on project exit ( detaching from tmux session ) -# on_project_exit: command - -# Run on project stop -# on_project_stop: command - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: editor - -# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. -# startup_pane: 1 - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -windows: - - rustlings: - layout: main-vertical - # Synchronize all panes of this window, can be enabled before or after the pane commands run. - # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after' - # synchronize: after - panes: - - nvim - - rustlings watch - - sandbox: - root: ~/git/forks/rustlings/sandbox - layout: main-vertical - panes: - - nvim sandbox.rs - - ./sandbox - - git: diff --git a/dot_config/whkdrc b/dot_config/whkdrc deleted file mode 100644 index 7d4682b..0000000 --- a/dot_config/whkdrc +++ /dev/null @@ -1,76 +0,0 @@ -.shell pwsh - -# Reload whkd configuration -# alt + o : taskkill /f /im whkd.exe && start /b whkd # if shell is cmd -alt + o : taskkill /f /im whkd.exe; Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell -alt + shift + o : komorebic reload-configuration - -# App shortcuts - these require shell to be pwsh / powershell -# The apps will be focused if open, or launched if not open -# alt + f : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox } -# alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome } - -alt + q : komorebic close -alt + m : komorebic minimize - -# Focus windows -alt + h : komorebic focus left -alt + j : komorebic focus down -alt + k : komorebic focus up -alt + l : komorebic focus right -alt + shift + oem_4 : komorebic cycle-focus previous # oem_4 is [ -alt + shift + oem_6 : komorebic cycle-focus next # oem_6 is ] - -# Move windows -alt + shift + h : komorebic move left -alt + shift + j : komorebic move down -alt + shift + k : komorebic move up -alt + shift + l : komorebic move right -alt + shift + return : komorebic promote - -# Stack windows -alt + left : komorebic stack left -alt + down : komorebic stack down -alt + up : komorebic stack up -alt + right : komorebic stack right -alt + oem_1 : komorebic unstack # oem_1 is ; -alt + oem_4 : komorebic cycle-stack previous # oem_4 is [ -alt + oem_6 : komorebic cycle-stack next # oem_6 is ] - -# Resize -alt + oem_plus : komorebic resize-axis horizontal increase -alt + oem_minus : komorebic resize-axis horizontal decrease -alt + shift + oem_plus : komorebic resize-axis vertical increase -alt + shift + oem_minus : komorebic resize-axis vertical decrease - -# Manipulate windows -alt + t : komorebic toggle-float -alt + shift + f : komorebic toggle-monocle - -# Window manager options -alt + shift + r : komorebic retile -alt + p : komorebic toggle-pause - -# Layouts -alt + x : komorebic flip-layout horizontal -alt + y : komorebic flip-layout vertical - -# Workspaces -alt + 1 : komorebic focus-workspace 0 -alt + 2 : komorebic focus-workspace 1 -alt + 3 : komorebic focus-workspace 2 -alt + 4 : komorebic focus-workspace 3 -alt + 5 : komorebic focus-workspace 4 -alt + 6 : komorebic focus-workspace 5 -alt + 7 : komorebic focus-workspace 6 -alt + 8 : komorebic focus-workspace 7 - -# Move windows across workspaces -alt + shift + 1 : komorebic move-to-workspace 0 -alt + shift + 2 : komorebic move-to-workspace 1 -alt + shift + 3 : komorebic move-to-workspace 2 -alt + shift + 4 : komorebic move-to-workspace 3 -alt + shift + 5 : komorebic move-to-workspace 4 -alt + shift + 6 : komorebic move-to-workspace 5 -alt + shift + 7 : komorebic move-to-workspace 6 -alt + shift + 8 : komorebic move-to-workspace 7 diff --git a/dot_config/zsh/aliases.zsh b/dot_config/zsh/aliases.zsh index 44ea3e8..684401c 100644 --- a/dot_config/zsh/aliases.zsh +++ b/dot_config/zsh/aliases.zsh @@ -1,7 +1,6 @@ # general alias ..='cd ..' alias ...='cd ../..' -#alias btop='bpytop' alias c='chezmoi' alias cad='chezmoi add' alias cap='chezmoi apply' diff --git a/dot_config/zsh/encrypted_openvpn3.zsh.age b/dot_config/zsh/encrypted_openvpn3.zsh.age deleted file mode 100644 index 04ecd05..0000000 --- a/dot_config/zsh/encrypted_openvpn3.zsh.age +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBWMVlNSnN2SUUvcVBtL1Jh -enJCZDJIWkJGUFQ3NmxLdjVielAzUFVRaG5vClBSWW9ZRWJLWHF2Y2xsNGNneUdl -RzZ3SkY4MUo0K0RnL2JmS0hQRTE4OG8KLS0tIC8xNXJlVnJUSEplWWFkVW9XczFu -d2lhYUVJN1dwc1g3bS9wUWNnS2Z3NzQKlb80YXvrRHWAtFpSKvF2E3+JKca9Qrx3 -wCkAAFhTp3OuFN3hSfElb+8QKLbN7pUA/O5+2cuKl7CGtUnt/Ob93/RLglpGacyl -wtCLr9uuamwpJQHW2MyyyD8wQj65MrIu7MMMUc04gXEPl5ZZBLn59Db11FfI9qti -c18ynv0AthxOS+s3glTgi6r6C60vamWlS9W/Ycm276P73W4lhsrcEQLdhAyWTLTm -zmvg1ha/bWhPltlQ4609+nX29dClnpjZH50SI7pmmvLCVhb2WPU5c8VIjWrdhlsC -abYQKNhu/NxX6jXs1XkK6f+fuU6cw0Gm38qBfiRFo5oN2DY2Rx9sQUjLG/EC0ljU -lC29p6/moS8KGkTD2/cOq2xdldGDUWGQlSqkSdXG8CENt1CA1iCHkQi3ag== ------END AGE ENCRYPTED FILE----- diff --git a/dot_config/zsh/history.zsh b/dot_config/zsh/history.zsh index 0a1693b..09bc825 100644 --- a/dot_config/zsh/history.zsh +++ b/dot_config/zsh/history.zsh @@ -33,3 +33,7 @@ setopt hist_expire_dups_first # delete duplicates first when HISTFILE size excee setopt hist_ignore_space # ignore commands that start with space setopt hist_verify # show command with history expansion to user before running it setopt share_history # share command history data (zsh ignores inc_append_history_time with it) +# Lock the history file with fcntl. zsh's default lock is a file it creates and +# deletes in ~ after every command, which changes ~'s modification time, so +# mise's prompt hook looked for new config files and rebuilt PATH every time +setopt hist_fcntl_lock diff --git a/dot_zshenv b/dot_zshenv new file mode 100644 index 0000000..eb43314 --- /dev/null +++ b/dot_zshenv @@ -0,0 +1,5 @@ +# Ubuntu's /etc/zsh/zshrc runs compinit before ~/.zshrc runs it again with the +# dotfiles' completions. The two runs keep replacing each other's dump, so both +# rebuild it in every new shell, and the dump that ~/.zshrc caches would be +# missing the dotfiles' completions. +skip_global_compinit=1 diff --git a/dot_zshrc.tmpl b/dot_zshrc similarity index 57% rename from dot_zshrc.tmpl rename to dot_zshrc index 7511cfb..3973cbe 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc @@ -1,3 +1,23 @@ +# Homebrew (https://brew.sh) on macOS, which installs the desktop apps. Before +# compinit so that it loads Homebrew's completions +if [[ -x /opt/homebrew/bin/brew ]]; then + eval "$(/opt/homebrew/bin/brew shellenv zsh)" +fi + +# WSL appends the whole Windows PATH, and the folders in /mnt/c are slow to read +# from Linux. mise and zsh look through every folder on PATH, which made new +# shells take a second, each cd half a second, and typing lag. Keep only the +# Windows commands used here: System32 and Windows (clip.exe, cmd.exe, +# explorer.exe), in any case since some PCs have C:\WINDOWS, and VS Code +# (code). They come from what WSL appends, so /etc/wsl.conf must keep its +# default, appendWindowsPath = true +if [[ -n $WSL_DISTRO_NAME ]]; then + () { + setopt local_options extended_glob + path=(${path:#/mnt/*} ${(M)path:#(#i)/mnt/c/windows(|/system32)} ${(M)path:#/mnt/*/Microsoft VS Code/bin}) + } +fi + # Enable colors and change prompt: autoload -U colors && colors @@ -5,15 +25,21 @@ autoload -U colors && colors fpath=($HOME/.config/zsh/completions $fpath) autoload -Uz compinit zmodload zsh/complist -compinit -# can't get caching to work -#typeset -i USE_CACHE -#(( $+commands[compaudit] && $+commands[compinit] )) && compaudit | read -ra USE_CACHE -#if (( USE_CACHE )); then -# compinit -#else -# compinit -C -#fi +# A full compinit looks for new completions and runs a security check, which is +# slow, so only run it when the dump is missing or a day old. Otherwise load the +# dump as is. install-cli-tools-unix.sh deletes it when it updates completions. +() { + setopt local_options extended_glob + if [[ -n $HOME/.zcompdump(#qN.mh-24) ]]; then + compinit -C + else + compinit + # Start a new day even if compinit kept the dump because it was valid + touch -c $HOME/.zcompdump + fi +} +# zsh's SCCS completion also claims delta +compdef _delta delta # Set completion style zstyle ':completion:*' menu select @@ -59,9 +85,20 @@ bindkey "^[OA" up-line-or-beginning-search bindkey "^[[B" down-line-or-beginning-search bindkey "^[OB" down-line-or-beginning-search -# fzf configuration -source $HOME/.config/fzf/key-bindings.zsh +# Aliases +source $HOME/.config/zsh/aliases.zsh + +# Environment Variables +export PATH=$HOME/.cargo/bin:$PATH +export PATH=$HOME/.local/bin:$PATH +export VISUAL=nvim +export EDITOR="$VISUAL" +export DOCKER_BUILDKIT=1 +# Tools installed by mise: https://mise.jdx.dev +eval "$($HOME/.local/bin/mise activate zsh)" + +# fzf configuration # Use fd (https://github.com/sharkdp/fd) instead of the default find command for listing path candidates. # - The first argument to the function ($1) is the base path to start traversal # - See the source code (completion.{bash,zsh}) for the details. @@ -80,34 +117,18 @@ export FZF_DEFAULT_COMMAND="fd --hidden --follow --exclude '.git'" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND --type d" -# Aliases -source $HOME/.config/zsh/aliases.zsh - -# Environment Variables -export PATH=/usr/local/go/bin:$PATH -export PATH=$HOME/.cargo/bin:$PATH -export PATH=$HOME/.local/bin:$PATH -{{- if and (eq .chezmoi.os "linux") (.chezmoi.kernel.osrelease | lower | contains "microsoft") }} -export PATH="/mnt/c/Windows/System32:$PATH" -{{- end }} -export VISUAL=nvim -export EDITOR="$VISUAL" -export DOCKER_BUILDKIT=1 -# https://github.com/lukechilds/zsh-nvm -export NVM_COMPLETION=true -export NVM_LAZY_LOAD=true -export NVM_LAZY_LOAD_EXTRA_COMMANDS=('nvim' 'lazygit' 'copilot' 'make') +# Key bindings and ** completion from the installed fzf, so they match its +# version. Move the file widget from Ctrl-T to Ctrl-F and restore Ctrl-T. +source <(fzf --zsh) +bindkey -M emacs '^F' fzf-file-widget +bindkey -M vicmd '^F' fzf-file-widget +bindkey -M viins '^F' fzf-file-widget +bindkey -M emacs '^T' transpose-chars +bindkey -M vicmd '^T' undefined-key +bindkey -M viins '^T' self-insert # Other Zsh scripts -source $HOME/.local/share/zsh-nvm/zsh-nvm.plugin.zsh source $HOME/.local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -{{- if and (eq .chezmoi.os "linux") (not (.chezmoi.kernel.osrelease | lower | contains "microsoft")) }} -source $HOME/.config/zsh/openvpn3.zsh -{{- end }} - -# Some completions are broken and need to be sourced manually -. $HOME/.config/zsh/completions/_delta -. $HOME/.config/zsh/completions/_grm # Atuin: https://github.com/atuinsh/atuin eval "$(atuin init zsh --disable-up-arrow --disable-ai)" diff --git a/reference_dotfiles/README.md b/reference_dotfiles/README.md index 0a54040..14a07b3 100644 --- a/reference_dotfiles/README.md +++ b/reference_dotfiles/README.md @@ -1,3 +1,7 @@ # Reference Dotfiles These dotfiles are not managed with Chezmoi and may not be exactly what I use, but can serve as a reference. + +[`vscode`](./vscode) has my settings for Visual Studio Code, which is one of the desktop apps. + +[`software.md`](./software.md) lists the other software I've used. diff --git a/reference_dotfiles/run_install-windows.ps1 b/reference_dotfiles/run_install-windows.ps1 deleted file mode 100644 index b6496a4..0000000 --- a/reference_dotfiles/run_install-windows.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -Write-Host "Request administrator access" -gsudo { - Write-Host "Update choco packages and modules" - choco upgrade all -y - Update-Module - - Write-Host "`nInstall choco packages" - choco install bat delta dust fd fzf lf mingw ripgrep starship -y - - Write-Host "`nInstall modules" - Install-Module git-aliases -Scope CurrentUser -Allowclobber - Install-Module posh-git -Scope CurrentUser -AllowClobber - Install-Module -Name Terminal-Icons -Repository PSGallery - - Write-Host "`nSet execution policy" - Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -} - -Write-Host "Update winget packages" -winget upgrade --all -Write-Host("") - -function wingetInstallIfNotInstalled($id) { - Write-Host("Install $id if not installed") - winget list --exact --id $id || winget install --exact --id $id --interactive - Write-Host("") -} -wingetInstallIfNotInstalled("7zip.7zip") -wingetInstallIfNotInstalled("ajeetdsouza.zoxide") -wingetInstallIfNotInstalled("Bitwarden.Bitwarden") -wingetInstallIfNotInstalled("code52.Carnac") -wingetInstallIfNotInstalled("Discord.Discord") -wingetInstallIfNotInstalled("Docker.DockerDesktop") -wingetInstallIfNotInstalled("Git.Git") -wingetInstallIfNotInstalled("gerardog.gsudo") -wingetInstallIfNotInstalled("JesseDuffield.lazygit") -wingetInstallIfNotInstalled("Logitech.GHUB") -wingetInstallIfNotInstalled("Logitech.LogiBolt") -wingetInstallIfNotInstalled("Logitech.LogiTune") -wingetInstallIfNotInstalled("Logitech.OptionsPlus") -wingetInstallIfNotInstalled("Logitech.UnifyingSoftware") -wingetInstallIfNotInstalled("Neovim.Neovim") -wingetInstallIfNotInstalled("Nextcloud.NextcloudDesktop") -wingetInstallIfNotInstalled("OpenJS.NodeJS.LTS") -wingetInstallIfNotInstalled("OpenVPNTechnologies.OpenVPNConnect") -wingetInstallIfNotInstalled("Poly.PlantronicsHub") -wingetInstallIfNotInstalled("SlackTechnologies.Slack") -wingetInstallIfNotInstalled("TeamViewer.TeamViewer") -wingetInstallIfNotInstalled("VPNetwork.TorGuard") -wingetInstallIfNotInstalled("JAMSoftware.TreeSize.Free") -wingetInstallIfNotInstalled("Microsoft.VisualStudioCode") -wingetInstallIfNotInstalled("Zoom.Zoom") diff --git a/reference_dotfiles/software.md b/reference_dotfiles/software.md new file mode 100644 index 0000000..ef8037c --- /dev/null +++ b/reference_dotfiles/software.md @@ -0,0 +1,25 @@ +# Software + +Other software I've used. Unlike the CLI tools in [mise's config](../dot_config/mise/config.toml) and the +[desktop apps](../.chezmoidata/desktop-apps.toml), the dotfiles don't install it. On Windows, search for it in +UniGetUI, one of the desktop apps, or install it with `winget install --exact --id `. On macOS, install it with +`brew install --cask `, and on Linux, from its website. + +## Windows, macOS and Linux + +| Software | What it does | winget ID | Homebrew cask | +| --- | --- | --- | --- | +| [Discord](https://discord.com) | Chat | `Discord.Discord` | `discord` | +| [Plex](https://www.plex.tv) | Plays media from Plex servers | `Plex.Plex` | `plex` | +| [Signal](https://signal.org) | Encrypted messaging | `OpenWhisperSystems.Signal` | `signal` | +| [TeamViewer](https://www.teamviewer.com) | Remote access and support | `TeamViewer.TeamViewer` | `teamviewer` | + +## Windows only + +| Software | What it does | winget ID | +| --- | --- | --- | +| [Carnac](https://github.com/Code52/carnac) | Shows the keys you press, for presentations and screen recordings | `code52.Carnac` | +| [NanaZip](https://github.com/M2Team/NanaZip) | Opens and creates archives. A 7-Zip fork that's in the Windows 11 context menu | `M2Team.NanaZip` | +| [Rufus](https://rufus.ie) | Creates bootable USB drives | `Rufus.Rufus` | +| [Windows Terminal](https://github.com/microsoft/terminal) | Terminal, preinstalled on Windows 11. My settings are in [`windows_terminal/`](./windows_terminal/) | `Microsoft.WindowsTerminal` | +| [WSL](https://learn.microsoft.com/windows/wsl/) | Runs Linux. `wsl --install` installs it with Ubuntu, which the dotfiles also support. My config is in [`wsl/`](./wsl/) | `Microsoft.WSL` | diff --git a/reference_dotfiles/wingetui/apps.json b/reference_dotfiles/wingetui/apps.json deleted file mode 100644 index 350cae3..0000000 --- a/reference_dotfiles/wingetui/apps.json +++ /dev/null @@ -1,356 +0,0 @@ -{ - "export_version": 2, - "packages": [ - { - "Id": "7zip.7zip", - "Name": "7-Zip 23.01 (x64 edition)", - "Version": "23.01.00.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Bitwarden.Bitwarden", - "Name": "Bitwarden", - "Version": "2024.4.1", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "code52.Carnac", - "Name": "carnac", - "Version": "2.3.13", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Discord.Discord", - "Name": "Discord", - "Version": "1.0.9028", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": true, - "IgnoredVersion": "*" - } - }, - { - "Id": "Mozilla.Thunderbird", - "Name": "Mozilla Thunderbird (x64 en-CA)", - "Version": "115.9.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "115.8.0" - } - }, - { - "Id": "Nextcloud.NextcloudDesktop", - "Name": "Nextcloud", - "Version": "3.12.3", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "OpenVPNTechnologies.OpenVPNConnect", - "Name": "OpenVPN Connect", - "Version": "3.4.4", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Plex.Plex", - "Name": "Plex", - "Version": "1.88.1", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Rufus.Rufus", - "Name": "Rufus", - "Version": "4.4", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "OpenWhisperSystems.Signal", - "Name": "Signal 7.4.0", - "Version": "7.4.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "SlackTechnologies.Slack", - "Name": "Slack (Machine)", - "Version": "4.36.136", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": true, - "IgnoredVersion": "*" - } - }, - { - "Id": "Ookla.Speedtest.Desktop", - "Name": "Speedtest by Ookla", - "Version": "1.13.194.001", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "VPNetwork.TorGuard", - "Name": "VPNetwork LLC - TorGuard - Online Priv\u2026", - "Version": "4.8.28", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "AntibodySoftware.WizTree", - "Name": "WizTree v4.19", - "Version": "4.19", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Zoom.Zoom", - "Name": "Zoom", - "Version": "5.17.11.34827", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - } - ], - "incompatible_packages_info": "Incompatible packages cannot be installed from WingetUI, but they have been listed here for logging purposes.", - "incompatible_packages": [ - { - "Id": "Microsoft.Todos_8wekyb3d8bbwe", - "Name": "Microsoft To Do", - "Version": "2.114.7122.0", - "Source": "Local PC" - }, - { - "Id": "SAMSUNGELECTRONICSCoLtd.SecondScreen_w\u2026", - "Name": "Second Screen", - "Version": "1.8.4.0", - "Source": "Microsoft Store" - }, - { - "Id": "Microsoft.ScreenSketch_8wekyb3d8bbwe", - "Name": "Snipping Tool", - "Version": "11.2401.37.0", - "Source": "Local PC" - } - ] -} \ No newline at end of file diff --git a/reference_dotfiles/wingetui/dev.json b/reference_dotfiles/wingetui/dev.json deleted file mode 100644 index f549b79..0000000 --- a/reference_dotfiles/wingetui/dev.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "export_version": 2, - "packages": [ - { - "Id": "FiloSottile.age", - "Name": "age", - "Version": "1.1.1", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "twpayne.chezmoi", - "Name": "chezmoi", - "Version": "2.47.4", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "dandavison.delta", - "Name": "delta", - "Version": "0.17.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [ - "" - ], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Docker.DockerDesktop", - "Name": "Docker Desktop", - "Version": "4.29.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "sharkdp.fd", - "Name": "fd", - "Version": "9.0.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Git.Git", - "Name": "Git", - "Version": "2.44.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "JesseDuffield.lazygit", - "Name": "lazygit", - "Version": "0.41.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "LLVM.LLVM", - "Name": "LLVM", - "Version": "18.1.3", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Neovim.Neovim", - "Name": "Neovim", - "Version": "0.9.5", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "BurntSushi.ripgrep.MSVC", - "Name": "RipGrep MSVC", - "Version": "14.1.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "Starship.Starship", - "Name": "starship", - "Version": "1.18.2", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "1.18.1" - } - }, - { - "Id": "Microsoft.WindowsTerminal", - "Name": "Windows Terminal", - "Version": "1.19.10821.0", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "junegunn.fzf", - "Name": "fzf", - "Version": "0.52.1", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - }, - { - "Id": "ajeetdsouza.zoxide", - "Name": "zoxide", - "Version": "0.9.4", - "Source": "winget", - "ManagerName": "Winget", - "InstallationOptions": { - "SkipHashCheck": false, - "InteractiveInstallation": false, - "RunAsAdministrator": false, - "Architecture": "", - "InstallationScope": "", - "CustomParameters": [], - "PreRelease": false, - "CustomInstallLocation": "", - "Version": "" - }, - "Updates": { - "UpdatesIgnored": false, - "IgnoredVersion": "" - } - } - ], - "incompatible_packages_info": "Incompatible packages cannot be installed from WingetUI, but they have been listed here for logging purposes.", - "incompatible_packages": [ - { - "Id": "Microsoft.PowerShell_8wekyb3d8bbwe", - "Name": "PowerShell", - "Version": "7.4.2.0", - "Source": "Local PC" - }, - { - "Id": "Microsoft.VSCode_8te5zrwvmdcsm", - "Name": "Visual Studio Code", - "Version": "1.0.0.0", - "Source": "Local PC" - }, - { - "Id": "MicrosoftCorporationII.WindowsSubsyste\u2026", - "Name": "Windows Subsystem for Linux", - "Version": "2.1.5.0", - "Source": "Local PC" - }, - { - "Id": "{889610CC-4337-4BDB-AC3B-4F21806C0BDE}\u2026", - "Name": "WingetUI", - "Version": "3.0.2", - "Source": "Local PC" - } - ] -} diff --git a/reference_dotfiles/wsl/wsl.conf b/reference_dotfiles/wsl/wsl.conf index 4b1f38b..4bdaae8 100644 --- a/reference_dotfiles/wsl/wsl.conf +++ b/reference_dotfiles/wsl/wsl.conf @@ -1,8 +1,5 @@ [boot] systemd=true -[interop] -appendWindowsPath = false - [network] generateResolvConf = false diff --git a/run_before_decrypt-private-key-unix.sh.tmpl b/run_before_decrypt-private-key-unix.sh.tmpl index 5bd53ea..30ea642 100644 --- a/run_before_decrypt-private-key-unix.sh.tmpl +++ b/run_before_decrypt-private-key-unix.sh.tmpl @@ -1,7 +1,12 @@ +{{ if not (stat (joinPath .chezmoi.homeDir ".chezmoikey.txt")) -}} #!/bin/sh +# Decrypts the key that chezmoi decrypts the encrypted files with, asking for its +# passphrase. chezmoi runs this before applying files while the key is missing. +# Once it exists, the template is empty, so chezmoi skips it. +set -eu -if [ ! -f "{{ .chezmoi.homeDir }}/.chezmoikey.txt" ]; then - printf "# create ~/.chezmoikey.txt\n" - age --decrypt --output "{{ .chezmoi.homeDir }}/.chezmoikey.txt" "{{ .chezmoi.sourceDir }}/key.txt.age" - chmod 600 "{{ .chezmoi.homeDir }}/.chezmoikey.txt" -fi +key="$HOME/.chezmoikey.txt" +printf "# create ~/.chezmoikey.txt\n" +"$CHEZMOI_EXECUTABLE" age decrypt --output "$key" --passphrase "$CHEZMOI_SOURCE_DIR/key.txt.age" +chmod 600 "$key" +{{ end -}} diff --git a/run_before_decrypt-private-key-windows.ps1.tmpl b/run_before_decrypt-private-key-windows.ps1.tmpl index 185b6fb..f823ebb 100644 --- a/run_before_decrypt-private-key-windows.ps1.tmpl +++ b/run_before_decrypt-private-key-windows.ps1.tmpl @@ -1,4 +1,9 @@ -if (-Not (Test-Path {{ .chezmoi.homeDir }}/.chezmoikey.txt -PathType Leaf)) { - Write-Host "# create ~/.chezmoikey.txt" - age --decrypt --output "{{ .chezmoi.homeDir }}/.chezmoikey.txt" "{{ .chezmoi.sourceDir }}/key.txt.age" -} +{{ if not (stat (joinPath .chezmoi.homeDir ".chezmoikey.txt")) -}} +# Decrypts the key that chezmoi decrypts the encrypted files with, asking for its +# passphrase. chezmoi runs this before applying files while the key is missing. +# Once it exists, the template is empty, so chezmoi skips it. +$key = Join-Path $HOME '.chezmoikey.txt' +Write-Host "# create ~/.chezmoikey.txt" +& $env:CHEZMOI_EXECUTABLE age decrypt --output $key --passphrase (Join-Path $env:CHEZMOI_SOURCE_DIR 'key.txt.age') +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } +{{ end -}} diff --git a/run_install-unix.sh.tmpl b/run_install-unix.sh.tmpl deleted file mode 100644 index 0cb2132..0000000 --- a/run_install-unix.sh.tmpl +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash - -printf "\n# Check Prerequisites\n" -check_installed() { - if command -v $1 &>/dev/null; then - printf "# $1 is installed at\t\t$(which $1)\n" - else - printf "# $1 is NOT installed\n" - exit 1 - fi -} -check_installed curl -check_installed nvim -check_installed tmux -check_installed zsh - -pushd ~ -printf "\n# Install/update Chezmoi\n" -sh -c "$(curl -fsLS get.chezmoi.io/lb)" - -printf "\n# Install/update GRM\n" -BINARY=grm_{{.chezmoi.os}}_{{.chezmoi.arch}}.tar.gz -curl -s https://api.github.com/repos/jsnjack/grm/releases/latest \ - | awk -F'"' '/"browser_download_url":/{print $4}' | grep $BINARY \ - | xargs curl -LOs && tar -xf $BINARY && rm $BINARY && mv grm $HOME/.local/bin/ -echo "info found version $($HOME/.local/bin/grm version) for latest/{{.chezmoi.os}}/{{.chezmoi.arch}}" -echo "info installed .local/bin/grm" -$HOME/.local/bin/grm set bin_dir $HOME/.local/bin -popd - -printf "\n# Install/update GRM dotfile dependencies\n" -# grm remembers each package's filters and selected binaries. Changing a -f -# filter or passing --asset or --binary makes it select and reinstall again. -# With --yes grm installs the first asset matching every -f filter, and gnu -# builds are listed before musl ones. Filter on the full Rust target so Linux -# gets the static musl build, which also runs on older glibc. A filter that -# matches nothing is ignored, so tools without that build still install. lsd -# uses gnu because its musl build shows uid/gid instead of user/group names. -{{- $arch := .chezmoi.arch | replace "amd64" "x86_64" | replace "arm64" "aarch64" }} -{{- $target := printf "%s-apple-darwin" $arch }} -{{- $gnuTarget := $target }} -{{- if eq .chezmoi.os "linux" }} -{{- $target = printf "%s-unknown-linux-musl" $arch }} -{{- $gnuTarget = printf "%s-unknown-linux-gnu" $arch }} -{{- end }} -$HOME/.local/bin/grm install --yes -f tar.gz -f atuin-{{ $target }} atuinsh/atuin # atuin- skips atuin-server -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} sharkdp/bat -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} dandavison/delta -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} bootandy/dust -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} sharkdp/fd -$HOME/.local/bin/grm install --yes -f tar.gz junegunn/fzf -$HOME/.local/bin/grm install --yes -f tar.gz jesseduffield/lazygit -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $gnuTarget }} lsd-rs/lsd -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} BurntSushi/ripgrep -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} starship/starship -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} astral-sh/uv -# Remove the standalone installer's receipt so uv self update can't replace grm's uv -rm -f "${XDG_CONFIG_HOME:-$HOME/.config}/uv/uv-receipt.json" -$HOME/.local/bin/grm install --yes -f zip -f {{ $target }} sxyazi/yazi -$HOME/.local/bin/grm install --yes -f tar.gz -f {{ $target }} ajeetdsouza/zoxide - -printf "\n# Install/update completions\n" -mkdir -p $HOME/.config/zsh/completions -pushd $HOME/.config/zsh/completions -$HOME/.local/bin/atuin gen-completions --shell zsh -o . -$HOME/.local/bin/bat --completion zsh >> _bat # doesn't work -$HOME/.local/bin/chezmoi completion zsh >> _chezmoi -$HOME/.local/bin/delta --generate-completion zsh >> _delta # needs to be sourced manually -curl -o _dust https://raw.githubusercontent.com/bootandy/dust/master/completions/_dust -curl -o _fd https://raw.githubusercontent.com/sharkdp/fd/master/contrib/completion/_fd -$HOME/.local/bin/fzf --zsh >> _fzf # doesn't work -$HOME/.local/bin/grm completion zsh >> _grm # needs to be sourced manually -# could not find zsh completion for lsd -$HOME/.local/bin/rg --generate=complete-zsh >> _rg -$HOME/.local/bin/starship completions zsh >> _starship -$HOME/.local/bin/uv generate-shell-completion zsh > _uv -$HOME/.local/bin/uvx --generate-shell-completion zsh > _uvx -curl -o _zoxide https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/contrib/completions/_zoxide -popd - -{{ if or (eq .chezmoi.os "darwin") (not (.chezmoi.kernel.osrelease | lower | contains "microsoft")) -}} -{{ if eq .chezmoi.os "linux" -}} -{{ if eq .chezmoi.osRelease.id "fedora" -}} -printf "\n# Install dnf utilities\n" -sudo dnf -y update && sudo dnf -y install \ - fontconfig \ - unzip \ - util-linux-user \ -{{- end -}} - -if [ ! -d ~/.local/share/fonts/FiraCode ] -then - printf "\n# Install fonts\n" - mkdir -p ~/.local/share/fonts/FiraCode - curl -L https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip --output FiraCode.zip - unzip FiraCode.zip -d ~/.local/share/fonts/FiraCode "Fira*Mono*.ttf" - rm FiraCode.zip - fc-cache -f -else - printf "\n# Fonts already installed\n" -fi -{{ end }} -{{- end -}} - -printf "\n# Checking GitHub account status\n" -$HOME/.local/bin/grm install --yes{{ if eq .chezmoi.os "linux" }} -f tar.gz{{ end }} cli/cli -gh auth status -if [ $? -ne 0 ] -then - gh auth login -fi - -if [ $(basename $SHELL) != "zsh" ] -then - printf "\n# Make Zsh default shell\n" - command -v zsh | sudo tee -a /etc/shells - chsh -s $(which zsh) -else - printf "\n# Zsh already default shell\n" -fi - -printf "\n# Script finished successfully, open a new terminal to use new configuration\n" diff --git a/run_onchange_after_install-cli-tools-unix.sh.tmpl b/run_onchange_after_install-cli-tools-unix.sh.tmpl new file mode 100644 index 0000000..5a9a1ea --- /dev/null +++ b/run_onchange_after_install-cli-tools-unix.sh.tmpl @@ -0,0 +1,58 @@ +#!/bin/bash +# Installs mise (https://mise.jdx.dev) and the tools in ~/.config/mise/config.toml, +# then generates zsh completions for them. chezmoi runs this after applying +# files and again whenever this script, the mise config or mise.lock changes. +# mise config hash: {{ include "dot_config/mise/config.toml" | sha256sum }} +# mise.lock hash: {{ include "dot_config/mise/mise.lock" | sha256sum }} +set -euo pipefail + +mise="$HOME/.local/bin/mise" +if [ ! -x "$mise" ]; then + printf "\n# Install mise\n" + # The installer doesn't read the mise config, so give it its minimum release age + curl -fsSL https://mise.run | MISE_INSTALL_PATH="$mise" \ + MISE_MINIMUM_RELEASE_AGE={{ (include "dot_config/mise/config.toml" | fromToml).settings.minimum_release_age | quote }} sh +fi + +printf "\n# Install tools with mise\n" +# Only the versions in mise.lock, and fail if it doesn't have them +"$mise" install --locked +eval "$("$mise" env --shell bash)" + +# Remove the standalone installer's receipt so `uv self update` can't replace mise's uv +rm -f "${XDG_CONFIG_HOME:-$HOME/.config}/uv/uv-receipt.json" + +printf "\n# Generate zsh completions\n" +mkdir -p "$HOME/.config/zsh/completions" +cd "$HOME/.config/zsh/completions" +rm -f _fzf _grm # left by older versions of this script +atuin gen-completions --shell zsh --out-dir . +bat --completion zsh > _bat +"{{ .chezmoi.executable }}" completion zsh > _chezmoi +delta --generate-completion zsh > _delta +fd --gen-completions zsh > _fd +gh completion --shell zsh > _gh +"$mise" completion zsh > _mise +rg --generate=complete-zsh > _rg +starship completions zsh > _starship +uv generate-shell-completion zsh > _uv +uvx --generate-shell-completion zsh > _uvx + +# Some tools ship their completions in the release archive instead +copy_completion() { # copy_completion TOOL FILE + find "$("$mise" where "$1")" -name "$2" -type f -exec cp {} . \; +} +copy_completion lsd _lsd +copy_completion yazi _ya +copy_completion yazi _yazi +copy_completion zoxide _zoxide +curl -fsSL -o _dust "https://raw.githubusercontent.com/bootandy/dust/v$("$mise" current dust)/completions/_dust" \ + || echo "Couldn't download the dust completions" >&2 +rm -f "$HOME/.zcompdump" # so that the next zsh loads the new completions + +# git gets GitHub credentials from gh (see ~/.config/git/config). Skipped +# without a terminal, as in CI +if [ -t 0 ] && ! gh auth status >/dev/null 2>&1; then + printf "\n# Log in to GitHub\n" + gh auth login || echo "gh auth login failed, run it again later" >&2 +fi diff --git a/run_onchange_after_install-cli-tools-windows.ps1.tmpl b/run_onchange_after_install-cli-tools-windows.ps1.tmpl new file mode 100644 index 0000000..8d3622f --- /dev/null +++ b/run_onchange_after_install-cli-tools-windows.ps1.tmpl @@ -0,0 +1,32 @@ +# Installs mise (https://mise.jdx.dev) and the tools in ~/.config/mise/config.toml. +# chezmoi runs this after applying files and again whenever this script, the +# mise config or mise.lock changes. +# mise config hash: {{ include "dot_config/mise/config.toml" | sha256sum }} +# mise.lock hash: {{ include "dot_config/mise/mise.lock" | sha256sum }} +$ErrorActionPreference = 'Stop' + +$mise = "$HOME\.local\bin\mise.exe" +if (-not (Test-Path $mise -PathType Leaf)) { + Write-Host "`n# Install mise" + # The installer also adds ~\.local\bin to the user Path + $env:MISE_INSTALL_PATH = $mise + # The installer doesn't read the mise config, so give it its minimum release age + $env:MISE_MINIMUM_RELEASE_AGE = {{ (include "dot_config/mise/config.toml" | fromToml).settings.minimum_release_age | squote }} + Invoke-RestMethod https://mise.run/powershell | Invoke-Expression +} + +Write-Host "`n# Install tools with mise" +# Only the versions in mise.lock, and fail if it doesn't have them +& $mise install --locked +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + +# git gets GitHub credentials from gh (see ~/.config/git/config). Skipped when +# chezmoi's input isn't the terminal, as in CI +if (-not [Console]::IsInputRedirected) { + & $mise exec -- gh auth status *> $null + if ($LASTEXITCODE -ne 0) { + Write-Host "`n# Log in to GitHub" + & $mise exec -- gh auth login + if ($LASTEXITCODE -ne 0) { Write-Warning 'gh auth login failed, run it again later' } + } +} diff --git a/run_onchange_after_install-desktop-apps-macos.sh.tmpl b/run_onchange_after_install-desktop-apps-macos.sh.tmpl new file mode 100644 index 0000000..248d14a --- /dev/null +++ b/run_onchange_after_install-desktop-apps-macos.sh.tmpl @@ -0,0 +1,30 @@ +#!/bin/bash +# Installs the desktop apps with Homebrew (https://brew.sh), and Homebrew first +# if it's missing. Skips the apps that are already installed. chezmoi runs this +# after applying files, and again whenever this script changes. +set -euo pipefail + +brew={{ if eq .chezmoi.arch "arm64" }}/opt/homebrew{{ else }}/usr/local{{ end }}/bin/brew +if [ ! -x "$brew" ]; then + printf "\n# Install Homebrew\n" + installer=$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) + /bin/bash -c "$installer" +fi + +printf "\n# Install the desktop apps with Homebrew\n" +# Casks, and App Store apps, which mas installs once you sign in to the App +# Store, from .chezmoidata/desktop-apps.toml. Homebrew only loads the casks from +# third-party taps, named user/tap/cask, that are trusted, so trust them: +# https://docs.brew.sh/Tap-Trust +brewfile=$(mktemp) +trap 'rm -f "$brewfile"' EXIT +cat >"$brewfile" <<'EOF' +{{ range .desktopApps -}} +{{ if hasKey . "cask" -}} +cask {{ quote .cask }}{{ if contains "/" .cask }}, trusted: true{{ end }} +{{ else if hasKey . "mas" -}} +mas {{ quote .name }}, id: {{ .mas }} +{{ end -}} +{{ end -}} +EOF +"$brew" bundle --no-upgrade --file="$brewfile" diff --git a/run_onchange_after_install-desktop-apps-windows.ps1.tmpl b/run_onchange_after_install-desktop-apps-windows.ps1.tmpl new file mode 100644 index 0000000..b56ded1 --- /dev/null +++ b/run_onchange_after_install-desktop-apps-windows.ps1.tmpl @@ -0,0 +1,27 @@ +# Installs the desktop apps with winget, skipping the ones that are already +# installed. chezmoi runs this after applying files, and again whenever this +# script changes, or until every app installs. Some of the installers ask for +# administrator rights. +$ErrorActionPreference = 'Stop' + +# The apps' names, winget IDs and the sources they're from, from +# .chezmoidata/desktop-apps.toml +$apps = @( +{{- range .desktopApps }} +{{- if hasKey . "winget" }} + @{ Name = {{ squote .name }}; Id = {{ squote .winget }}; Source = 'winget' } +{{- else if hasKey . "msstore" }} + @{ Name = {{ squote .name }}; Id = {{ squote .msstore }}; Source = 'msstore' } +{{- end }} +{{- end }} +) +$failed = @() +foreach ($app in $apps) { + Write-Host "`n# Install $($app.Name) with winget" + winget install --exact --id $app.Id --source $app.Source --no-upgrade --accept-package-agreements --accept-source-agreements + # -1978335135 means it's already installed + if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne -1978335135) { $failed += $app.Name } +} +if ($failed) { + throw "winget couldn't install $($failed -join ', '). Run chezmoi apply to try again" +} diff --git a/run_onchange_before_install-packages-unix.sh.tmpl b/run_onchange_before_install-packages-unix.sh.tmpl new file mode 100644 index 0000000..f58c78a --- /dev/null +++ b/run_onchange_before_install-packages-unix.sh.tmpl @@ -0,0 +1,64 @@ +#!/bin/bash +# Installs the system packages the dotfiles need and makes zsh the login +# shell. chezmoi runs this before applying files and again only when the +# rendered script changes. sudo is only used when something is missing. +set -euo pipefail + +as_root() { + if [ "$(id -u)" -eq 0 ]; then + "$@" + else + sudo "$@" + fi +} + +{{ if eq .chezmoi.os "linux" -}} +missing=() +need() { # need COMMAND [PACKAGE] + command -v "$1" >/dev/null 2>&1 || missing+=("${2:-$1}") +} +need_lib() { # need_lib LIBRARY PACKAGE + /sbin/ldconfig -p | grep -F "$1" >/dev/null || missing+=("$2") +} +need curl +need git +need zsh +need cc gcc # nvim-treesitter compiles its parsers with it +need unzip # Mason unpacks some tools with it, such as stylua +# Mason installs Python tools, such as pyrefly, in virtual environments, which +# Ubuntu's Python can only create with python3-venv +need python3 +python3 -c 'import ensurepip' 2>/dev/null || missing+=(python3-venv) +need_lib libatomic.so.1 libatomic1 # Node.js from mise links against it + +if [ ${#missing[@]} -gt 0 ]; then + printf "\n# Install %s\n" "${missing[*]}" + if command -v apt-get >/dev/null 2>&1; then + as_root apt-get update + as_root apt-get install -y "${missing[@]}" + else + echo "Install ${missing[*]}, then run chezmoi apply again" >&2 + exit 1 + fi +fi + +{{ end -}} +change_login_shell() { + grep -qxF "$1" /etc/shells || echo "$1" | as_root tee -a /etc/shells >/dev/null + as_root chsh -s "$1" "$(id -un)" +} + +zsh_path=$(grep -m1 "/zsh$" /etc/shells || command -v zsh) +{{- if eq .chezmoi.os "darwin" }} +login_shell=$(dscl . -read "/Users/$(id -un)" UserShell | awk '{print $2}') +{{- else }} +login_shell=$(getent passwd "$(id -un)" | cut -d: -f7) +{{- end }} +case "$login_shell" in + */zsh) ;; + *) + printf "\n# Make zsh the login shell\n" + change_login_shell "$zsh_path" || + echo "Could not make zsh the login shell, run: chsh -s $zsh_path" >&2 + ;; +esac diff --git a/run_onchange_before_install-packages-windows.ps1 b/run_onchange_before_install-packages-windows.ps1 new file mode 100644 index 0000000..ff40c69 --- /dev/null +++ b/run_onchange_before_install-packages-windows.ps1 @@ -0,0 +1,23 @@ +# Installs the programs that Neovim needs and mise doesn't install, if they're +# missing: gcc, which nvim-treesitter compiles its parsers with, and Python, +# which Mason installs pyrefly with. chezmoi runs this before applying files, +# and again whenever this script changes. +$ErrorActionPreference = 'Stop' + +function Install-Package([string]$id) { + Write-Host "`n# Install $id with winget" + winget install --exact --id $id --source winget --no-upgrade --accept-package-agreements --accept-source-agreements + # -1978335135 means it's already installed, but isn't on this terminal's Path + if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne -1978335135) { + throw "winget couldn't install $id, and exited with $LASTEXITCODE" + } +} + +if (-not (Get-Command gcc -ErrorAction Ignore)) { + Install-Package 'BrechtSanders.WinLibs.POSIX.UCRT' +} +# Windows comes with a python command that only opens the Microsoft Store +$python = Get-Command python -ErrorAction Ignore +if (-not $python -or "$(& $python --version 2>&1)" -notmatch '^Python 3') { + Install-Package 'Python.Python.3.14' +}