summaryrefslogtreecommitdiff
path: root/programs/waybar
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-06-17 22:08:20 -0400
committerFreya Murphy <freya@freyacat.org>2025-06-17 22:08:20 -0400
commit640476ab01c501bbaa5b7854b561201bfe40d2ea (patch)
tree1516ebdda1180a910c4a7ff2e870058a936297e1 /programs/waybar
parentadd formatter (diff)
downloaddotfiles-nix-640476ab01c501bbaa5b7854b561201bfe40d2ea.tar.gz
dotfiles-nix-640476ab01c501bbaa5b7854b561201bfe40d2ea.tar.bz2
dotfiles-nix-640476ab01c501bbaa5b7854b561201bfe40d2ea.zip
fmt
Diffstat (limited to '')
-rw-r--r--programs/waybar/default.nix128
-rw-r--r--programs/waybar/style.nix175
2 files changed, 149 insertions, 154 deletions
diff --git a/programs/waybar/default.nix b/programs/waybar/default.nix
index 6e835fb..fe68cd7 100644
--- a/programs/waybar/default.nix
+++ b/programs/waybar/default.nix
@@ -1,80 +1,82 @@
-{ config, lib, ... }:
-
{
+ config,
+ lib,
+ ...
+}: {
home-manager.users.${config.user} = {
programs.waybar = {
-
enable = true;
- settings = [{
- height = 24;
- layer = "top";
- position = "top";
- spacing = 4;
+ settings = [
+ {
+ height = 24;
+ layer = "top";
+ position = "top";
+ spacing = 4;
- modules-left = [
- "hyprland/workspaces"
- ];
- modules-center = [
- "clock"
- ];
- modules-right = [
- "battery"
- "wireplumber"
- "network"
- "tray"
- ];
+ modules-left = [
+ "hyprland/workspaces"
+ ];
+ modules-center = [
+ "clock"
+ ];
+ modules-right = [
+ "battery"
+ "wireplumber"
+ "network"
+ "tray"
+ ];
- "hyprland/workspaces" = {
- disable-scroll = true;
- all-outputs = true;
- format = "{name}";
- };
-
- battery = {
- interval = 1;
- states = {
- warning = 30;
- critical = 15;
+ "hyprland/workspaces" = {
+ disable-scroll = true;
+ all-outputs = true;
+ format = "{name}";
};
- format = " {capacity}%";
- format-charging = " {capacity}%";
- format-plugged = " {capacity}%";
- format-full = " {capacity}%";
- format-warning = " {capacity}%";
- format-critical = " {capacity}%";
- };
- wireplumber = {
- format = " {volume}%";
- format-bluetooth = " {volume}%";
- format-muted = " muted";
- scroll-step = 1;
- on-click = "pavucontrol";
- ignored-sinks = ["Easy Effects Sink"];
- };
+ battery = {
+ interval = 1;
+ states = {
+ warning = 30;
+ critical = 15;
+ };
+ format = " {capacity}%";
+ format-charging = " {capacity}%";
+ format-plugged = " {capacity}%";
+ format-full = " {capacity}%";
+ format-warning = " {capacity}%";
+ format-critical = " {capacity}%";
+ };
- network = {
- format = " disconnected";
- format-wifi = " {essid}";
- format-ethernet = " {ipaddr}/{cidr}";
- format-disconnected = " disconnected";
- max-length = 50;
- on-click = "nm-connection-editor";
- };
+ wireplumber = {
+ format = " {volume}%";
+ format-bluetooth = " {volume}%";
+ format-muted = " muted";
+ scroll-step = 1;
+ on-click = "pavucontrol";
+ ignored-sinks = ["Easy Effects Sink"];
+ };
- clock = {
- interval = 1;
- format = "{:%Y-%m-%d %a %H:%M:%S}";
- };
+ network = {
+ format = " disconnected";
+ format-wifi = " {essid}";
+ format-ethernet = " {ipaddr}/{cidr}";
+ format-disconnected = " disconnected";
+ max-length = 50;
+ on-click = "nm-connection-editor";
+ };
- tray = {
- spacing = config.theme.outerGap;
- };
- }];
+ clock = {
+ interval = 1;
+ format = "{:%Y-%m-%d %a %H:%M:%S}";
+ };
+ tray = {
+ spacing = config.theme.outerGap;
+ };
+ }
+ ];
- style = import ./style.nix { theme = config.theme; };
+ style = import ./style.nix {theme = config.theme;};
};
};
}
diff --git a/programs/waybar/style.nix b/programs/waybar/style.nix
index 0b84514..33db673 100644
--- a/programs/waybar/style.nix
+++ b/programs/waybar/style.nix
@@ -1,115 +1,108 @@
-{ theme }:
+{theme}: let
+ fg = "#${theme.colors.fg}";
+ bg = "#${theme.colors.bg}";
+ surface-fg = "#${theme.colors.surface.fg}";
+ surface-bg = "#${theme.colors.surface.bg}";
+ primary = "#${theme.colors.primary}";
+ success = "#${theme.colors.success}";
+ warning = "#${theme.colors.warning}";
+ error = "#${theme.colors.error}";
+ fontSize = "${toString theme.font.size}px";
+ outerGap = "${toString theme.outerGap}px";
+ innerGap = "${toString theme.innerGap}px";
+ outerRadius = "${toString theme.outerRadius}px";
+ innerRadius = "${toString theme.innerRadius}px";
+ borderWidth = "${toString theme.borderWidth}px";
+in ''
+ /** Base */
-let
+ * {
+ all: unset;
+ }
- fg = "#${theme.colors.fg}";
- bg = "#${theme.colors.bg}";
- surface-fg = "#${theme.colors.surface.fg}";
- surface-bg = "#${theme.colors.surface.bg}";
- primary = "#${theme.colors.primary}";
- success = "#${theme.colors.success}";
- warning = "#${theme.colors.warning}";
- error = "#${theme.colors.error}";
- fontSize = "${toString theme.font.size}px";
- outerGap = "${toString theme.outerGap}px";
- innerGap = "${toString theme.innerGap}px";
- outerRadius = "${toString theme.outerRadius}px";
- innerRadius = "${toString theme.innerRadius}px";
- borderWidth = "${toString theme.borderWidth}px";
+ window#waybar {
+ font-family: "${theme.font.regular}", "${theme.font.icon}", "${theme.font.monospace}";
+ font-size: ${fontSize};
+ color: ${fg};
+ background-color: ${bg};
+ }
-in
+ /** Workspaces */
-''
-/** Base */
-
-* {
- all: unset;
-}
-
-window#waybar {
- font-family: "${theme.font.regular}", "${theme.font.icon}", "${theme.font.monospace}";
- font-size: ${fontSize};
- color: ${fg};
- background-color: ${bg};
-}
+ #workspaces {
+ margin-left: ${outerGap};
+ }
-/** Workspaces */
+ #workspaces button {
+ border-radius: ${innerRadius};
+ margin: 4px 2px;
+ padding: 0px 7px;
+ background: ${surface-bg};
+ color: ${surface-fg};
+ }
-#workspaces {
- margin-left: ${outerGap};
-}
+ #workspaces button.focused,
+ #workspaces button.active {
+ background: ${primary};
+ color: ${bg};
+ }
-#workspaces button {
- border-radius: ${innerRadius};
- margin: 4px 2px;
- padding: 0px 7px;
- background: ${surface-bg};
- color: ${surface-fg};
-}
+ #workspaces button.urgent {
+ background: ${error};
+ }
-#workspaces button.focused,
-#workspaces button.active {
- background: ${primary};
- color: ${bg};
-}
+ /** Tray */
-#workspaces button.urgent {
- background: ${error};
-}
+ #tray {
+ border: none;
+ margin-right: ${outerGap};
+ }
-/** Tray */
+ #tray > .passive {
+ -gtk-icon-effect: dim;
+ }
-#tray {
- border: none;
- margin-right: ${outerGap};
-}
+ #tray > .needs-attention {
+ -gtk-icon-effect: highlight;
+ }
-#tray > .passive {
- -gtk-icon-effect: dim;
-}
+ /** Right modules */
-#tray > .needs-attention {
- -gtk-icon-effect: highlight;
-}
+ #battery,
+ #wireplumber,
+ #network {
+ padding: 0 ${outerGap};
+ }
-/** Right modules */
+ /** Battery */
-#battery,
-#wireplumber,
-#network {
- padding: 0 ${outerGap};
-}
+ #battery.charging {
+ color: ${success};
+ }
-/** Battery */
+ #battery.warning:not(.charging) {
+ color: ${warning};
+ }
-#battery.charging {
- color: ${success};
-}
+ #battery.critical:not(.charging) {
+ color: ${error};
+ }
-#battery.warning:not(.charging) {
- color: ${warning};
-}
+ /** Wireplumber */
-#battery.critical:not(.charging) {
- color: ${error};
-}
+ #wireplumber.muted {
+ color: ${error};
+ }
-/** Wireplumber */
+ /** Network */
-#wireplumber.muted {
- color: ${error};
-}
+ #network.wifi,
+ #network.ethernet {
+ color: ${success};
+ }
-/** Network */
-
-#network.wifi,
-#network.ethernet {
- color: ${success};
-}
-
-#network.disconnected {
- color: ${error};
-}
+ #network.disconnected {
+ color: ${error};
+ }
''
-