danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
902 stars 105 forks source link

nixOS KDE plasma stylix breaks emojis in notifications #448

Open Yeshey opened 6 days ago

Yeshey commented 6 days 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. Screenshot_20240622_212552 The bug can also be seen in the WIN + V window with the clipboard history, everything else, the emoji picker, fonts in the terminal etc. is working, so i believe it's a plasma specific issue

Steps To Reproduce

I have stylix installed just as a home manager module

  imports = [
    inputs.stylix.homeManagerModules.stylix
  ];

My stylix config

    stylix = {
      enable = lib.mkOverride 1010 true;
      autoEnable = lib.mkOverride 1010 true;
      base16Scheme = "${pkgs.base16-schemes}/share/themes/pop.yaml";
      image = builtins.fetchurl {
           url = "https://images6.alphacoders.com/655/655990.jpg";
           sha256 = "b09b411a9c7fc7dc5be312ca9e4e4b8ee354358daa792381f207c9f4946d95fe";
        };
      polarity = lib.mkOverride 1010 "dark";

      cursor = cfg.cursor;

      opacity = {
        applications = lib.mkOverride 1010 0.88;
        terminal = lib.mkOverride 1010 0.88;
        desktop = lib.mkOverride 1010 0.88;
        popups = lib.mkOverride 1010 0.88;
      };
    };

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

It's not a nixOS problem, its a stylix problem, as the first issue I made was a nixpkgs one: https://github.com/NixOS/nixpkgs/issues/321826

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.

trueNAHO commented 5 days ago

Related: https://github.com/danth/stylix/pull/201

danth commented 3 days ago

As pointed out in the linked issue: this is probably caused by not having the emoji font as a fallback under sans-serif.

Yeshey commented 3 days ago

As pointed out in the linked issue: this is probably caused by not having the emoji font as a fallback under sans-serif.

I tried to explicitly define fonts:

stylix.fonts = {
        /*
        sizes = {
          applications = 10;
          terminal = 12;
          desktop = 10;
          popups = 9;
        }; */

        serif = {
          package = pkgs.dejavu_fonts;
          name = "DejaVu Serif";
        };

        monospace = {
          package = pkgs.nerdfonts;
          name = "Fira Code nerd Font Mono";
        };

        sansSerif = {
          package = pkgs.dejavu_fonts;
          name = "DejaVu Sans";
        };

        emoji = {
          package = pkgs.noto-fonts-emoji;
          name = "Noto Color Emoji";
        };
      }; 

but the problem persisted, my workaround above is still needed. But maybe this issue should be closed in favour of that mencioned above?

danth commented 3 days ago

In extension to #201, we should also automatically include the emoji font as a fallback to fix this issue - so some more changes are needed.