Skip to content

Unset HL_INITIAL_WORKSPACE_TOKEN before dbus import to prevent lock#1783

Open
BigDawnGhost wants to merge 1 commit into
HyDE-Project:masterfrom
BigDawnGhost:fix/workspace-token-systemd-master
Open

Unset HL_INITIAL_WORKSPACE_TOKEN before dbus import to prevent lock#1783
BigDawnGhost wants to merge 1 commit into
HyDE-Project:masterfrom
BigDawnGhost:fix/workspace-token-systemd-master

Conversation

@BigDawnGhost

@BigDawnGhost BigDawnGhost commented Jun 11, 2026

Copy link
Copy Markdown

Description

Fixes #1766

Since Hyprland 0.55, exec-once commands inherit HL_INITIAL_WORKSPACE_TOKEN (previously they did not in 0.54). HyDE runs dbus-update-activation-environment --systemd --all at startup, which imports this token into the systemd user environment. Subsequent app launches via hyde-shell appsystemd-run inherit the stale token, causing all windows to open on workspace 1.

This PR adds env -u HL_INITIAL_WORKSPACE_TOKEN to strip the token before the dbus import, while keeping the original --all behavior.

See issue #1766 analysis for detailed root cause.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit message follows the commit guidelines.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added a changelog entry.
  • I have added necessary comments/documentation to my code.
  • I have added tests to cover my changes.
  • I have tested my code locally and it works as expected.
  • All new and existing tests passed.

Summary by CodeRabbit

  • Chores
    • Updated system startup configuration to handle one-time environment setup for DBus more flexibly.
    • Replaced a hardcoded startup action with a configurable variable, improving maintainability and allowing safer environment handling during session start.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Warning: PR targeting master branch detected!

This PR is targeting master but should target dev instead.

According to our Quarterly Release Policy:

  • All pull requests must be submitted to the dev branch
  • Changes go through dev first for testing before being merged to master during quarterly release windows (1st & 3rd Fridays)
  • PRs to master are only allowed for emergencies

Required Action:

  1. Change the base branch from master to dev
  2. Follow the pull request template

If this is an emergency fix, please add a comment explaining why it needs to target master directly.


This is an automated message enforcing our quarterly release workflow.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

startup.conf replaces the hardcoded exec-once command dbus-update-activation-environment --systemd --all with exec-once = $start.DBUS_SHARE_PICKER, delegating the DBUS/share one-time initialization to a start-variable reference.

Changes

Startup DBUS initialization

Layer / File(s) Summary
Replace exec-once with $start.DBUS_SHARE_PICKER
Configs/.local/share/hypr/startup.conf
Replaced exec-once = dbus-update-activation-environment --systemd --all with exec-once = $start.DBUS_SHARE_PICKER to invoke DBUS/share setup via the $start variable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • HyDE-Project/HyDE#1781: Modifies Configs/.local/share/hypr/startup.conf's DBUS exec-once handling (related changes to how dbus-update-activation-environment is invoked).

Poem

🐰 I hopped through configs, soft and snicker,
Swapped a hard line for a tiny picker,
One startup call now finds its place,
Quiet DBUS dance, no rigid trace,
Hops and fixes — a gentle ticker.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Unset HL_INITIAL_WORKSPACE_TOKEN before dbus import to prevent lock' is specific and directly references the technical fix being applied to resolve the workspace token issue.
Linked Issues check ✅ Passed The PR changes align with issue #1766 by removing the HL_INITIAL_WORKSPACE_TOKEN variable before dbus-update-activation-environment runs, preventing stale tokens from being inherited by subsequent app launches on the wrong workspace.
Out of Scope Changes check ✅ Passed The change is narrowly focused on the startup configuration file and directly addresses the root cause identified in issue #1766 without introducing unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

📋 Issue Planner

Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).

View plan for ticket: #1766

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Configs/.local/share/hypr/startup.conf (1)

7-7: 💤 Low value

Consider reformatting the lengthy inline comment.

The comment is very informative but exceeds 100 characters and contains multiple distinct pieces of information. Consider splitting it for better readability:

📝 Suggested comment reformatting
-exec-once = env -u HL_INITIAL_WORKSPACE_TOKEN dbus-update-activation-environment --systemd --all #? Might fail so we hardcode the variables below; Hyprland 0.55+ injects HL_INITIAL_WORKSPACE_TOKEN into exec-once, unset it to prevent apps from locking to workspace 1 on first launch
+# Hyprland 0.55+ injects HL_INITIAL_WORKSPACE_TOKEN into exec-once; unset it to prevent apps from locking to workspace 1
+exec-once = env -u HL_INITIAL_WORKSPACE_TOKEN dbus-update-activation-environment --systemd --all

