Repository navigation
Conversation
omarchy-hibernation-setup and omarchy-toggle-hybrid-gpu copied the keyboard-backlight and force-igpu hooks into /usr/lib/systemd/system-sleep/ with cp -p, preserving the source's 644 mode. systemd-sleep only executes executable files in that directory, so both hooks were silently skipped. Use install -m755 so the installed hooks are executable regardless of the source mode, and mark the hooks executable in the repo as well. Fixes omacom#7618 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdrqXrL4pbdS9CjdHxfCYF
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db2e2b26f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| # Ensure keyboard backlight doesn't prevent sleep | ||
| sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/lib/systemd/system-sleep/ | ||
| sudo install -m755 "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/lib/systemd/system-sleep/ |
There was a problem hiding this comment.
Install the repair before the already-configured return
On the existing installations this change is intended to repair, /etc/mkinitcpio.conf.d/omarchy_resume.conf already contains HOOKS+=(resume), so the check at lines 34–47 exits before this new install -m755 command runs. Consequently, re-running omarchy hibernation setup leaves the previously installed keyboard-backlight hook at mode 0644 and systemd continues skipping it; perform this repair before the early return or within that branch.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — the PR description was wrong about re-running setup being enough. Rather than adding a second install in the already-configured branch, 8e5ed6f adds migrations/1787336732.sh, which makes an installed non-executable keyboard-backlight (and force-igpu) executable in place. It runs on the next omarchy update regardless of the early return, and no-ops once the hook is already 755.
| # Force igpu mode after system sleep (or dgpu could get activated) | ||
| sudo mkdir -p /usr/lib/systemd/system-sleep | ||
| sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/force-igpu" /usr/lib/systemd/system-sleep/ | ||
| sudo install -m755 "$OMARCHY_PATH/default/systemd/system-sleep/force-igpu" /usr/lib/systemd/system-sleep/ |
There was a problem hiding this comment.
Migrate already-installed integrated-GPU hooks
Existing users who selected Integrated mode already have a 0644 /usr/lib/systemd/system-sleep/force-igpu from the old cp -p, but this new installation command only runs in the "Hybrid" branch. Their current mode is reported as Integrated, so invoking the toggle instead enters the opposite branch and removes the hook while switching to Hybrid; merely updating or running the command once therefore does not repair their inactive hook. Add a one-time repair for an existing force-igpu installation rather than requiring two mode changes and reboots.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed — users already in Integrated mode would have needed two mode changes and two reboots. 8e5ed6f adds migrations/1787336732.sh, which fixes an installed non-executable force-igpu in place with chmod 755 on the next omarchy update, with no mode toggle involved. A missing hook (Hybrid-mode machines) is left alone.
Installing the hooks with install -m755 only helps machines that run hibernation setup or the GPU toggle again, and neither path reaches the install on an affected machine: hibernation setup exits early once the resume hook is configured, and the GPU toggle only installs force-igpu when switching into Integrated mode, which is the mode those users are already in. Make the installed copies executable in place instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdrqXrL4pbdS9CjdHxfCYF
There was a problem hiding this comment.
💡 Codex Review
https://github.com/basecamp/omarchy/blob/8e5ed6ffc10f631d5f692e29eba8b6c543e11ad0/default/systemd/system-sleep/force-igpu#L1
Keep the packaged force-igpu hook inactive in Hybrid mode
On a machine configured for Hybrid mode, installing this release can activate force-igpu even though omarchy-toggle-hybrid-gpu deliberately removes that hook when switching to Hybrid (bin/omarchy-toggle-hybrid-gpu:42-47). The packaging map shows that omarchy-settings installs this source at /usr/lib/systemd/system-sleep/force-igpu (docs/file-layout.md:110,127-128), so making the source executable—or subsequently applying the migration's unconditional chmod 755—makes systemd run it after every sleep; its post branch then invokes supergfxctl -m Integrated, unexpectedly disabling the configured hybrid/dedicated GPU. Keep the packaged conditional hook inactive and only make an existing copy executable when /etc/supergfxd.conf confirms Integrated mode.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
force-igpu switches the GPU back to Integrated after every sleep, so it must only be live on a machine that is still in Integrated mode. The toggle removes the hook on its way to Hybrid, but a mode change made directly through supergfxctl leaves the inert copy behind, and waking it up would flip the GPU under the user. Ask supergfxd the way the toggle does before making that hook executable, and leave it alone when there is no answer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdrqXrL4pbdS9CjdHxfCYF
|
Re the second Codex review ("Keep the packaged force-igpu hook inactive in Hybrid mode"): The packaging premise is not right. The residual case is real, though: someone who left Integrated mode straight through |
|
Closing: superseded by #10425 (feb0557, "Harden ownership of installed sleep hooks"). Both |
Fixes #7618.
omarchy hibernation setupcopiesdefault/systemd/system-sleep/keyboard-backlightinto/usr/lib/systemd/system-sleep/withcp -p. The source ships with mode 644, so the installed hook is 644 too, and systemd-sleep(8) silently skips non-executable files in that directory. The hook that is supposed to zero the keyboard backlight before hibernate therefore never runs on any install that has run hibernation setup.omarchy-toggle-hybrid-gpuinstallsforce-igputhe same way (cp -p, same 644 source), so it has the same defect: the hook meant to force integrated mode after sleep never runs either. The stale #4793 noticed this forforce-igpuback in February.Fix
bin/omarchy-hibernation-setup,bin/omarchy-toggle-hybrid-gpu: replacesudo cp -pwithsudo install -m755, so the installed hook is executable regardless of the mode the source ships with (the packaged copy under/usr/share/omarchy/default/...is 644 today:omarchy-settingsinstalls it withinstall -Dm644, so the repo mode bit does not carry into the package).migrations/1787336732.sh: repair already-affected installs by making the installedkeyboard-backlightandforce-igpuexecutable in place. Neither install path reaches the newinstall -m755on an affected machine — hibernation setup exits early once the resume hook is configured, and the GPU toggle only installsforce-igpuwhen switching into Integrated mode, which is the mode those users are already in — so the migration is what fixes existing machines. It only touches a hook that is present and non-executable, so a second user on the same machine no-ops.force-igpuforces Integrated mode after every sleep, so the migration only activates it whensupergfxctl -g(queried the way the toggle does) reportsIntegrated. The toggle removes the hook on its way to Hybrid, but a mode change made directly throughsupergfxctlleaves the inert copy behind, and that copy must stay inert. No answer from supergfxd leaves the hook as it is.keyboard-backlightonly fires onpre hibernateand is repaired unconditionally.test/shell.d/sleep-hook-executable-migration-test.shcovers the migration.Verification
bash -non the two scripts and both hooks.install -m755 <hook> <dir>/locally: lands under the hook's basename, mode 755, content byte-identical to the source, and overwrites an existing 644 copy with 755.bash test/shell.d/sleep-hook-executable-migration-test.shpasses: 644 hooks become 755 throughsudo chmod,force-igpustays inert in Hybrid mode or when supergfxd does not answer (with the toggle's three-attempt query), a missing hook is left absent, and an already-repaired machine triggers nosudocall../test/cliand the full./test/shell— not runnable on my macOS dev box:./test/clifails at "main help includes hardware group" onquattrobefore and after this change (hardware group discovery needs Linux), and./test/shellhangs on tests that need the running desktop, so the suites are not informative here.🤖 Generated with Claude Code
https://claude.ai/code/session_01KdrqXrL4pbdS9CjdHxfCYF