Repository navigation
Conversation
eb41d1b to
a6244b3
Compare
|
Thanks for digging into #13342. A couple of concerns with the approach:
Related: #13867 also changes Bluetooth power behavior (Chromium phone-passkey power-on) and overlaps here, and #12753 changes the scope of the rfkill block. Worth checking the three together. |
BlueZ AutoEnable can race systemd-rfkill across reboot. Mirror on/off under XDG state and re-apply it from a session oneshot (omacom#13342). Co-authored-by: AnPod <AnPod@users.noreply.github.com>
a6244b3 to
a375536
Compare
[Medium impact] The change is limited to Bluetooth power in Omarchy desktop sessions. The PR should not merge until the Bluetooth tests stop overwriting the user's saved choice. FindingsSummaryThe PR saves Bluetooth power choices and reapplies them after login.
|
| state_home="$device_tmp/state" | ||
| mkdir -p "$state_home" | ||
| export XDG_STATE_HOME="$state_home" |
There was a problem hiding this comment.
Tests overwrite the saved choice
XDG_STATE_HOME is set only after earlier calls to omarchy-bluetooth-power. Those calls now save preferences, so running this test with the normal environment overwrites ~/.local/state/omarchy/bluetooth-power. The last earlier toggle saves off, which the new service applies at the next login.
Move the temporary state setup before the first helper call, and isolate OMARCHY_BLUETOOTH_STATE_FILE too.
| # bluetoothd may AutoEnable before systemd-rfkill finishes restoring a soft | ||
| # block across reboot (#13342). Re-apply the user's last omarchy-bluetooth-power | ||
| # choice once the session and bluetooth stack are up. | ||
| After=bluetooth.service graphical-session-pre.target |
There was a problem hiding this comment.
After=bluetooth.service cannot wait for the system Bluetooth service from this user unit. Bluetooth runs in the system manager, while this service runs in the user manager.
If Bluetooth starts late, the one-time restore can finish before it is ready. The on branch hides failure and does not retry, leaving the saved choice unapplied. Use an explicit readiness check and a bounded retry instead.
Knowledge Base Used: Desktop session and window management
|
The class of this pull request is unsettled, so it carries no class label for now and nothing was run on it this pass. Two models classified it separately at a375536. I (Opus 5.5 in Claude Code) read it as a Nothing else was reviewed or verified, so this is not a finding on the change. Whether it is worked as a fix or treated as a feature is the maintainer's call, and it waits on them. |
|
Hardware test of Method: the PR's helper first on PATH, and its unit copied into
Why it fails as written (boot 1, seconds since boot):
Boots 2 and 3 show the same order, with the restore 1.32 s before the unblock. (In boot 2 the old hci0 entry hadn't been removed yet, so the block landed on that stale entry; same outcome.) The unblock is the kernel rfkill-input unblock-all from #13342: it fires when Hyprland's first input-device sync flushes the With
Two caveats:
Not tested: jandrusk's point about an off set outside Tested with help from Claude Code; every run was on my machine. |
On a ThinkPad T14 Gen 2a the restore ran at graphical-session-pre.target, about 1.3 s before Hyprland's first input sync flushed the queued SW_RFKILL_ALL event; rfkill-input then unblocked every radio and Bluetooth came back on over a saved off (0/3 boots). Ordered after graphical-session.target, the off state held (2/2), as tested by @echennells.
|
The head moved to 1d5587e since the last pass, so this pull request was classified again, and its class is still unsettled. It carries no class label for now and nothing was run on it. I (Opus 5.5 in Claude Code) read it as Nothing on this head was reviewed or verified, so this is not a finding on the change. |
Summary
Turning Bluetooth off via the panel can lose the preference across reboot when BlueZ
AutoEnableracessystemd-rfkill.omarchy-bluetooth-powernow mirrors on/off under XDG state, and a session oneshot (omarchy-bluetooth-power-restore.service) re-applies it after login. First-run and a migration enable the unit for new and existing installs.Fixes #13342
Test plan
test/shell.d/bluetooth-test.sh(remember/restore)test/shell.d/systemd-test.sh(unit + first-run)