Alternatively, keep it inline but split into two parts:

-exec-once = env -u HL_INITIAL_WORKSPACE_TOKEN dbus-update-activation-environment --systemd --all #? Might fail so we hardcode the variables below; Hyprland 0.55+ injects HL_INITIAL_WORKSPACE_TOKEN into exec-once, unset it to prevent apps from locking to workspace 1 on first launch
+exec-once = env -u HL_INITIAL_WORKSPACE_TOKEN dbus-update-activation-environment --systemd --all
+# Note: Might fail so we hardcode variables below; Hyprland 0.55+ token unset prevents workspace 1 lock
🤖 Prompt for 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.

In `@Configs/.local/share/hypr/startup.conf` at line 7, The long inline comment on
the exec-once line should be split into two or more shorter '#' comments to
improve readability and keep each under ~100 characters; update the line
containing exec-once = env -u HL_INITIAL_WORKSPACE_TOKEN
dbus-update-activation-environment --systemd --all so the actionable command
stays unchanged and add one comment explaining why HL_INITIAL_WORKSPACE_TOKEN is
unset and a second comment noting Hyprland 0.55+ injects that token and the
fallback/hardcode rationale, each comment referencing HL_INITIAL_WORKSPACE_TOKEN
and Hyprland for clarity.
🤖 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.

Nitpick comments:
In `@Configs/.local/share/hypr/startup.conf`:
- Line 7: The long inline comment on the exec-once line should be split into two
or more shorter '#' comments to improve readability and keep each under ~100
characters; update the line containing exec-once = env -u
HL_INITIAL_WORKSPACE_TOKEN dbus-update-activation-environment --systemd --all so
the actionable command stays unchanged and add one comment explaining why
HL_INITIAL_WORKSPACE_TOKEN is unset and a second comment noting Hyprland 0.55+
injects that token and the fallback/hardcode rationale, each comment referencing
HL_INITIAL_WORKSPACE_TOKEN and Hyprland for clarity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c0e3ee56-4efd-4042-847c-9e038df7731f

📥 Commits

Reviewing files that changed from the base of the PR and between a51460a and a15bf3b.

📒 Files selected for processing (1)
  • Configs/.local/share/hypr/startup.conf

@kRHYME7

kRHYME7 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

ah, how about removing that line? I remembered using --all is bad in my latest branch. can you confirm it works by removing that line?

@BigDawnGhost

Copy link
Copy Markdown
Author

ah, how about removing that line? I remembered using --all is bad in my latest branch. can you confirm it works by removing that line?

I'm not sure what impact this will have, but after deleting that line and restarting the session everything works fine.

Since Hyprland 0.55, exec-once commands inherit HL_INITIAL_WORKSPACE_TOKEN.
'dbus-update-activation-environment --systemd --all' imported it into the
systemd user environment, so apps launched via systemd-run inherited the
stale token and opened on workspace 1.

Remove the --all import entirely: Hyprland's built-in systemd var import
and the hardcoded $start.DBUS_SHARE_PICKER / $start.SYSTEMD_SHARE_PICKER
lines below already cover the required variables, and UWSM sessions manage
the environment themselves.

Fixes HyDE-Project#1766

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BigDawnGhost
BigDawnGhost force-pushed the fix/workspace-token-systemd-master branch from a15bf3b to 065001b Compare June 11, 2026 23:33
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Warning: PR targeting master branch detected!

This PR is targeting master but should target dev instead.

According to our Quarterly Release Policy:

  • All pull requests must be submitted to the dev branch
  • Changes go through dev first for testing before being merged to master during quarterly release windows (1st & 3rd Fridays)
  • PRs to master are only allowed for emergencies

Required Action:

  1. Change the base branch from master to dev
  2. Follow the pull request template

If this is an emergency fix, please add a comment explaining why it needs to target master directly.


This is an automated message enforcing our quarterly release workflow.

@kRHYME7

kRHYME7 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

it's fine, using --all is not deterministic too. example this case good thing you debugged it lol. I remembered testing --all but forgot the exact decision why I added it.

i thought it helped propagating dbus stuff but it got worst in my branch and remove it and actually found the real culprit on why waybar takes long time to load.

@kRHYME7

kRHYME7 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

spoiler alert it is due to resetxdgpodtal script. it shouldn't be run on start up lol.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: when system start aplication alwes open in first workspace

2 participants