GithubHelp home page GithubHelp logo

waybar support broken(?) about stylix HOT 5 OPEN

tbaumann avatar tbaumann commented on August 26, 2024
waybar support broken(?)

from stylix.

Comments (5)

danth avatar danth commented on August 26, 2024

Strange; I can't see any obvious issues.

from stylix.

tbaumann avatar tbaumann commented on August 26, 2024

You can see in th git repo that I changed the way the bars were defined. My syntax may have been a bit older.
But either way it made no difference.

from stylix.

Sporesirius avatar Sporesirius commented on August 26, 2024

Hi, I have encountered the same problem, and it also affects other programs such as hyprland, yazi, dunst, and btop.

EDIT: I believe I have identified the issue. I have Home Manager set up as standalone, and I only configured the theme, fonts, etc., on the host side but not on the HM side. I assumed I could set up the theme, fonts, and cursor on the host, and the specific programs would inherit these settings from HM.

Here's how I configured the NixOS host:

  stylix = {
    enable = true;
    polarity = "dark";
    base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml";
    image = /.../screenshots/a_cartoon_of_a_woman_with_flowers_in_her_hair.jpg;
    cursor = {
      package = pkgs.bibata-cursors;
      name = "Bibata-Modern-Ice";
      size = 16;
    };
    fonts = {
        serif = {
          package = pkgs.dejavu_fonts;
          name = "DejaVu Serif";
        };
        sansSerif = {
          package = pkgs.dejavu_fonts;
          name = "DejaVu Sans";
        };
        monospace = {
          package = pkgs.nerdfonts.override {fonts = ["FiraCode"];};
          name = "FiraCode Nerd Font Mono";
        };
        emoji = {
          package = pkgs.noto-fonts-emoji;
          name = "Noto Color Emoji";
        };
      };
  };

Initially, I thought this was sufficient because of stylix.homeManagerIntegration.autoImport and stylix.homeManagerIntegration.followSystem, but I didn't get any themes or fonts applied to the programs managed by HM. Therefore, I added the following configuration in HM:

  stylix.targets.waybar.enable = true;
  stylix.targets.waybar.enableCenterBackColors = true;
  stylix.targets.waybar.enableLeftBackColors = true;
  stylix.targets.waybar.enableRightBackColors = true;

  stylix.targets.dunst.enable = true;
  stylix.targets.btop.enable = true;
  stylix.targets.yazi.enable = true;
  stylix.targets.vesktop.enable = true;
  stylix.targets.fish.enable = true;
  stylix.targets.wezterm.enable = true;
  stylix.targets.rofi.enable  = true;

  stylix.targets.gtk.enable = true;

However, this still didn't work. I wondered if I also needed to set stylix.enable = true; in HM. This resulted in a "stylix.image missing" error message, so I added my entire Stylix configuration from the NixOS host side to HM as well. This resolved the issue, but I suspect this approach might not be correct?

Also, this is my flake.nix:

{
  description = "My NixOS system configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    hardware.url = "github:nixos/nixos-hardware";
    systems.url = "github:nix-systems/default-linux";

    impermanence.url = "github:nix-community/impermanence";
    stylix.url = "github:danth/stylix";
    sops-nix = {
      url = "github:mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    self,
    nixpkgs,
    home-manager,
    systems,
    ...
  } @inputs: let
    inherit (self) outputs;
    lib = nixpkgs.lib // home-manager.lib;
    forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
    pkgsFor = lib.genAttrs (import systems) (
      system:
        import nixpkgs {
          inherit system;
        }
    );
  in {
      inherit lib;
      nixosModules = import ./modules/nixos;
      homeManagerModules = import ./modules/home-manager;

      overlays = import ./overlays {inherit inputs outputs;};

      packages = forEachSystem (pkgs: import ./pkgs {inherit pkgs;});
      devShells = forEachSystem (pkgs: import ./shell.nix {inherit pkgs;});

      nixosConfigurations = {
        # Main desktop
        blackeye =  lib.nixosSystem {
          modules = [
            inputs.stylix.nixosModules.stylix
            ./hosts/blackeye
          ];
          specialArgs = {
            inherit inputs outputs;
          };
        };
      };

      homeConfigurations = {
        "jk@blackeye" = lib.homeManagerConfiguration {
          modules = [
            inputs.stylix.homeManagerModules.stylix
            ./home/jk/blackeye.nix
          ];
          pkgs = pkgsFor.x86_64-linux;
          extraSpecialArgs = {
            inherit inputs outputs;
          };
        };
      };
    };
}

from stylix.

trueNAHO avatar trueNAHO commented on August 26, 2024

Potentially related: #400 (comment)

from stylix.

UnknownHiker avatar UnknownHiker commented on August 26, 2024

Im having similar issues, but its especially weird because, in KDE (X11) mostly everything (also Home-Manager defined programs) gets nicely themed, and when i switch to a Hyprland Session, even the programs that have been themed before, dont get themed anymore. So i feel its a Wayland- or Hyprland-specific issue, because Home Manager actually is able to inherit the Stylix Settings from the Nix Configuration.

If you need any configs, logs, screenshots for further analysis, id be glad to help.

UPDATE: So apparently the Styling only works when using the Home Manager Module for the Program.
Now, waybar and rofi are getting styled.

But there are still some Programs, like Krusader, Dolphin and LF that are getting styled in KDE but not in Hyprland.
LF is also defined as a Home Manage module, so i cant really tell, where exactly the Problem is.

Edit: The following workaround seems to fix dark theme of specific apps, but it breaks the Plasma Desktop session (blackscreen), so i disabled it again:

Part of home.nix

gtk = {
  iconTheme = {
    name = "Papirus-Dark";
    package = pkgs.papirus-icon-theme;
  };
  gtk3.extraConfig = {
    gtk-application-prefer-dark-theme = 1;
  };
  gtk4.extraConfig = {
    gtk-application-prefer-dark-theme = 1;
  };
};
qt = {
  enable = true;
  style.name = "adw-gtk3-dark";
  platformTheme.name = "gtk3";
};

from stylix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.