Add Configurable Status Bar Widgets#83
Open
JonathanRiche wants to merge 6 commits intorockorager:mainfrom
Open
Add Configurable Status Bar Widgets#83JonathanRiche wants to merge 6 commits intorockorager:mainfrom
JonathanRiche wants to merge 6 commits intorockorager:mainfrom
Conversation
Add a widget-based status bar system that allows users to configure
left, center, and right sections with built-in or custom widgets.
New features:
- Built-in widgets: mode, git, zoom, time, battery, hostname
- Shell command widgets for custom data (e.g., weather)
- Per-widget refresh intervals
- Auto-hide widgets when data unavailable (e.g., battery on desktop)
New Lua APIs (in ui.zig):
- prise.get_battery() - returns {percent, charging} or nil
- prise.get_hostname() - returns system hostname
- prise.exec() - execute shell commands with optional timeout
Example configuration:
status_bar = {
widgets = {
left = { 'mode', 'git', 'zoom' },
center = { 'hostname' },
right = { 'battery', 'time' },
},
}
Backwards compatible: omitting widgets config uses legacy layout.
Battery widget now displays different icons based on charge level: - Charging: 6 states from empty to full (→) - Discharging: 10 states from low to full (→) Icons update at 10% intervals for a visual indication of remaining charge.
Fix two issues with status bar widget rendering: 1. Right-side powerline arrows now use correct color ordering (fg=next_bg, bg=prev_bg) so arrows visually point into segments properly, matching the left-side appearance. 2. Center and right section widgets now auto-alternate between bg3/bg4 backgrounds based on visible position. This ensures visual separation between adjacent widgets regardless of their order or count.
Author
|
Fixed the issue with powerline symbols latest session with opencode as well : https://opncd.ai/share/zfK2yfuP
|
Fix two issues causing the terminal to freeze when detaching: 1. Thread-safe should_quit flag: Changed from plain bool to std.atomic.Value(bool) with proper acquire/release semantics. The TTY thread reads this flag while the main thread writes it, and without atomics the compiler could cache the value in release builds, causing the TTY thread to never see the quit signal. 2. io_uring pending operations not draining: When detaching, individual task.cancel() calls only queue cancel SQEs to the io_uring ring - they don't complete synchronously. The loop waits for pending count to reach 0, but cancelled operations (especially recv on a closed fd) may never complete, causing the loop to block forever. Added Loop.cancelAll() which cancels all pending operations AND clears the pending map immediately, allowing the io loop to exit without waiting for cancel completions that may never arrive.
Fix two issues causing the terminal to freeze when detaching: 1. Thread-safe should_quit flag: Changed from plain bool to std.atomic.Value(bool) with proper acquire/release semantics. The TTY thread reads this flag while the main thread writes it, and without atomics the compiler could cache the value in release builds, causing the TTY thread to never see the quit signal. 2. io_uring/kqueue pending operations not draining: When detaching, individual task.cancel() calls only queue cancel requests - they don't complete synchronously. The loop waits for pending count to reach 0, but cancelled operations (especially recv on a closed fd) may never complete, causing the loop to block forever. Added Loop.cancelAll() to both io_uring and kqueue backends which cancels all pending operations AND clears the pending map immediately, allowing the io loop to exit without waiting for cancel completions that may never arrive.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

I used Opus after i did a review of whats needed(fed it a plan.md file on how prise widgets could work)
Here's the whole session/chat : https://opncd.ai/share/PBAUOlj1
Changes:
Git Commits Made
16ec408 feat(battery): show charge level icons based on percentage
f4d8cb8 feat: add customizable status bar widget system
Files Modified
Example User Configuration
What Could Be Done Next