me like nix
0

Configure Feed

Select the types of activity you want to include in your feed.

use nix for waybar

author
Sean Aye
date (Aug 30, 2025, 10:19 PM -0400) commit 522c15d4 parent 97605532 change-id wkzltspo
+469 -210
+212 -3
hosts/common/home.nix
··· 132 132 "libsoup-2.74.3" 133 133 ]; 134 134 135 - xdg.configFile."waybar/config.jsonc".source = ./waybar/config.jsonc; 136 135 programs.waybar = { 137 136 enable = true; 138 - 139 - style = builtins.readFile ./waybar/style.css; 137 + settings = { 138 + mainBar = { 139 + height = 8; 140 + spacing = 0; 141 + 142 + modules-left = [ 143 + "sway/workspaces" 144 + "sway/mode" 145 + "sway/scratchpad" 146 + "custom/media" 147 + ]; 148 + 149 + modules-center = [ 150 + "sway/window" 151 + ]; 152 + 153 + modules-right = [ 154 + "mpd" 155 + "pulseaudio" 156 + "network" 157 + "power-profiles-daemon" 158 + "cpu" 159 + "memory" 160 + "temperature" 161 + "backlight" 162 + "sway/language" 163 + "battery" 164 + "battery#bat2" 165 + "clock" 166 + "custom/power" 167 + ]; 168 + 169 + "keyboard-state" = { 170 + numlock = true; 171 + capslock = true; 172 + format = "{name} {icon}"; 173 + format-icons = { 174 + locked = " "; 175 + unlocked = " "; 176 + }; 177 + }; 178 + 179 + "sway/mode" = { 180 + format = "<span style=\"italic\">{}</span>"; 181 + }; 182 + 183 + "sway/scratchpad" = { 184 + format = "{icon} {count}"; 185 + show-empty = false; 186 + format-icons = [ "" "" ]; 187 + tooltip = true; 188 + tooltip-format = "{app}: {title}"; 189 + }; 190 + 191 + mpd = { 192 + format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% "; 193 + format-disconnected = "Disconnected "; 194 + format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped "; 195 + unknown-tag = "N/A"; 196 + interval = 5; 197 + consume-icons = { 198 + on = " "; 199 + }; 200 + random-icons = { 201 + off = "<span color=\"#f53c3c\"></span> "; 202 + on = " "; 203 + }; 204 + repeat-icons = { 205 + on = " "; 206 + }; 207 + single-icons = { 208 + on = "1 "; 209 + }; 210 + state-icons = { 211 + paused = ""; 212 + playing = ""; 213 + }; 214 + tooltip-format = "MPD (connected)"; 215 + tooltip-format-disconnected = "MPD (disconnected)"; 216 + }; 217 + 218 + idle_inhibitor = { 219 + format = "{icon}"; 220 + format-icons = { 221 + activated = ""; 222 + deactivated = ""; 223 + }; 224 + }; 225 + 226 + tray = { 227 + spacing = 10; 228 + }; 229 + 230 + clock = { 231 + tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; 232 + format-alt = "{:%Y-%m-%d}"; 233 + }; 234 + 235 + cpu = { 236 + format = "{usage}% "; 237 + tooltip = false; 238 + }; 239 + 240 + memory = { 241 + format = "{}% "; 242 + }; 243 + 244 + temperature = { 245 + critical-threshold = 80; 246 + format = "{temperatureC}°C {icon}"; 247 + format-icons = [ "" "" "" ]; 248 + }; 249 + 250 + backlight = { 251 + format = "{percent}% {icon}"; 252 + format-icons = [ 253 + "" 254 + "" 255 + "" 256 + "" 257 + "" 258 + "" 259 + "" 260 + "" 261 + "" 262 + ]; 263 + }; 264 + 265 + battery = { 266 + states = { 267 + warning = 30; 268 + critical = 15; 269 + }; 270 + format = "{capacity}% {icon}"; 271 + format-full = "{capacity}% {icon}"; 272 + format-charging = "{capacity}% "; 273 + format-plugged = "{capacity}% "; 274 + format-alt = "{time} {icon}"; 275 + format-icons = [ "" "" "" "" "" ]; 276 + }; 277 + 278 + "battery#bat2" = { 279 + bat = "BAT2"; 280 + }; 281 + 282 + "power-profiles-daemon" = { 283 + format = "{icon}"; 284 + tooltip-format = "Power profile: {profile}\nDriver: {driver}"; 285 + tooltip = true; 286 + format-icons = { 287 + default = ""; 288 + performance = ""; 289 + balanced = " "; 290 + power-saver = " "; 291 + }; 292 + }; 293 + 294 + network = { 295 + format-wifi = "{essid} ({signalStrength}%) "; 296 + format-ethernet = "{ipaddr}/{cidr} "; 297 + tooltip-format = "{ifname} via {gwaddr} "; 298 + format-linked = "{ifname} (No IP) "; 299 + format-disconnected = "Disconnected ⚠"; 300 + format-alt = "{ifname}: {ipaddr}/{cidr}"; 301 + }; 302 + 303 + pulseaudio = { 304 + format = "{volume}% {icon} {format_source}"; 305 + format-bluetooth = "{volume}% {icon} {format_source}"; 306 + format-bluetooth-muted = " {icon} {format_source}"; 307 + format-muted = " {format_source}"; 308 + format-source = "{volume}% "; 309 + format-source-muted = " "; 310 + format-icons = { 311 + headphone = ""; 312 + hands-free = ""; 313 + headset = ""; 314 + phone = ""; 315 + portable = ""; 316 + car = ""; 317 + default = [ "" " " " " ]; 318 + }; 319 + on-click = "pavucontrol"; 320 + }; 321 + 322 + "custom/media" = { 323 + format = "{icon} {text}"; 324 + return-type = "json"; 325 + max-length = 40; 326 + format-icons = { 327 + spotify = " "; 328 + default = "🎜 "; 329 + }; 330 + escape = true; 331 + exec = "$HOME/.config/waybar/mediaplayer.py 2> /dev/null"; 332 + }; 333 + 334 + "custom/power" = { 335 + format = "⏻ "; 336 + tooltip = false; 337 + menu = "on-click"; 338 + menu-file = "${./waybar/power_menu.xml}"; 339 + menu-actions = { 340 + shutdown = "shutdown"; 341 + reboot = "reboot"; 342 + suspend = "systemctl suspend"; 343 + hibernate = "systemctl hibernate"; 344 + }; 345 + }; 346 + }; 347 + }; 348 + # style = builtins.readFile ./waybar/style.css; 140 349 }; 141 350 142 351 programs.ssh = {
+229 -207
hosts/common/waybar/config.jsonc
··· 1 1 // -*- mode: jsonc -*- 2 2 { 3 - // "layer": "top", // Waybar at top layer 4 - // "position": "bottom", // Waybar position (top|bottom|left|right) 5 - "height": 8, // Waybar height (to be removed for auto height) 6 - // "width": 1280, // Waybar width 7 - "spacing": 0, // Gaps between modules (4px) 8 - // Choose the order of the modules 9 - "modules-left": [ 10 - "sway/workspaces", 11 - "sway/mode", 12 - "sway/scratchpad", 13 - "custom/media" 14 - ], 15 - "modules-center": [ 16 - "sway/window" 17 - ], 18 - "modules-right": [ 19 - "mpd", 20 - // "idle_inhibitor", 21 - "pulseaudio", 22 - "network", 23 - "power-profiles-daemon", 24 - "cpu", 25 - "memory", 26 - "temperature", 27 - "backlight", 28 - // "keyboard-state", 29 - "sway/language", 30 - "battery", 31 - "battery#bat2", 32 - "clock", 33 - "tray", 34 - "custom/power" 3 + // "layer": "top", // Waybar at top layer 4 + // "position": "bottom", // Waybar position (top|bottom|left|right) 5 + "height": 8, // Waybar height (to be removed for auto height) 6 + // "width": 1280, // Waybar width 7 + "spacing": 0, // Gaps between modules (4px) 8 + // Choose the order of the modules 9 + "modules-left": [ 10 + "sway/workspaces", 11 + "sway/mode", 12 + "sway/scratchpad", 13 + "custom/media" 14 + ], 15 + "modules-center": [ 16 + "sway/window" 17 + ], 18 + "modules-right": [ 19 + "mpd", 20 + // "idle_inhibitor", 21 + "pulseaudio", 22 + "network", 23 + "power-profiles-daemon", 24 + "cpu", 25 + "memory", 26 + "temperature", 27 + "backlight", 28 + // "keyboard-state", 29 + "sway/language", 30 + "battery", 31 + "battery#bat2", 32 + "clock", 33 + "custom/power" 34 + ], 35 + // Modules configuration 36 + // "sway/workspaces": { 37 + // "disable-scroll": true, 38 + // "all-outputs": true, 39 + // "warp-on-scroll": false, 40 + // "format": "{name}: {icon}", 41 + // "format-icons": { 42 + // "1": "", 43 + // "2": "", 44 + // "3": "", 45 + // "4": "", 46 + // "5": "", 47 + // "urgent": "", 48 + // "focused": "", 49 + // "default": "" 50 + // } 51 + // }, 52 + "keyboard-state": { 53 + "numlock": true, 54 + "capslock": true, 55 + "format": "{name} {icon}", 56 + "format-icons": { 57 + "locked": " ", 58 + "unlocked": " " 59 + } 60 + }, 61 + "sway/mode": { 62 + "format": "<span style=\"italic\">{}</span>" 63 + }, 64 + "sway/scratchpad": { 65 + "format": "{icon} {count}", 66 + "show-empty": false, 67 + "format-icons": [ 68 + "", 69 + "" 35 70 ], 36 - // Modules configuration 37 - // "sway/workspaces": { 38 - // "disable-scroll": true, 39 - // "all-outputs": true, 40 - // "warp-on-scroll": false, 41 - // "format": "{name}: {icon}", 42 - // "format-icons": { 43 - // "1": "", 44 - // "2": "", 45 - // "3": "", 46 - // "4": "", 47 - // "5": "", 48 - // "urgent": "", 49 - // "focused": "", 50 - // "default": "" 51 - // } 52 - // }, 53 - "keyboard-state": { 54 - "numlock": true, 55 - "capslock": true, 56 - "format": "{name} {icon}", 57 - "format-icons": { 58 - "locked": " ", 59 - "unlocked": " " 60 - } 71 + "tooltip": true, 72 + "tooltip-format": "{app}: {title}" 73 + }, 74 + "mpd": { 75 + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", 76 + "format-disconnected": "Disconnected ", 77 + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", 78 + "unknown-tag": "N/A", 79 + "interval": 5, 80 + "consume-icons": { 81 + "on": " " 61 82 }, 62 - "sway/mode": { 63 - "format": "<span style=\"italic\">{}</span>" 64 - }, 65 - "sway/scratchpad": { 66 - "format": "{icon} {count}", 67 - "show-empty": false, 68 - "format-icons": ["", ""], 69 - "tooltip": true, 70 - "tooltip-format": "{app}: {title}" 83 + "random-icons": { 84 + "off": "<span color=\"#f53c3c\"></span> ", 85 + "on": " " 71 86 }, 72 - "mpd": { 73 - "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", 74 - "format-disconnected": "Disconnected ", 75 - "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", 76 - "unknown-tag": "N/A", 77 - "interval": 5, 78 - "consume-icons": { 79 - "on": " " 80 - }, 81 - "random-icons": { 82 - "off": "<span color=\"#f53c3c\"></span> ", 83 - "on": " " 84 - }, 85 - "repeat-icons": { 86 - "on": " " 87 - }, 88 - "single-icons": { 89 - "on": "1 " 90 - }, 91 - "state-icons": { 92 - "paused": "", 93 - "playing": "" 94 - }, 95 - "tooltip-format": "MPD (connected)", 96 - "tooltip-format-disconnected": "MPD (disconnected)" 97 - }, 98 - "idle_inhibitor": { 99 - "format": "{icon}", 100 - "format-icons": { 101 - "activated": "", 102 - "deactivated": "" 103 - } 104 - }, 105 - "tray": { 106 - // "icon-size": 21, 107 - "spacing": 10, 108 - // "icons": { 109 - // "blueman": "bluetooth", 110 - // "TelegramDesktop": "$HOME/.local/share/icons/hicolor/16x16/apps/telegram.png" 111 - // } 112 - }, 113 - "clock": { 114 - // "timezone": "America/New_York", 115 - "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", 116 - "format-alt": "{:%Y-%m-%d}" 117 - }, 118 - "cpu": { 119 - "format": "{usage}%  ", 120 - "tooltip": false 121 - }, 122 - "memory": { 123 - "format": "{}%  " 124 - }, 125 - "temperature": { 126 - // "thermal-zone": 2, 127 - // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", 128 - "critical-threshold": 80, 129 - // "format-critical": "{temperatureC}°C {icon}", 130 - "format": "{temperatureC}°C {icon}", 131 - "format-icons": ["", "", ""] 132 - }, 133 - "backlight": { 134 - // "device": "acpi_video1", 135 - "format": "{percent}% {icon}", 136 - "format-icons": ["", "", "", "", "", "", "", "", ""] 137 - }, 138 - "battery": { 139 - "states": { 140 - // "good": 95, 141 - "warning": 30, 142 - "critical": 15 143 - }, 144 - "format": "{capacity}% {icon}", 145 - "format-full": "{capacity}% {icon}", 146 - "format-charging": "{capacity}% ", 147 - "format-plugged": "{capacity}% ", 148 - "format-alt": "{time} {icon}", 149 - // "format-good": "", // An empty format will hide the module 150 - // "format-full": "", 151 - "format-icons": ["", "", "", "", ""] 87 + "repeat-icons": { 88 + "on": " " 152 89 }, 153 - "battery#bat2": { 154 - "bat": "BAT2" 90 + "single-icons": { 91 + "on": "1 " 155 92 }, 156 - "power-profiles-daemon": { 157 - "format": "{icon}", 158 - "tooltip-format": "Power profile: {profile}\nDriver: {driver}", 159 - "tooltip": true, 160 - "format-icons": { 161 - "default": "", 162 - "performance": "", 163 - "balanced": " ", 164 - "power-saver": " " 165 - } 93 + "state-icons": { 94 + "paused": "", 95 + "playing": "" 166 96 }, 167 - "network": { 168 - // "interface": "wlp2*", // (Optional) To force the use of this interface 169 - "format-wifi": "{essid} ({signalStrength}%)  ", 170 - "format-ethernet": "{ipaddr}/{cidr} ", 171 - "tooltip-format": "{ifname} via {gwaddr} ", 172 - "format-linked": "{ifname} (No IP) ", 173 - "format-disconnected": "Disconnected ⚠", 174 - "format-alt": "{ifname}: {ipaddr}/{cidr}" 97 + "tooltip-format": "MPD (connected)", 98 + "tooltip-format-disconnected": "MPD (disconnected)" 99 + }, 100 + "idle_inhibitor": { 101 + "format": "{icon}", 102 + "format-icons": { 103 + "activated": "", 104 + "deactivated": "" 105 + } 106 + }, 107 + "tray": { 108 + // "icon-size": 21, 109 + "spacing": 10 110 + }, 111 + "clock": { 112 + // "timezone": "America/New_York", 113 + "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", 114 + "format-alt": "{:%Y-%m-%d}" 115 + }, 116 + "cpu": { 117 + "format": "{usage}%  ", 118 + "tooltip": false 119 + }, 120 + "memory": { 121 + "format": "{}%  " 122 + }, 123 + "temperature": { 124 + // "thermal-zone": 2, 125 + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", 126 + "critical-threshold": 80, 127 + // "format-critical": "{temperatureC}°C {icon}", 128 + "format": "{temperatureC}°C {icon}", 129 + "format-icons": [ 130 + "", 131 + "", 132 + "" 133 + ] 134 + }, 135 + "backlight": { 136 + // "device": "acpi_video1", 137 + "format": "{percent}% {icon}", 138 + "format-icons": [ 139 + "", 140 + "", 141 + "", 142 + "", 143 + "", 144 + "", 145 + "", 146 + "", 147 + "" 148 + ] 149 + }, 150 + "battery": { 151 + "states": { 152 + // "good": 95, 153 + "warning": 30, 154 + "critical": 15 175 155 }, 176 - "pulseaudio": { 177 - // "scroll-step": 1, // %, can be a float 178 - "format": "{volume}% {icon} {format_source}", 179 - "format-bluetooth": "{volume}% {icon} {format_source}", 180 - "format-bluetooth-muted": " {icon} {format_source}", 181 - "format-muted": " {format_source}", 182 - "format-source": "{volume}% ", 183 - "format-source-muted": " ", 184 - "format-icons": { 185 - "headphone": "", 186 - "hands-free": "", 187 - "headset": "", 188 - "phone": "", 189 - "portable": "", 190 - "car": "", 191 - "default": ["", " ", " "] 192 - }, 193 - "on-click": "pavucontrol" 156 + "format": "{capacity}% {icon}", 157 + "format-full": "{capacity}% {icon}", 158 + "format-charging": "{capacity}% ", 159 + "format-plugged": "{capacity}% ", 160 + "format-alt": "{time} {icon}", 161 + // "format-good": "", // An empty format will hide the module 162 + // "format-full": "", 163 + "format-icons": [ 164 + "", 165 + "", 166 + "", 167 + "", 168 + "" 169 + ] 170 + }, 171 + "battery#bat2": { 172 + "bat": "BAT2" 173 + }, 174 + "power-profiles-daemon": { 175 + "format": "{icon}", 176 + "tooltip-format": "Power profile: {profile}\nDriver: {driver}", 177 + "tooltip": true, 178 + "format-icons": { 179 + "default": "", 180 + "performance": "", 181 + "balanced": " ", 182 + "power-saver": " " 183 + } 184 + }, 185 + "network": { 186 + // "interface": "wlp2*", // (Optional) To force the use of this interface 187 + "format-wifi": "{essid} ({signalStrength}%)  ", 188 + "format-ethernet": "{ipaddr}/{cidr} ", 189 + "tooltip-format": "{ifname} via {gwaddr} ", 190 + "format-linked": "{ifname} (No IP) ", 191 + "format-disconnected": "Disconnected ⚠", 192 + "format-alt": "{ifname}: {ipaddr}/{cidr}" 193 + }, 194 + "pulseaudio": { 195 + // "scroll-step": 1, // %, can be a float 196 + "format": "{volume}% {icon} {format_source}", 197 + "format-bluetooth": "{volume}% {icon} {format_source}", 198 + "format-bluetooth-muted": " {icon} {format_source}", 199 + "format-muted": " {format_source}", 200 + "format-source": "{volume}% ", 201 + "format-source-muted": " ", 202 + "format-icons": { 203 + "headphone": "", 204 + "hands-free": "", 205 + "headset": "", 206 + "phone": "", 207 + "portable": "", 208 + "car": "", 209 + "default": [ 210 + "", 211 + " ", 212 + " " 213 + ] 194 214 }, 195 - "custom/media": { 196 - "format": "{icon} {text}", 197 - "return-type": "json", 198 - "max-length": 40, 199 - "format-icons": { 200 - "spotify": " ", 201 - "default": "🎜 " 202 - }, 203 - "escape": true, 204 - "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder 205 - // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name 215 + "on-click": "pavucontrol" 216 + }, 217 + "custom/media": { 218 + "format": "{icon} {text}", 219 + "return-type": "json", 220 + "max-length": 40, 221 + "format-icons": { 222 + "spotify": " ", 223 + "default": "🎜 " 206 224 }, 207 - "custom/power": { 208 - "format" : "⏻ ", 209 - "tooltip": false, 210 - "menu": "on-click", 211 - "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder 212 - "menu-actions": { 213 - "shutdown": "shutdown", 214 - "reboot": "reboot", 215 - "suspend": "systemctl suspend", 216 - "hibernate": "systemctl hibernate" 217 - } 225 + "escape": true, 226 + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder 227 + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name 228 + }, 229 + "custom/power": { 230 + "format": "⏻ ", 231 + "tooltip": false, 232 + "menu": "on-click", 233 + "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder 234 + "menu-actions": { 235 + "shutdown": "shutdown", 236 + "reboot": "reboot", 237 + "suspend": "systemctl suspend", 238 + "hibernate": "systemctl hibernate" 218 239 } 219 - } 240 + } 241 + }
+28
hosts/common/waybar/power_menu.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <interface> 3 + <object class="GtkMenu" id="menu"> 4 + <child> 5 + <object class="GtkMenuItem" id="suspend"> 6 + <property name="label">Suspend</property> 7 + </object> 8 + </child> 9 + <child> 10 + <object class="GtkMenuItem" id="hibernate"> 11 + <property name="label">Hibernate</property> 12 + </object> 13 + </child> 14 + <child> 15 + <object class="GtkMenuItem" id="shutdown"> 16 + <property name="label">Shutdown</property> 17 + </object> 18 + </child> 19 + <child> 20 + <object class="GtkSeparatorMenuItem" id="delimiter1"/> 21 + </child> 22 + <child> 23 + <object class="GtkMenuItem" id="reboot"> 24 + <property name="label">Reboot</property> 25 + </object> 26 + </child> 27 + </object> 28 + </interface>