Jump to content

Waybar: Difference between revisions

From Official NixOS Wiki
34j (talk | contribs)
34j (talk | contribs)
mNo edit summary
 
Line 33: Line 33:
=== Icon Fonts Missing ===
=== Icon Fonts Missing ===


The default configuration uses <code>FontAwesome</code> font, which is only available in {{nixos:package|font-awesome_4}}, not in {{nixos:package|font-awesome}}, {{nixos:package|font-awesome_6}}, etc.  
The default configuration uses <code>FontAwesome</code> font, which is only available in {{nixos:package|font-awesome_4}}, not in {{nixos:package|font-awesome}}, {{nixos:package|font-awesome_6}}, {{nixos:package|font-awesome_5}}, etc.  


You may simply install {{nixos:package|font-awesome_4}}
You may simply install {{nixos:package|font-awesome_4}}


{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
  fonts.packages = with pkgs; [
fonts.packages = with pkgs; [
    font-awesome_4
  font-awesome_4
  ];
];
}}
}}


or edit <code>style.css</code> to use your prefered font:
or edit <code>style.css</code> to use your prefered font (e.g. {{nixos:package|font-awesome}}):


{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
  fonts.packages = with pkgs; [
fonts.packages = with pkgs; [
    font-awesome
  font-awesome
  ];
];
}}
}}



Latest revision as of 07:37, 27 February 2026

Waybar is a highly customizable Wayland bar.

Installation

Waybar can be installed from both configuration.nix and Home Manager:

❄︎ /etc/nixos/configuration.nix or ~/.config/home-manager/home.nix
programs.waybar.enable = true;

Configuration

Waybar can be configured using options found on the Home Manager Appendix. You can also find configuration options under home-manager/options/programs/waybar on mynixos.

❄︎ ~/.config/home-manager/home.nix
programs.waybar.settings.main = {
  modules-right = ["clock"];
};
# programs.waybar.style = "";

Alternatively, you may configure using JSONC (and CSS) file(s) by:

❄︎ ~/.config/home-manager/home.nix
xdg.configFile."waybar/config.jsonc".source = ./waybar/config.jsonc;
# xdg.configFile."waybar/style.css".source = ./waybar/style.css;

Please refer to the default configuration (config.jsonc and style.css) and wiki for further information on configuration.

Troubleshooting

Icon Fonts Missing

The default configuration uses FontAwesome font, which is only available in font-awesome_4, not in font-awesome, font-awesome_6, font-awesome_5, etc.

You may simply install font-awesome_4

❄︎ /etc/nixos/configuration.nix
fonts.packages = with pkgs; [
  font-awesome_4
];

or edit style.css to use your prefered font (e.g. font-awesome):

❄︎ /etc/nixos/configuration.nix
fonts.packages = with pkgs; [
  font-awesome
];
≡︎ style.css
* {
    /* `otf-font-awesome` is required to be installed for icons */
-     font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
+     font-family: Roboto, Helvetica, Arial, sans-serif, "Font Awesome 7 Free";
    font-size: 13px;
}