# # Bar # { config, lib, user, pkgs, ...}: { environment.systemPackages = with pkgs; [ waybar ]; nixpkgs.overlays = [ # Waybar needs to be compiled with the experimental flag for wlr/workspaces to work (self: super: { waybar = super.waybar.overrideAttrs (oldAttrs: { mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; }); }) ]; home-manager.users.${user} = { # Home-manager waybar config programs.waybar = { enable = true; #systemd = { # enable = true; # target = "sway-session.target"; # Needed for waybar to start automatically #}; style = '' * { border: none; font-family: FiraCode Nerd Font Mono; font-size: 13px; min-height: 0; } window#waybar { background-color: rgba(43,48,59,0.3); border-bottom: 3px solid transparent; color: white; } workspace, idle_inhibitor, mode, clock, pulseaudio, network, mpd, memory, network, window, cpu, disk, battery { margin: 15px; padding: 5px; } workspaces button { padding: 0 5px; margin: 0 3px; color: white; border-bottom: 3px solid transparent; } workspaces button:hover { background-color: rgba(100,100,100,0.8); color: #808080; } workspaces button.focused { background: rgba(100, 114, 125, 0.2); border-bottom: 2px solid gray; } battery.critical { color: #ff200c; } battery.charging { color: #9ece6a; } battery.warning:not(.charging) { background: #f53c3c; color: white; animation-name: blink; animation-duration: 0.5s; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: alternate; } pulseaudio.muted { border-bottom: 2px solid red; } ''; settings = [{ layer = "top"; position = "top"; height = 22; spacing = 10; tray = { spacing = 10; }; modules-center = [ "clock" ]; #modules-left = [ "wlr/mode" "wlr/workspaces" "wlr/window" ]; modules-left = [ "wlr/workspaces" ]; modules-right = [ "idle_inhibitor" "pulseaudio" "network" "cpu" "memory" "temperature" "battery" "tray" ]; #modules-right = [ "cpu" "memory" "pulseaudio" "clock" "tray" ]; "sway/workspaces" = { format = "{icon}"; format-icons = { "1"=""; "2"=""; "3"=""; "4"=""; "5"=""; }; all-outputs = false; persistent_workspaces = { "1" = []; "2" = []; "3" = []; "4" = []; "5" = []; }; }; "wlr/workspaces" = { format = "{icon}"; color = "white"; format-icons = { "1"=""; "2"=""; "3"=""; "4"=""; "5"=""; }; all-outputs = true; active-only = true; on-click = "activate"; }; clock = { format = "{:%b %d %H:%M}"; tooltip-format = "{:%Y %B}\n{calendar}"; format-alt = "{:%A, %B %d, %Y}"; }; idle_inhibitor = { format = "{icon}"; format-icons = { activated = ""; deactivated = ""; }; }; cpu = { format = "{usage}%"; tooltip = false; interval = 2; }; disk = { format = "{percentage_used}%"; path = "/"; interval = 30; }; memory = { format = "{}%"; interval = 5; }; temperature = { states = { "good" = 50; "warning" = 70; "critical" = 80; }; "thermal-zone" = 2; "hwmon-path" = "/sys/class/hwmon/hwmon3/temp1_input"; "format" = "{icon}{temperatureC}°C"; "format-icons" = ["" "" "" "" ""]; }; backlight = { "format" = "{icon}{percent}%"; "format-icons" = ["" ""]; "on-scroll-up" = "light -A +5%"; "on-scroll-down" = "light -U -5%"; }; battery = { interval = 60; states = { good = 95; warning = 20; critical = 5; }; format = "{icon}{capacity}%"; format-charging = "{capacity}%"; format-plugged = "{capacity}%"; format-alt = "{icon}{time}"; format-icons = ["" "" "" "" ""]; }; network = { format-wifi = ""; format-ethernet = " {ifname}: {ipaddr}/{cidr}"; format-linked = "睊{ifname} (No IP)"; format-disconnected = "睊Not connected"; format-alt = "{ifname}: {ipaddr}/{cidr}"; tooltip-format = "{essid} {signalStrength}%"; on-click-right = "${pkgs.alacritty}/bin/alacritty -e nmtui"; }; pulseaudio = { format = "{icon}{volume}% {format_source}"; format-bluetooth = "{icon}{volume}% {format_source}"; format-bluetooth-muted = "{volume}% {format_source}"; format-muted = "{format_source}"; format-source = "{volume}%"; #format-source = ""; format-source-muted = ""; format-icons = { default = [ "" "" "" ]; headphones = ""; handsfree = ""; headset = ""; }; tooltip-format = "{desc}, {volume}%"; on-click-right = "${pkgs.pamixer}/bin/pamixer --default-source -t"; on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; }; }]; }; }; }