Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
Jason's dotfiles
================

This repository stores personal shell/editor/tooling config and Windows setup assets.

## Windows backups

Use `windows/backup/export.ps1` to snapshot common Windows app and terminal config into this repo.

```powershell
powershell -ExecutionPolicy Bypass -File .\windows\backup\export.ps1
```

The script is safe to re-run. It only copies files that exist and skips missing targets.

## Commit messages

Use `docs/commit-message-guide.md` for commit message conventions in this repo.

## Prompt snippets

Reusable prompt snippets live in `docs/prompts/`.

Use `scripts/oprompt.ps1` to print or copy one:

```powershell
powershell -ExecutionPolicy Bypass -File .\scripts\oprompt.ps1 commit
powershell -ExecutionPolicy Bypass -File .\scripts\oprompt.ps1 pr-update -Copy
```
74 changes: 74 additions & 0 deletions docs/commit-message-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Commit Message Guide

Use this guide for all commits in this repository.

## Format

Use Conventional Commits:

`<type>(optional-scope): <imperative summary>`

Examples:

- `feat(windows): add config export workflow and initial backups`
- `fix(verify): handle missing checksum argument`
- `docs(readme): clarify Windows backup steps`

## Types

- `feat`: new user-visible capability
- `fix`: bug fix
- `docs`: documentation-only change
- `refactor`: code restructure without behavior change
- `chore`: maintenance work (non-feature/non-fix)
- `test`: add or update tests
- `build`: build/dependency/tooling changes
- `ci`: CI pipeline/workflow changes
- `revert`: revert a previous commit

## Subject line rules

- Keep it concise (target <= 50 chars when practical)
- Use imperative mood (`add`, `update`, `remove`, `fix`)
- Capitalize only where natural (acronyms/proper nouns)
- Do not end with a period
- Focus on intent, not file-by-file mechanics

## Body (when needed)

Add a body for non-trivial changes. Explain:

- Why the change was made
- Any important tradeoffs or constraints
- Follow-up notes for future readers

Wrap body lines around ~72 chars for readability.

## Scope guidance

Use a scope when it improves clarity:

- `windows`, `keyboard`, `backup`, `readme`, `home`, `verify`

Skip scope if it adds noise.

## Good vs bad

Good:

- `feat(backup): export winget package snapshot`
- `docs(windows): add backup workflow and usage`
- `fix(keyboard): make apply script idempotent`

Bad:

- `tweaked stuff`
- `updates`
- `fixed things`

## Pre-commit checklist

- Message matches the actual change
- No secrets included
- Diff is focused and reviewable
- Subject is clear without opening the diff
9 changes: 9 additions & 0 deletions docs/prompts/commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Use `docs/commit-message-guide.md` as the standard for this commit.

Tasks:
- Review staged and unstaged changes.
- Propose 2-3 commit message options in Conventional Commit format.
- Recommend one message and explain why it best captures intent.
- If there are possible secrets in changed files, call them out before committing.

Keep output concise and actionable.
9 changes: 9 additions & 0 deletions docs/prompts/pr-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Review the current branch diff against base and draft a PR update.

Tasks:
- Summarize what changed since the last PR update.
- Propose a PR title that reflects current scope.
- Write a PR body with a `## Summary` section and 3-6 bullets.
- Flag risky or machine-specific changes that reviewers should focus on.

Keep wording clear for reviewers scanning quickly.
62 changes: 62 additions & 0 deletions home/.config/komorebi-setup-notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Komorebi Setup Notes

Core startup
- C:\Users\jason\.config\start-komorebi.cmd
Starts komorebi, bars, whkd, and workspace-cycle.ahk.
Includes retry logic for komorebi startup timing.

Scheduled tasks
- StartKomorebi
Trigger: logon (delayed)
Action: cmd.exe /c "C:\Users\jason\.config\start-komorebi.cmd"
- StartKomorebiOnUnlock
Trigger: unlock event
Action: cmd.exe /c "C:\Users\jason\.config\start-komorebi.cmd"

Hotkeys
- C:\Users\jason\.config\whkdrc
Main window-management hotkeys (focus/move/stack/resize/layout/etc).
Workspace number bindings are intentionally handled by AutoHotkey, not whkd.

Why AutoHotkey handles workspace number bindings
- In this setup, whkd reliably captures many window-management bindings, but
workspace-number style bindings (Alt+1..6 and related cycle combos) were
intermittently dropped after the first successful trigger.
- The komorebic commands and workspace scripts were verified to work when run
directly, so the issue was input-hook reliability for those specific hotkeys,
not command correctness.
- AutoHotkey v2 provided stable repeated capture for these workspace bindings,
so workspace focus/move/cycle keys were moved to workspace-cycle.ahk while
keeping the rest of the keymap in whkd.

AutoHotkey workspace layer
- C:\Users\jason\.config\workspace-cycle.ahk
Reliable workspace hotkeys and ring cycling.
Key map:
- Alt+1..6 focus E1 E2 E3 I1 I2 I3 (adaptive)
- Alt+Shift+1..6 move E1 E2 E3 I1 I2 I3 (adaptive)
- Ctrl+Alt+7 cycle previous workspace in global ring
- Ctrl+Alt+8 cycle next workspace in global ring

Workspace scripts
- C:\Users\jason\.config\workspace-ring.ps1
Cycles workspaces previous/next.
Adaptive behavior for 1-monitor vs 2-monitor setups.

- C:\Users\jason\.config\workspace-target.ps1
Maps slot 1..6 to named workspaces.
- 2 monitors: E1 E2 E3 I1 I2 I3
- 1 monitor: I1 I2 I3 I1 I2 I3

- C:\Users\jason\.config\workspace-reconcile.ps1
Ensures workspace names exist/correct after startup or monitor reconnect.
Called by startup and periodically by workspace-cycle.ahk.

Komorebi config files
- C:\Users\jason\komorebi.json
- C:\Users\jason\komorebi.bar.0.json
- C:\Users\jason\komorebi.bar.1.json

If workspaces look wrong after monitor changes
1) Run: C:\Users\jason\.config\start-komorebi.cmd
2) If needed, run: powershell -ExecutionPolicy Bypass -File C:\Users\jason\.config\workspace-reconcile.ps1
63 changes: 63 additions & 0 deletions home/.config/start-komorebi.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@echo off
setlocal

set "LOG=%LOCALAPPDATA%\komorebi\startup.cmd.log"
echo %date% %time% Startup CMD begin>>"%LOG%"

set "KOMOREBI_OK=0"
for /L %%A in (1,1,8) do (
tasklist /FI "IMAGENAME eq komorebi.exe" | find /I "komorebi.exe" >nul
if not errorlevel 1 (
set "KOMOREBI_OK=1"
echo %date% %time% komorebi.exe already running on attempt %%A>>"%LOG%"
goto :after_komorebi
)

echo %date% %time% Attempt %%A starting komorebi.exe>>"%LOG%"
powershell -NoProfile -Command "Start-Process -FilePath 'C:\Program Files\komorebi\bin\komorebi.exe' -WindowStyle Hidden" >nul 2>&1
powershell -NoProfile -Command "Start-Sleep -Seconds 20" >nul 2>&1

tasklist /FI "IMAGENAME eq komorebi.exe" | find /I "komorebi.exe" >nul
if not errorlevel 1 (
set "KOMOREBI_OK=1"
echo %date% %time% komorebi.exe started on attempt %%A>>"%LOG%"
goto :after_komorebi
)
)

:after_komorebi
if "%KOMOREBI_OK%"=="0" (
echo %date% %time% komorebi.exe not detected after retries>>"%LOG%"
)

powershell -NoProfile -Command "Start-Sleep -Seconds 4" >nul 2>&1

tasklist /FI "IMAGENAME eq komorebi-bar.exe" | find /I "komorebi-bar.exe" >nul
if errorlevel 1 (
echo %date% %time% Starting bars>>"%LOG%"
powershell -NoProfile -Command "Start-Process -FilePath 'C:\Program Files\komorebi\bin\komorebi-bar.exe' -ArgumentList '-c \"%USERPROFILE%\komorebi.bar.0.json\"' -WindowStyle Hidden" >nul 2>&1
powershell -NoProfile -Command "Start-Process -FilePath 'C:\Program Files\komorebi\bin\komorebi-bar.exe' -ArgumentList '-c \"%USERPROFILE%\komorebi.bar.1.json\"' -WindowStyle Hidden" >nul 2>&1
) else (
echo %date% %time% bar already running>>"%LOG%"
)

powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Users\jason\.config\workspace-reconcile.ps1" >nul 2>&1
echo %date% %time% Reconciled workspace names>>"%LOG%"

tasklist /FI "IMAGENAME eq whkd.exe" | find /I "whkd.exe" >nul
if errorlevel 1 (
echo %date% %time% Starting whkd.exe>>"%LOG%"
powershell -NoProfile -Command "Start-Process -FilePath 'C:\Program Files\whkd\bin\whkd.exe' -WindowStyle Hidden" >nul 2>&1
) else (
echo %date% %time% whkd.exe already running>>"%LOG%"
)

