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

[SOLVED] Exit Hyprland on NixOS always give me black screen #9475

Closed
rollschild opened this issue Feb 23, 2025 · 1 comment
Closed

[SOLVED] Exit Hyprland on NixOS always give me black screen #9475

rollschild opened this issue Feb 23, 2025 · 1 comment

Comments

@rollschild
Copy link

Hi,

I'm moving from Sway to Hyprland. I have KDE as well and sort of use it as "Display Manager", i.e. when my machine finishes booting up, a KDE login screen shows up with a few options on the bottom left corner: Sway, KDE, Hyprland (UWSM), etc. And that's how I log in to Sway or Hyprland.

And I'm using UWSM.

The problem is, I couldn't figure out a way to gracefully exit Hyprland and go back to the login page. I've tried every option on Hyprland wiki as well as UWSM wiki but none of them work. It always log me out altogether and give me a black empty screen with a cursor blinking. I couldn't do anything else other than force power off my machine.

Here is the config that's relevant:
home.nix:

wayland.windowManager.hyprland = {
    enable = true;
    # set the Hyprland and XDPH packages to null to use the ones from the NixOS module
    # package = null;
    # portalPackage = null;
    systemd = {
      # disable the systemd integration, as it conflicts with uwsm.
      enable = false;
      variables = [ "--all" ];
    };
}

configuration.nix:

# hyprland setup
  programs.uwsm = {
    enable = true;
    waylandCompositors = {
      hyprland = {
        prettyName = "Hyprland";
        comment = "Hyprland compositor managed by UWSM";
        binPath = "/run/current-system/sw/bin/Hyprland";
      };
    };
  };
  programs.hyprland.withUWSM = true;
  programs.hyprland.enable = true;

I don't believe I have other UWSM related configs anywhere else. I tried things like:
sleep 1; loginctl terminate-user $USER
loginctl terminate-user ""
but they all give me the black screen.

The only difference is hyprctl dispatch exit, which is dicouraged by Hyprland wiki, but it's the only command that can log me out back to the original graphical log in screen. However, when attempting to log back in, it gives me the black screen again so essentially no difference.

Please help. Thanks!

@rollschild rollschild changed the title Exit Hyprland on NixOS always give me black screen [SOLVED] Exit Hyprland on NixOS always give me black screen Feb 24, 2025
@rollschild
Copy link
Author

I solved this issue by:

  1. Add services.displayManager.sddm.wayland.enable = true; to my configuration.nix
  2. Change my exit script/command to uwsm stop

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

1 participant