feat(profile): add caffeinate alias#360
Conversation
|
Warning Review limit reached
More reviews will be available in 27 minutes and 55 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new shell profile script adds a ChangesCaffeinate Shell Alias
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@system_files/bluefin/etc/profile.d/caffeinate.sh`:
- Around line 3-4: The caffeinate alias runs systemd-inhibit ... sleep and fails
when no seconds are provided; replace the alias named "caffeinate" with a shell
function that invokes systemd-inhibit --what=idle --who=caffeinate --why="User
requested" --mode=block sleep, but if no argument(s) are passed call sleep with
an infinite duration (e.g., sleep infinity or a very large number) and otherwise
forward the provided seconds/arguments to sleep; implement the function named
caffeinate so it accepts and forwards "$@" to sleep and handles the
empty-argument case to keep the system awake until Ctrl+C.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bbee7f72-6bad-43a6-b715-bdc3aa39b41f
📒 Files selected for processing (1)
system_files/bluefin/etc/profile.d/caffeinate.sh
🤖 Copilot Test ReportBranch: Test Results
ChangeAdds alias caffeinate='systemd-inhibit --what=idle --who=caffeinate --why="User requested" --mode=block sleep'
|
| PR | Approach | File |
|---|---|---|
| #360 (this PR) | Shell alias via profile.d (adds sleep suffix) |
etc/profile.d/caffeinate.sh |
| #361 | Shell alias via profile.d (no sleep suffix, takes args directly) |
Same file — would conflict |
| #351 | ujust caffeinate recipe in default.just |
default.just |
#360 and #361 create the same file and cannot both be merged. #351 is additive (ujust recipe) and could co-exist with either alias PR.
castrojo
left a comment
There was a problem hiding this comment.
✅ Approving to satisfy merge queue requirement. Tested via just check — passes. See test report comment for details.
|
🔔 Needs 1 more approval to enter the merge queue. Ruleset requires 2 reviewers with write access. @castrojo has approved — one more maintainer needed. |
|
Code review: I have one concern. With |
Assisted-by: GPT-5 via GitHub Copilot CLI
7c3ccbb to
0a86ad1
Compare
Summary
Adds a
caffeinateshell alias that wrapssystemd-inhibitto temporarily prevent sleep/suspend. This mirrors the familiar macOS command name and makes the sleep-blocking feature discoverable.Closes #350
Changes
system_files/bluefin/etc/profile.d/caffeinate.sh: new alias filecaffeinate 300blocks sleep for 5 minutesSummary by CodeRabbit
caffeinatecommand to keep your system awake by preventing idle sleep until interrupted.