NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.65k stars 13.8k forks source link

nixOS KDE plasma emojis missing in notifications #321826

Closed Yeshey closed 3 months ago

Yeshey commented 3 months ago

Describe the bug

Screenshot_20240622_204926 It's not all emojis that are missing, it's the equivalent of this issue in stack exchange.

Steps To Reproduce

Install plasma 6, in my case:

    services = {
      xserver.enable = lib.mkOverride 1010 true; # Enable the X11 windowing system.
      displayManager = {
        autoLogin.enable = lib.mkOverride 1010 true;
        autoLogin.user = lib.mkOverride 1010 "${config.mySystem.user}"; # TODO
        sddm = {
            wayland.enable = true;
          enable = lib.mkOverride 1010 true;
        };
        defaultSession = lib.mkOverride 1010 "plasma"; # "none+bspwm" or "plasma"
      };
      desktopManager.plasma6 = {
        enable = lib.mkOverride 1010 true;
        enableQt5Integration = true;
        # supportDDC = true; # doesnt work with nvidia # to support changing brightness for external monitors (https://discourse.nixos.org/t/how-to-enable-ddc-brightness-control-i2c-permissions/20800)
      };
      # windowManager.bspwm.enable = true; # but doesn't work
    };
    environment.systemPackages = with pkgs; [
      # FOR PLASMA DESKTOP
      sddm-kcm # for sddm configuration in settings
    ];

If needed, here is my config.

Expected behavior

Screenshot_20240622_204426

Workaround

Following this thread, as a workaround we can use the file Kubuntu uses, putting the file 56-kubuntu-noto.conf attached below in ~/.config/fontconfig/conf.d/. FILE ATTACHED: 56-kubuntu-noto.txt, change the name to 56-kubuntu-noto.conf.

Or use this home manager configuration:

home.file.".config/fontconfig/conf.d/56-kubuntu-noto.conf".source = ./56-kubuntu-noto.conf; # point to the file

Additional context

I don't know if nixOS is interested in delivering a custom desktop environment experience or just the default experience, if not, maybe a option could be provided? In either case having this issue might help someone that has a similar problem.

Notify maintainers

@K900 @oxalica @SuperSandro2000

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32, NixOS, 24.05 (Uakari), 24.05.20240606.9b5328b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-23.11, nixpkgs"`
 - channels(yeshey): `""`
 - nixpkgs: `/etc/nix/path/nixpkgs`

Add a :+1: reaction to issues you find important.

oxalica commented 3 months ago

Could not reproduce by notify-send -u critical '😄'. It prompts with emoji rendered (though in monochrome). Is emoji in other programs rendered as tofu (boxes as in your screenshot) for you, or is it just in notifications?

Install plasma 6, in my case:

I don't see any font installed in your code fragment. I don't think any fonts including emojis are installed by default since they are usually quite big in size.

Eg. To install Noto Fonts Color Emoji font, add fonts.packages = [ pkgs.noto-fonts-color-emoji ]; in your NixOS configuration.

Yeshey commented 3 months ago

Could not reproduce by notify-send -u critical '😄'. It prompts with emoji rendered (though in monochrome). Is emoji in other programs rendered as tofu (boxes as in your screenshot) for you, or is it just in notifications?

Install plasma 6, in my case:

I don't see any font installed in your code fragment. I don't think any fonts including emojis are installed by default since they are usually quite big in size.

Eg. To install Noto Fonts Color Emoji font, add fonts.packages = [ pkgs.noto-fonts-color-emoji ]; in your NixOS configuration.

yeah, some emojis do show, that one does in monochrome Screenshot_20240622_212552 can you try display 👋 or 👋🏽?

I believe I have the fonts installed, I did try to mess around with the fonts before making the issue, I'll try your font package suggestion and report back

The only other place where I notice the problem and the workaround took effect was the WIN + V window with the clipboard history, everything else, the emoji picker, fonts in the terminal etc. is working, so i believeit's a plasma specific issue

Yeshey commented 3 months ago

@oxalica, using:

    environment.systemPackages = with pkgs; [
      noto-fonts-color-emoji
    ];

    fonts.packages = with pkgs; [
      noto-fonts-color-emoji
    ];

didn't help

according to here its a Qt bug, so either nixOS waits for that to get fixed or patches it in the meantime, I believe

oxalica commented 3 months ago

can you try display 👋 or 👋🏽?

It's also working.

image

according to here its a Qt bug

That explains why it's monochrome instead of colorful ones. But it seems your issue is that they do not render at all, which seems to be a font selection issue.

Could you try also explicitly specifying a default emoji font by fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" ]; ?

Yeshey commented 3 months ago

can you try display 👋 or 👋🏽?

It's also working.

image

according to here its a Qt bug

That explains why it's monochrome instead of colorful ones. But it seems your issue is that they do not render at all, which seems to be a font selection issue.

Could you try also explicitly specifying a default emoji font by fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" ]; ?

oh ok, it's a problem with my config, I should have guessed 😆 Immediately disabling my fonts configuration doesn't seem to get rid of the problem. I'll try to remove parts of my configuration and pin down the problem and report back

adding fonts,fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" ]; didnt help

    environment.systemPackages = with pkgs; [
      noto-fonts-color-emoji
    ];

    fonts.packages = with pkgs; [
      noto-fonts-color-emoji
    ];

    fonts.fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" ];
Yeshey commented 3 months ago

thank you @oxalica, it's a problem with stylix. I'll make an issue over there, thanks a lot for everything 👍

IzumiRaine commented 3 months ago

I had the same problem since upgrading to 24.05, and it seems the underlying issue for me was that there was no emoji fallback font in fontconfig.defaultFonts.sansSerif etc.

With settings like this it works now (similar for .serif and .monospace):

fontconfig.defaultFonts.sansSerif = [
        "Noto Sans"
        "Noto Color Emoji"
        "Noto Color Emoji"
];