Repository navigation
Keep symlinked terminal configs linked when changing font or text size #14343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
| source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh" | ||
|
|
||
| test_dir=$(mktemp -d) | ||
| trap 'rm -rf "$test_dir"' EXIT | ||
| test_home="$test_dir/home" | ||
| dotfiles="$test_dir/dotfiles" | ||
| configs=(alacritty/alacritty.toml ghostty/config foot/foot.ini) | ||
|
|
||
| # Link each stock terminal config from a dotfiles checkout, as a dotfiles | ||
| # manager would. | ||
| for config in "${configs[@]}"; do | ||
| mkdir -p "$dotfiles/$(dirname "$config")" "$test_home/.config/$(dirname "$config")" | ||
| cp "$ROOT/config/$config" "$dotfiles/$config" | ||
| ln -s "$dotfiles/$config" "$test_home/.config/$config" | ||
| done | ||
|
|
||
| # Exercise the real font commands without changing the running desktop. | ||
| mkdir -p "$test_dir/bin" | ||
| for command in pkill omarchy-restart-shell omarchy-hook omarchy-notification-send gsettings; do | ||
| printf '#!/bin/bash\nexit 0\n' >"$test_dir/bin/$command" | ||
| done | ||
| printf '#!/bin/bash\nexit 1\n' >"$test_dir/bin/pgrep" | ||
| printf '#!/bin/bash\nprintf "Test Font\\n"\n' >"$test_dir/bin/fc-list" | ||
| chmod +x "$test_dir/bin/"* | ||
|
|
||
| run_command() { | ||
| env HOME="$test_home" OMARCHY_PATH="$ROOT" PATH="$test_dir/bin:$ROOT/bin:$PATH" "$ROOT/bin/$@" | ||
| } | ||
|
|
||
| run_command omarchy-font-set 'Test Font' >/dev/null | ||
| run_command omarchy-display-text-size 16 >/dev/null | ||
|
|
||
| for config in "${configs[@]}"; do | ||
| [[ -L $test_home/.config/$config ]] || fail "$config stays a symlink" | ||
| done | ||
| pass "font and text size commands keep symlinked terminal configs linked" | ||
|
|
||
| grep -q 'family = "Test Font"' "$dotfiles/alacritty/alacritty.toml" || fail "alacritty font lands in the symlink target" | ||
| grep -qx 'size = 12' "$dotfiles/alacritty/alacritty.toml" || fail "alacritty size lands in the symlink target" | ||
| grep -qx 'font-family = "Test Font"' "$dotfiles/ghostty/config" || fail "ghostty font lands in the symlink target" | ||
| grep -qx 'font-size = 12' "$dotfiles/ghostty/config" || fail "ghostty size lands in the symlink target" | ||
| grep -qx 'font=Test Font:size=12' "$dotfiles/foot/foot.ini" || fail "foot font and size land in the symlink target" | ||
| pass "font and text size changes are written through to the symlink targets" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new test repeats setup already in
test/shell.d/kitty-config-test.sh, which runs both font commands.AGENTS.mdrequires extending the area's existing test rather than adding another*-test.sh. Move these symlink checks into that file before merging so the shared setup stays in one place.File Used:
AGENTS.md(source)Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!