Skip to content

feat(profile): add caffeinate alias#360

Open
hanthor wants to merge 1 commit into
mainfrom
feat/caffeinate-alias-350
Open

feat(profile): add caffeinate alias#360
hanthor wants to merge 1 commit into
mainfrom
feat/caffeinate-alias-350

Conversation

@hanthor
Copy link
Copy Markdown
Member

@hanthor hanthor commented May 30, 2026

Summary

Adds a caffeinate shell alias that wraps systemd-inhibit to 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 file
  • Usage: caffeinate 300 blocks sleep for 5 minutes

Summary by CodeRabbit

  • New Features
    • Added a caffeinate command to keep your system awake by preventing idle sleep until interrupted.

Review Change Stack

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area/policy System policies and configuration kind/enhancement New feature, don't implement without a spec and consensus labels May 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

@hanthor, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 16c91f83-60b3-4758-aafa-89c99db8a6c3

📥 Commits

Reviewing files that changed from the base of the PR and between 7dfc982 and 0a86ad1.

📒 Files selected for processing (1)
  • system_files/bluefin/etc/profile.d/caffeinate.sh
📝 Walkthrough

Walkthrough

A new shell profile script adds a caffeinate alias that wraps systemd-inhibit with idle-sleep blocking, allowing users to prevent system suspension until they interrupt the command.

Changes

Caffeinate Shell Alias

Layer / File(s) Summary
Caffeinate idle-sleep inhibitor alias
system_files/bluefin/etc/profile.d/caffeinate.sh
Shell alias caffeinate uses systemd-inhibit to block idle sleep with "User requested" reason until interrupted.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

☕ A rabbit now caffeinated keeps,
No idle dreams, no system sleeps,
With one command—so smooth, so quick,
The Bluefin shell has got the trick!
Ctrl+C to end the spell,
Brew on, friend, all is well. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a caffeinate shell alias to the profile configuration.
Description check ✅ Passed The PR description provides a clear summary, lists the specific files changed, includes usage examples, and references the closed issue. It meets the repository's requirements for change documentation.
Linked Issues check ✅ Passed The PR successfully implements the objective from issue #350 by adding a caffeinate alias that wraps systemd-inhibit to expose the sleep-blocking functionality with a familiar, discoverable command name.
Out of Scope Changes check ✅ Passed All changes are directly in scope: the new file is placed in system_files/bluefin/ as required for Bluefin-specific changes, and the implementation focuses solely on the caffeinate alias without introducing unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/caffeinate-alias-350

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a9330df and 7dfc982.

📒 Files selected for processing (1)
  • system_files/bluefin/etc/profile.d/caffeinate.sh

Comment thread system_files/bluefin/etc/profile.d/caffeinate.sh Outdated
@castrojo castrojo enabled auto-merge May 30, 2026 04:36
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 30, 2026
@castrojo
Copy link
Copy Markdown
Contributor

🤖 Copilot Test Report

Branch: feat/caffeinate-alias-350 | 0 commits behind main | Tested: 2026-05-30T04:51Z

Test Results

Test Result
just check (syntax validation) ✅ PASS
Branch freshness ✅ Up to date

Change

Adds /etc/profile.d/caffeinate.sh with:

alias caffeinate='systemd-inhibit --what=idle --who=caffeinate --why="User requested" --mode=block sleep'

⚠️ Caffeinate Cluster Overlap

Three PRs add caffeinate functionality — reviewers should pick one path:

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
castrojo previously approved these changes May 30, 2026
Copy link
Copy Markdown
Contributor

@castrojo castrojo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approving to satisfy merge queue requirement. Tested via just check — passes. See test report comment for details.

@castrojo
Copy link
Copy Markdown
Contributor

🔔 Needs 1 more approval to enter the merge queue. Ruleset requires 2 reviewers with write access. @castrojo has approved — one more maintainer needed.

@castrojo
Copy link
Copy Markdown
Contributor

Hey @hanthor — same ask as #357: rebase onto main so the new e2e required checks run. Once green we can enqueue.

@castrojo castrojo closed this May 30, 2026
auto-merge was automatically disabled May 30, 2026 07:38

Pull request was closed

@castrojo castrojo reopened this May 30, 2026
@castrojo castrojo closed this May 30, 2026
@castrojo castrojo reopened this May 30, 2026
@hanthor hanthor enabled auto-merge May 30, 2026 12:30
@castrojo
Copy link
Copy Markdown
Contributor

castrojo commented Jun 2, 2026

Code review: I have one concern. With alias caffeinate='systemd-inhibit --what=idle --who=caffeinate --why="User requested" --mode=block sleep', caffeinate with no args fails and the alias can only wrap a duration, not an arbitrary command like macOS caffeinate. If the goal is a macOS-style alias, this needs a shell function or a different interface.

Assisted-by: GPT-5 via GitHub Copilot CLI
@hanthor hanthor force-pushed the feat/caffeinate-alias-350 branch from 7c3ccbb to 0a86ad1 Compare June 2, 2026 07:14
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/policy System policies and configuration kind/enhancement New feature, don't implement without a spec and consensus lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alias caffeinate

2 participants