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