powershell -NoProfile -Command "$p = Get-CimInstance Win32_Process -Filter \"Name='AutoHotkey64.exe'\" | Where-Object { $_.CommandLine -like '*workspace-cycle.ahk*' }; if (-not $p) { Start-Process -FilePath 'C:\Program Files\AutoHotkey\v2\AutoHotkey64.exe' -ArgumentList '\"C:\Users\jason\.config\workspace-cycle.ahk\"' -WindowStyle Hidden; exit 10 } else { exit 0 }" >nul 2>&1
if errorlevel 1 (
echo %date% %time% Starting workspace-cycle.ahk>>"%LOG%"
) else (
echo %date% %time% workspace-cycle.ahk already running>>"%LOG%"
)

echo %date% %time% Startup CMD end>>"%LOG%"
endlocal
79 changes: 79 additions & 0 deletions home/.config/whkdrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.shell powershell

# Quick cheat-sheet
# alt + h/j/k/l focus window left/down/up/right
# alt + shift + h/j/k/l move window left/down/up/right
# alt + 1/2/3 focus workspace 1/2/3 on focused monitor
# alt + shift + 1/2/3 move window to workspace 1/2/3 on focused monitor
# alt + 4/5 focus monitor 1/2
# alt + shift + 4/5 move window to monitor 1/2
# alt + 6 focus last workspace
# alt + shift + 6 move window to last workspace
# alt + p toggle pause
# alt + i toggle shortcuts

# 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

alt + i : komorebic toggle-shortcuts

# 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

# Workspace focus (global order: E1 E2 E3 I1 I2 I3)
# Managed by AutoHotkey in workspace-cycle.ahk to avoid dropped hotkeys

# Move windows to global workspace order (E1 E2 E3 I1 I2 I3)
# Managed by AutoHotkey in workspace-cycle.ahk to avoid dropped hotkeys

# Restart Komorebi
alt + shift + c : komorebic stop --bar --whkd;sleep 3;komorebic start --bar --whkd;
60 changes: 60 additions & 0 deletions home/.config/workspace-cycle.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#Requires AutoHotkey v2.0
#SingleInstance Force
#UseHook True

; Key map
; Alt+1..6 focus named workspaces: E1 E2 E3 I1 I2 I3
; Alt+Shift+1..6 move window to: E1 E2 E3 I1 I2 I3
; Ctrl+Alt+7 cycle previous workspace in global ring
; Ctrl+Alt+8 cycle next workspace in global ring

RunKomorebic(args) {
exe := A_ProgramFiles . "\\komorebi\\bin\\komorebic.exe"
Run("`"" . exe . "`" " . args, , "Hide")
}

RunWorkspace(action, slot) {
userProfile := EnvGet("USERPROFILE")
script := userProfile . "\\.config\\workspace-target.ps1"
q := Chr(34)
cmd := "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File " . q . script . q . " -Action " . action . " -Slot " . slot
Run(A_WinDir . "\\System32\\WindowsPowerShell\\v1.0\\powershell.exe " . cmd, , "Hide")
}

RunReconcile() {
userProfile := EnvGet("USERPROFILE")
script := userProfile . "\\.config\\workspace-reconcile.ps1"
q := Chr(34)
cmd := "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File " . q . script . q
Run(A_WinDir . "\\System32\\WindowsPowerShell\\v1.0\\powershell.exe " . cmd, , "Hide")
}

SetTimer(RunReconcile, 15000)
RunReconcile()

RunCycle(direction) {
userProfile := EnvGet("USERPROFILE")
script := userProfile . "\\.config\\workspace-ring.ps1"
q := Chr(34)
cmd := "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File " . q . script . q . " -Direction " . direction
Run(A_WinDir . "\\System32\\WindowsPowerShell\\v1.0\\powershell.exe " . cmd, , "Hide")
}

#F7::RunCycle("previous")
#F8::RunCycle("next")
^!7::RunCycle("previous")
^!8::RunCycle("next")

!1::RunWorkspace("focus", 1)
!2::RunWorkspace("focus", 2)
!3::RunWorkspace("focus", 3)
!4::RunWorkspace("focus", 4)
!5::RunWorkspace("focus", 5)
!6::RunWorkspace("focus", 6)

!+1::RunWorkspace("move", 1)
!+2::RunWorkspace("move", 2)
!+3::RunWorkspace("move", 3)
!+4::RunWorkspace("move", 4)
!+5::RunWorkspace("move", 5)
!+6::RunWorkspace("move", 6)
Loading