Skip to content

fix(zsh): improve Rainbow resource segments - #112

Merged
LucaLin233 merged 1 commit into
mainfrom
forge/fix-rainbow-resource-segments
Dec 2, 2026
Merged

LucaLin233 merged 1 commit into
mainfrom
forge/fix-rainbow-resource-segments

Conversation

@LucaLin233

Copy link
Copy Markdown
Owner

Summary

Sync p10k-config.zsh with the Termark-verified Rainbow prompt. The resource row now shows CPU usage percentage, RAM and root-filesystem free space, and the extra gap after the prompt char is gone.

Scope

  • p10k-config.zsh only, copied byte-for-byte from the verified config.
  • Replaces the 5-minute load segment with a /proc/stat CPU percentage (no fork, no background hook, 50/70 thresholds kept).
  • Adds a root_disk segment that shows only the root partition's available space, cached for 5 seconds; 90/95 usage levels drive warning colors.
  • RAM stays in the resource row (color 109); CPU uses 146, disk uses 223.
  • Keeps the installer's existing theme choice and download path unchanged.

Validation

  • sha256sum p10k-config.zsh = dbf8f7ca0e2757f15947a82819f6194fcb6e9862d11f501ca1c1ccc662b6386b (106711 B), identical to the Termark-verified source; remote blob at the task branch has the same SHA256.
  • zsh -n p10k-config.zsh exit 0.
  • git diff --check exit 0.
  • User accepted the prompt layout from a Termark screenshot: CPU percentage on first prompt without a keypress, CPU/RAM/disk colors 146/109/223, disk free space only, one cell after ❯.
  • CI: required Ubuntu 24.04 lint and tests and Debian 13 tests.

Risks

  • Dropping the standard disk_usage segment means disk free space now comes from a custom segment; on systems without /usr/bin/df the segment stays hidden instead of warning.
  • CPU sampling uses /proc/stat, so non-Linux shells would show cpu —.
  • Prompt changes are visual; rollback is a config-only revert.

Rollback

Revert this commit (or restore the previous p10k-config.zsh); the installer re-downloads the theme from the pinned repository ref.

Show CPU percentage instead of 5-minute load, keep RAM in the resource
row, and display only root filesystem free space with a five-second cache.
Also drop the duplicate gap after the prompt char.

Copied byte-for-byte from the Termark-verified Rainbow config.
@LucaLin233
LucaLin233 merged commit b4b6392 into main Dec 2, 2026
16 checks passed
@LucaLin233
LucaLin233 deleted the forge/fix-rainbow-resource-segments branch December 2, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant