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

kde: hm failing to set wallpaper when not in plasma session #340

Closed
luna-skye opened this issue Apr 15, 2024 · 3 comments
Closed

kde: hm failing to set wallpaper when not in plasma session #340

luna-skye opened this issue Apr 15, 2024 · 3 comments
Labels
bug Something isn't working properly technical debt Things which should be cleaned up or improved

Comments

@luna-skye
Copy link

Using NixOS Unstable + Home Manager, with Plasma 6 installed but mostly running Hyprland, I still rely on a lot of KDE software and am letting stylix auto-enable targets.

When rebuilding a minimal stylix config (just image and polarity) from Hyprland, Home Manager throws an error about not being able to set the Plasma wallpaper and fails to switch to the new hm environment.

Disabling stylix.targets.kde.enable provides a workaround as expected, but at the cost of themes for Qt apps.

Rebuilding from a Plasma session succeeds.

Log

systemctl status info printed when hm fails

× home-manager-skye.service - Home Manager environment for skye
     Loaded: loaded (/etc/systemd/system/home-manager-skye.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-04-15 02:25:47 EDT; 9min ago
   Duration: 35min 11.102s
    Process: 167310 ExecStart=/nix/store/sjl004ksn059xz9yfhj7haap24jv3s09-hm-setup-env /nix/store/swn5kp3grkkinwvy1sfxbxki22kg4h1x-home-manager-generation (code=exited, status=255/EXCEPTION)
   Main PID: 167310 (code=exited, status=255/EXCEPTION)
         IP: 0B in, 0B out
        CPU: 455ms

Apr 15 02:25:47 luna hm-activate-skye[167310]: No change so reusing latest profile generation 247
Apr 15 02:25:47 luna hm-activate-skye[167310]: Creating home file links in /home/skye
Apr 15 02:25:47 luna hm-activate-skye[167310]: Activating onFilesChange
Apr 15 02:25:47 luna hm-activate-skye[167310]: Activating reloadSystemd
Apr 15 02:25:47 luna hm-activate-skye[167310]: Activating stylixLookAndFeel
Apr 15 02:25:47 luna hm-activate-skye[167665]: An error occurred while attempting to set the Plasma wallpaper:
Apr 15 02:25:47 luna hm-activate-skye[167665]: The name is not activatable
Apr 15 02:25:47 luna systemd[1]: home-manager-skye.service: Main process exited, code=exited, status=255/EXCEPTION
Apr 15 02:25:47 luna systemd[1]: home-manager-skye.service: Failed with result 'exit-code'.
Apr 15 02:25:47 luna systemd[1]: Failed to start Home Manager environment for skye.
@trueNAHO trueNAHO added bug Something isn't working properly technical debt Things which should be cleaned up or improved labels Apr 15, 2024
@trueNAHO
Copy link
Collaborator

Related: #254

@danth
Copy link
Owner

danth commented Apr 17, 2024

This has been mentioned before, but I can't find the comment to link to it.

This happens because the plasma tools try to connect to a service running in the Plasma session to change the wallpaper.

When Plasma isn't installed, this is not a problem since we detect that the tools aren't there and don't try to run the command.

Possible fixes could be:

  • Ignore this error, and wait for the configuration to be activated during an active session. This may be problematic since the activation could always run before the session starts.
  • Move our usage of the Plasma tools to a separate SystemD unit or script, which is triggered only after Plasma starts. This would ensure the wallpaper is set correctly regardless of when the configuration as a whole is activated. However, this unit would exist even for people who don't use Plasma, since the KDE target is always active by default.

@rkuklik
Copy link
Contributor

rkuklik commented Sep 7, 2024

Hello, it is quite annoying for home-manager to crash on every start, so I would like to remedy this situation. What would you say, @danth, if I added option (an enum) to KDE module to choose either not fail if wallpaper can't be set or shove the activation to a user systemd unit, defaulting to the first?

pinarruiz pushed a commit to pinarruiz/stylix that referenced this issue Jan 4, 2025
…anth#708)

Replace the systemd unit with a more robust AutostartScript for theme
application during Plasma startup, ensuring D-Bus and session
availability without breaking Home Manager activation.

Closes: danth#340
Closes: danth#350
Closes: danth#422
Link: danth#708

Co-authored-by: rkuklik <[email protected]>
Tested-by: lordkekz <[email protected]>
Tested-by: rkuklik <[email protected]>
Reviewed-by: NAHO <[email protected]>
stylix-automation bot pushed a commit that referenced this issue Jan 4, 2025
…708)

Replace the systemd unit with a more robust AutostartScript for theme
application during Plasma startup, ensuring D-Bus and session
availability without breaking Home Manager activation.

Closes: #340
Closes: #350
Closes: #422
Link: #708

Co-authored-by: rkuklik <[email protected]>
Tested-by: lordkekz <[email protected]>
Tested-by: rkuklik <[email protected]>
Reviewed-by: NAHO <[email protected]>
(cherry picked from commit e0a41d3)
trueNAHO pushed a commit that referenced this issue Jan 4, 2025
…708)

Replace the systemd unit with a more robust AutostartScript for theme
application during Plasma startup, ensuring D-Bus and session
availability without breaking Home Manager activation.

Closes: #340
Closes: #350
Closes: #422
Link: #708

Co-authored-by: rkuklik <[email protected]>
Tested-by: lordkekz <[email protected]>
Tested-by: rkuklik <[email protected]>
Reviewed-by: NAHO <[email protected]>
(cherry picked from commit e0a41d3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly technical debt Things which should be cleaned up or improved
Projects
None yet
Development

No branches or pull requests

4 participants