default.nix (4172B)
1 { style, user, lib, ... }: 2 { 3 home-manager.users.${user} = { 4 wayland.windowManager.hyprland.settings.layerrule = [ 5 "blur on, ignore_alpha 0.19, match:namespace waybar" 6 ]; 7 8 programs.waybar = { 9 enable = true; 10 systemd.enable = true; 11 12 settings = { 13 mainBar = { 14 layer = "top"; 15 position = "top"; 16 margin-left = 10; 17 margin-right = 10; 18 margin-top = 10; 19 height = 44; 20 modules-left = [ 21 "hyprland/workspaces" 22 "hyprland/window" 23 ]; 24 modules-center = [ 25 "clock#date" 26 "clock" 27 "clock#utc" 28 ]; 29 modules-right = [ 30 "battery" 31 "cpu" 32 "memory" 33 "custom/disk" 34 "tray" 35 ]; 36 "hyprland/workspaces" = { 37 format = "{name}"; 38 on-click = "activate"; 39 sort-by = "number"; 40 }; 41 "clock#date" = { 42 interval = 1; 43 format = " {:%a, %b %d}"; 44 }; 45 clock = { 46 interval = 1; 47 format = " {:%I:%M:%S %p}"; 48 }; 49 "clock#utc" = { 50 interval = 1; 51 format = " {:%I:%M:%S %p}"; 52 timezone = "UTC"; 53 }; 54 cpu = { 55 interval = 1; 56 format = " {usage}% {max_frequency:.1f} GHz, "; 57 }; 58 memory = { 59 interval = 1; 60 format = "{used:.1f}/{total:.1f} GiB"; 61 }; 62 "custom/disk" = { 63 interval = 1; 64 format = " {}%"; 65 exec = "zpool get -Hpovalue capacity system"; 66 }; 67 battery = { 68 bat = lib.mkDefault "BAT0"; 69 interval = 1; 70 states = { 71 warning = 20; 72 critical = 10; 73 }; 74 format = "{icon} {capacity}%"; 75 format-icons = { 76 default = [ 77 " " 78 " " 79 " " 80 " " 81 " " 82 ]; 83 charging = [ 84 " " 85 " " 86 " " 87 " " 88 " " 89 ]; 90 }; 91 tooltip-format = "{timeTo}"; 92 }; 93 tray = { 94 icon-size = 18; 95 spacing = 10; 96 }; 97 }; 98 }; 99 100 style = '' 101 * { 102 border: none; 103 font-family: ${style.fonts.mono.family}; 104 font-size: 12pt; 105 } 106 107 box.module { 108 margin: 10px; 109 } 110 111 window#waybar { 112 border: none; 113 border-radius: 10px; 114 color: #${style.colors.fg.hex}; 115 background: ${style.colors.bg.rgba}; 116 } 117 118 .modules-right > widget > *, #window { 119 padding: 0 10px; 120 } 121 122 .modules-center > widget > * { 123 padding: 0 10px; 124 } 125 126 #tray { 127 padding: 0; 128 padding-right: 10px; 129 } 130 131 #workspaces box { 132 min-height: 5px; 133 } 134 135 #workspaces button, #workspaces button:hover, #workspaces button.active, #workspaces button.empty { 136 box-shadow: inherit; 137 text-shadow: inherit; 138 background: transparent; 139 padding: 0 5px; 140 } 141 142 #workspaces button label { 143 color: #${style.colors.fg.hex}; 144 transition: background 0.1s linear; 145 border-radius: 50%; 146 min-height: 24px; 147 min-width: 24px; 148 border-radius: 50%; 149 } 150 151 #workspaces button:hover label { 152 background: #${style.colors.fg.hex}; 153 color: #${style.colors.bg.hex}; 154 } 155 156 #workspaces button.active label { 157 background: #${style.colors.fg.hex}; 158 color: #${style.colors.bg.hex}; 159 } 160 161 #workspaces button.empty label { 162 color: #${style.colors.lo.hex}; 163 } 164 165 #cpu { 166 padding-right: 0; 167 } 168 169 #memory { 170 padding-left: 0; 171 } 172 ''; 173 }; 174 }; 175 }