SDDM gets black screen after logout from Hyprland UWSM

So basically i was using UWSM with hyprland for few days and i did not able to fix this issue whenever i try to logout i get stuck at SDDM’s black screen or SDDM does not come. Later i had to do TTY for restart. even using the command uwsm stop did not helped anything over hyprctl dispatch exit i just get black screen.
How did i have enabled? Here is the config. And please let me know about how i can fix it.

  # Hyprland.
  programs = {
    # waybar.enable = true;
    hyprland = {
      enable = true;
      xwayland.enable = true;
      withUWSM = true; 
      # package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    };
  };
{
  pkgs,
  lib,
  inputs,
  ...
}: {
  imports = [
    inputs.sddm-sugar-candy-nix.nixosModules.default
  ];
  nixpkgs = {
    overlays = [
      inputs.sddm-sugar-candy-nix.overlays.default
    ];
  };

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

  # Add this to ensure proper session management
  services.logind.extraConfig = ''
    HandlePowerKey=suspend
    HandleLidSwitch=suspend
  '';

  # SDDM
  services = {
    displayManager = {
      defaultSession = "hyprland-uwsm";
      sddm = {
        enable = true;
        enableHidpi = true;
        wayland.enable = true;
        settings = {
          General = {
            HaltCommand = "/run/current-system/sw/bin/systemctl poweroff";
            RebootCommand = "/run/current-system/sw/bin/systemctl reboot";
          };
          # If you had autologin settings, add them here too
        };
        extraPackages = with pkgs; [
          # SDDM Extra packages for the theme. #BUG: Will not work as the theme as qt5 in it.
          #          kdePackages.qtsvg
          #kdePackages.qt5compat
          #kdePackages.qtdeclarative
          #libsForQt5.qt5.qtgraphicaleffects

          # SDDM Extra packages for the theme.
          libsForQt5.qtgraphicaleffects
          libsForQt5.qt5.qtsvg
          libsForQt5.qt5ct
          libsForQt5.qtquickcontrols2
        ];

        # settings = {
        #   Autologin = {
        #     Session = "hyprland.desktop";
        #     User = "Linux-DADDY";
        #   };
        # };

        autoNumlock = true;
        sugarCandyNix = {
          enable = true;
          settings = {
            #Background = lib.cleanSource ./Lock_Screen_Pictures/Cloudsday.jpg;
            Background = lib.cleanSource ./Lock_Screen_Pictures/a_man_standing_in_a_dark_place_with_a_large_circle_of_light.jpg;

            ScreenWidth = 1920;
            ScreenHeight = 1080;
            FormPosition = "left";
            HaveFormBackground = true;
            PartialBlur = true;
            MainColor = "#cdd6f4";
            AccentColor = "#89dceb";
          };
        };
      };
    };
  };
}
1 Like

same issue, but new to hyprland. i’ve tried the same and loginctl terminate-session $x. I suspected uwsm but haven’t looked into it yet.

running uwsm stop avoids the sddm crash for me

For me it did not, And thank you for your response to me, And can i get your uwsm config about how you have set that up?

hello can i see your configuration.nix and are you on laptop or desktop

oh wow. i had this issue for like 2-3 weeks, and apparently no one’s using UWSM out here…

except im using greetd with tuigreet. so it must have something to do with the hyprland-uwsm.desktop session, right?

i just ragequit, honestly. i didnt even bother. i have deleted every login manager and i just log in from tty to hyprland UWSM with

uwsm start hyprland-uwsm.desktop

and i kill sessions with

loginctl kill-session $XDG_SESSION_ID

not sure if thats the correct way for wayland, though, but it works, yeah…

by the way im pretty sure you dont need to use programs.uwsm.enable at all, i mean, there is a programs.hyprland.withUWSM :crazy_face:

edit: im using flakes, so is hyprland

edit2: quickly after this, i fixed my issue: DO NOT set services.greetd.package, apparently it HAS to get its dependancies from other GUI frontends, EVEN IF one is to use tuigreet, which makes no sense, but it works

1 Like

Initially, I believed it was caused by SDDM; however, it appears the issue stems from uwsm.

i’m curious by the way about How can you ragequit when you chose to use nixos?

So I think you’re right. I will remove and test it later.

This the thing fixed the whole issue which i had for a week.
Thank you

2 Likes

This fixed the problem for me! Thanks!