Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kanshi profiles don't get applied on first load #4

Open
SoumyaRanjanPatnaik opened this issue May 22, 2024 · 3 comments
Open

kanshi profiles don't get applied on first load #4

SoumyaRanjanPatnaik opened this issue May 22, 2024 · 3 comments

Comments

@SoumyaRanjanPatnaik
Copy link
Collaborator

kanshi fails to apply output profiles at the start of the session if it is executed from the sway configuration. This creates the illusion that the display settings don't persist and require reconfiguration to restore expected behaviour. For context, regolith-displayd generates kanshi profiles that automatically configure displays based on the connected outputs on hotplug.

Killing and restarting 'kanshi` leads to the successful application of the profiles. Reloading the configurations for the sway session already does this and can be used as a temporary workaround until this issue is resolved. regolith-linux/sway-regolith/issues/26 also describes the same problem.

Looking into the logs, I see the following error.

 failed to apply configuration for profile.

I looked at the code for kanshi; this error only happens when the Wayland server fails to apply the configurations requested.

Starting kanshi manually AFTER sway starts applies the profiles correctly.

My initial thought was sway v1.9 might have introduced some changes that led to a race condition between config parsing and the Wayland server startup. However, delaying the startup of kanshi by adding a timeout using sleep doesn't fix the issue so I'm not too sure.

@kgilmer let me know if you have any thoughts. This is most certainly a blocker for the stabilisation of the sway session with this release.

@kgilmer
Copy link
Member

kgilmer commented May 23, 2024

Hmm, not having looked in detail, I don't have anything off the top of my head.

Starting kanshi manually AFTER sway starts applies the profiles correctly.

Could we just do some systemd configuration such that this happens, or is there a downside?

@rmasad
Copy link

rmasad commented Nov 3, 2024

Coming back to this error, I leave the output of systemctl --user status regolith-init-kanshi.service:

● regolith-init-kanshi.service - Start Kanshi for Regolith
     Loaded: loaded (/usr/lib/systemd/user/regolith-init-kanshi.service; static)
     Active: active (running) since Sun 2024-11-03 11:29:07 -03; 10s ago
   Main PID: 21568 (kanshi)
      Tasks: 1 (limit: 76201)
     Memory: 244.0K (peak: 1.5M)
        CPU: 9ms
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/regolith-init-kanshi.service
             └─21568 /usr/bin/kanshi -c /home/rmasad/.config/regolith3/kanshi/config

nov 03 11:29:07 x1 systemd[1977]: Started regolith-init-kanshi.service - Start Kanshi for Regolith.
nov 03 11:29:07 x1 kanshi[21568]: applying profile '<anonymous at line 1, col 9>'
nov 03 11:29:07 x1 kanshi[21568]: applying profile output 'Samsung Display Corp. 0x419F Unknown' on connected head 'eDP-1'
nov 03 11:29:07 x1 kanshi[21568]: failed to apply configuration for profile '<anonymous at line 1, col 9>'

I have the impression that something is missing when starting up, that it cannot load the configuration and then, when reloading, it does take it.

@rmasad
Copy link

rmasad commented Nov 3, 2024

I try restarting the regolith-init-kanshi.service and works fine:
image
The problem is when regolith start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants