diff --git a/users/natalie/home/waybar/settings.nix b/users/natalie/home/waybar/settings.nix index a9f2b5cf15d257a223c6a56b3da08e09f0e3f1fa..373f9a97969e1f0bc46c52fd2c16ee5e72748a42 100644 --- a/users/natalie/home/waybar/settings.nix +++ b/users/natalie/home/waybar/settings.nix @@ -1,6 +1,176 @@ { ... }: +let + custom = { + font = "Maple Mono"; + font_size = "18px"; + font_weight = "bold"; + text_color = "#FBF1C7"; + background_0 = "#1D2021"; + background_1 = "#282828"; + border_color = "#928374"; + red = "#CC241D"; + green = "#98971A"; + yellow = "#FABD2F"; + blue = "#458588"; + magenta = "#B16286"; + cyan = "#689D6A"; + orange = "#D65D0E"; + opacity = "1"; + indicator_height = "2px"; + }; +in { - programs.waybar.settings.mainBar = { + programs.waybar.settings.mainBar = with custom; { + position = "top"; + height = 28; + margin-top = 0; + margin-bottom = 0; + margin-left = 0; + margin-right = 0; + modules-left = [ + "custom/launcher" + "hyprland/workspaces" + "tray" + ]; + modules-center = [ "clock" ]; + modules-right = [ + "cpu" + "memory" + "pulseaudio" + "network" + "battery" + "hyprland/language" + "custom/notification" + "custom/power-menu" + ]; + clock = { + calendar = { + format = { + today = "{}"; + }; + }; + format = " {:%H:%M}"; + tooltip = "true"; + tooltip-format = "{:%Y %B}\n{calendar}"; + format-alt = " {:%d/%m}"; + }; + "hyprland/workspaces" = { + active-only = false; + disable-scroll = true; + format = "{icon}"; + on-click = "activate"; + format-icons = { + sort-by-number = true; + }; + persistent-workspaces = { + "1" = [ ]; + "2" = [ ]; + "3" = [ ]; + "4" = [ ]; + "5" = [ ]; + }; + }; + cpu = { + format = " {usage}%"; + format-alt = " {avg_frequency} GHz"; + interval = 2; + on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --override font_size=14 --title float_ghostty btop'"; + }; + memory = { + format = "󰟜 {}%"; + format-alt = "󰟜 {used} GiB"; #  + interval = 2; + on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --override font_size=14 --title float_ghostty btop'"; + }; + disk = { + # path = "/"; + format = "󰋊 {percentage_used}%"; + interval = 60; + on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --override font_size=14 --title float_ghostty btop'"; + }; + network = { + format-wifi = " {signalStrength}%"; + format-ethernet = "󰀂 "; + tooltip-format = "Connected to {essid} {ifname} via {gwaddr}"; + format-linked = "{ifname} (No IP)"; + format-disconnected = "󰖪 "; + }; + tray = { + icon-size = 20; + spacing = 8; + }; + pulseaudio = { + format = "{icon} {volume}%"; + format-muted = " {volume}%"; + format-icons = { + default = [ "" ]; + }; + scroll-step = 2; + on-click = "${pkgs.pamixer}/bin/pamixer -t"; + on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol"; + }; + # battery = { + # format = "{icon} {capacity}%"; + # format-icons = [ + # " " + # " " + # " " + # " " + # " " + # ]; + # format-charging = "{capacity}%"; + # format-full = "{capacity}%"; + # format-warning = "{capacity}%"; + # interval = 5; + # states = { + # warning = 20; + # }; + # format-time = "{H}h{M}m"; + # tooltip = true; + # tooltip-format = "{time}"; + # }; + "hyprland/language" = { + tooltip = true; + tooltip-format = "Keyboard layout"; + format = " {}"; + format-fr = "FR"; + format-en = "US"; + on-click = "${pkgs.hyprland}/bin/hyprctl switchxkblayout at-translated-set-2-keyboard next"; + }; + "custom/launcher" = { + format = ""; + on-click = "random-wallpaper"; + on-click-right = "${pkgs.rofi}/bin/rofi -show drun"; + tooltip = "true"; + tooltip-format = "Random Wallpaper"; + }; + "custom/notification" = { + tooltip = true; + tooltip-format = "Notifications"; + format = "{icon}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb"; + on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; + on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw"; + escape = true; + }; + "custom/power-menu" = { + tooltip = true; + tooltip-format = "Power menu"; + format = ""; + on-click = "power-menu"; + }; + }; - }; } diff --git a/users/natalie/home/waybar/style.nix b/users/natalie/home/waybar/style.nix index c915eb0a89e3fb7d83b43c240933f4d5c4558ffe..048f66934053d4f9da0482ac511610aa11eefea3 100644 --- a/users/natalie/home/waybar/style.nix +++ b/users/natalie/home/waybar/style.nix @@ -1 +1,107 @@ -{ ... }: { } +{ ... }: +let + custom = { + font = "Maple Mono"; + font_size = "18px"; + font_weight = "bold"; + text_color = "#FBF1C7"; + background_0 = "#1D2021"; + background_1 = "#282828"; + border_color = "#A89984"; + red = "#CC241D"; + green = "#98971A"; + yellow = "#FABD2F"; + blue = "#458588"; + magenta = "#B16286"; + cyan = "#689D6A"; + orange = "#D65D0E"; + orange_bright = "#FE8019"; + opacity = "1"; + indicator_height = "2px"; + }; +in +{ + programs.waybar.style = with custom; '' + * { + border: none; + border-radius: 0px; + padding: 0; + margin: 0; + font-family: ${font}; + font-weight: ${font_weight}; + opacity: ${opacity}; + font-size: ${font_size}; + } + + window#waybar { + background: ${background_1}; + border-top: 1px solid ${border_color}; + } + + tooltip { + background: ${background_1}; + border: 1px solid ${border_color}; + } + tooltip label { + margin: 5px; + color: ${text_color}; + } + + #workspaces { + padding-left: 15px; + } + #workspaces button { + color: ${yellow}; + padding-left: 5px; + padding-right: 5px; + margin-right: 10px; + } + #workspaces button.empty { + color: ${text_color}; + } + #workspaces button.active { + color: ${orange_bright}; + } + + #clock { + color: ${text_color}; + } + + #tray { + margin-left: 10px; + color: ${text_color}; + } + #tray menu { + background: ${background_1}; + border: 1px solid ${border_color}; + padding: 8px; + } + #tray menuitem { + padding: 1px; + } + + #pulseaudio, #network, #cpu, #memory, #disk, #battery, #language, #custom-notification, #custom-power-menu { + padding-left: 5px; + padding-right: 5px; + margin-right: 10px; + color: ${text_color}; + } + + #pulseaudio, #language, #custom-notification { + margin-left: 15px; + } + + #custom-power-menu { + padding-right: 2px; + margin-right: 5px; + } + + #custom-launcher { + font-size: 20px; + color: ${text_color}; + font-weight: bold; + margin-left: 15px; + padding-right: 10px; + } + ''; +}