From e8d8704b7077d63ba2e4e3db51b1b65bd67d7c5b Mon Sep 17 00:00:00 2001 From: fwastring Date: Fri, 10 Oct 2025 16:31:26 +0200 Subject: [PATCH] Waybar config --- maskiner/core/configuration.nix | 21 +++-- moduler/hyprland.nix | 22 +++-- moduler/programs/waybar/default.nix | 27 ++++-- moduler/programs/waybar/waybar-laptop.jsonc | 77 +++++++++++++++++ moduler/programs/waybar/waybar.css | 49 ++++++++--- moduler/programs/waybar/waybar.jsonc | 95 +++++++++++++++------ 6 files changed, 232 insertions(+), 59 deletions(-) create mode 100644 moduler/programs/waybar/waybar-laptop.jsonc diff --git a/maskiner/core/configuration.nix b/maskiner/core/configuration.nix index 89b4cbe..0d4faee 100644 --- a/maskiner/core/configuration.nix +++ b/maskiner/core/configuration.nix @@ -54,6 +54,17 @@ in ./../../moduler/programs/waybar inputs.catppuccin.homeModules.catppuccin ]; + waybar = { + enable = true; + # configPath = ./../../moduler/programs/waybar/waybar-laptop.jsonc; + }; + gtk = { + enable = true; + iconTheme = { + name = "oomox-gruvbox-dark"; + package = pkgs.gruvbox-dark-icons-gtk; + }; + }; catppuccin = { librewolf = { enable = true; @@ -73,11 +84,11 @@ in }; boot.kernelPackages = pkgs.linuxPackages_latest; - boot.extraModulePackages = [ - (btusb.overrideAttrs (_: { - patches = [ ../../moduler/btusb-add-mt7925.patch ]; - })) - ]; + # boot.extraModulePackages = [ + # (btusb.overrideAttrs (_: { + # patches = [ ../../moduler/btusb-add-mt7925.patch ]; + # })) + # ]; networking.hostName = myhostname; diff --git a/moduler/hyprland.nix b/moduler/hyprland.nix index 3a3b9d0..0b2793e 100644 --- a/moduler/hyprland.nix +++ b/moduler/hyprland.nix @@ -19,12 +19,11 @@ in hyprland-qtutils waypipe wmenu - playerctl + playerctl ]; - fonts.packages = with pkgs; [ - font-awesome + font-awesome ]; services = { @@ -149,9 +148,9 @@ in }; decoration = { - rounding = 0; - active_opacity = 0.9; - inactive_opacity = 0.8; + rounding = 10; + active_opacity = 0.8; + inactive_opacity = 0.7; fullscreen_opacity = 0.9; blur = { @@ -275,7 +274,7 @@ in # Screencapture "$mod SHIFT, s, exec, ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png" - # special + # special "SUPER+SHIFT, code:201, exec, confetti" ]; @@ -284,6 +283,15 @@ in "$mod, mouse:273, resizewindow" ]; + windowrulev2 = [ + "float, class:^(org.pulseaudio.pavucontrol)$" + "size 500 400, class:^(org.pulseaudio.pavucontrol)" + "move onscreen cursor -250 0, class:^(org.pulseaudio.pavucontrol)" + "float, title:^(Bluetooth Devices)$" + "size 500 400, title:^(Bluetooth Devices)" + "move onscreen cursor -250 0, title:^(Bluetooth Devices)" + ]; + env = [ "NIXOS_OZONE_WL,1" "_JAVA_AWT_WM_NONREPARENTING,1" diff --git a/moduler/programs/waybar/default.nix b/moduler/programs/waybar/default.nix index 3c18973..5ea72a2 100644 --- a/moduler/programs/waybar/default.nix +++ b/moduler/programs/waybar/default.nix @@ -1,4 +1,5 @@ { + lib, config, inputs, pkgs, @@ -6,18 +7,32 @@ }: let + in +with lib; { - programs = { + options = { waybar = { - enable = true; - systemd = { - enable = true; + enable = mkEnableOption "enables waybar"; + configPath = lib.mkOption { + type = lib.types.path; + default = ./waybar.jsonc; + description = "The path to the waybar config"; }; }; }; - xdg.configFile."waybar/config.jsonc".source = ./waybar.jsonc; - xdg.configFile."waybar/style.css".source = ./waybar.css; + config = mkIf config.waybar.enable { + programs = { + waybar = { + enable = true; + systemd = { + enable = true; + }; + }; + }; + xdg.configFile."waybar/config.jsonc".source = config.waybar.configPath; + xdg.configFile."waybar/style.css".source = ./waybar.css; + }; # catppuccin.waybar = { # enable = true; # flavor = "latte"; diff --git a/moduler/programs/waybar/waybar-laptop.jsonc b/moduler/programs/waybar/waybar-laptop.jsonc new file mode 100644 index 0000000..2bd3dec --- /dev/null +++ b/moduler/programs/waybar/waybar-laptop.jsonc @@ -0,0 +1,77 @@ +{ + "layer": "top", + "position": "top", + "margin-top": 10, + "margin-left": 14, + "margin-right": 14, + "spacing": 12, + "modules-left": [ + "hyprland/workspaces" + ], + "modules-right": [ + "mpris", + "bluetooth", + "pulseaudio", + "upower", + "clock" + ], + "mpris": { + "player": "Feishin", + "format": "{player_icon} {title} — {artist}", + "format-paused": " {player_icon} {title}", + "format-stopped": "", + "player-icons": { + "default": "", + "Feishin": "" + }, + "max-length": 45, + "interval": 1, + "tooltip": true, + "tooltip-format": "{player} — {status}\n{artist}\n{title}\n{album}", + "on-click": "playerctl -p Feishin play-pause", + "on-scroll-up": "playerctl -p Feishin next", + "on-scroll-down": "playerctl -p Feishin previous" + }, + "bluetooth": { + "format": " {status}", + "format-connected": " {device_alias}", + "format-connected-battery": " {device_alias} {device_battery_percentage}%", + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%", + "on-click": "pgrep .blueman-manage && pkill .blueman-manage || blueman-manager &" + }, + "upower": { + "icon-size": 20, + "hide-if-empty": true, + "tooltip": true, + "tooltip-spacing": 20 + }, + "pulseaudio": { + //"scroll-step": 1, + "format": "{icon} {volume}%", + "format-bluetooth": "{icon}  {volume}%", + "format-muted": "", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": [ + "", + "" + ] + }, + "on-click": "pgrep pavucontrol && pkill pavucontrol || pavucontrol &" + }, + "clock": { + "format": "{:%c}", + "locale": "sv_SE.UTF-8", + "tooltip": true, + "tooltip-format": "{:%A, %d %B %Y}\n %H:%M:%S", + "interval": 1 + } +} diff --git a/moduler/programs/waybar/waybar.css b/moduler/programs/waybar/waybar.css index eba4aa3..007030e 100644 --- a/moduler/programs/waybar/waybar.css +++ b/moduler/programs/waybar/waybar.css @@ -15,33 +15,33 @@ /* -------- Base Styles -------- */ * { - font-family: "FiraCode Nerd Font Bold", "Font Awesome 7 Free Regular", sans-serif; + font-family: "FiraCode Nerd Font", "Font Awesome 7 Free"; font-size: 15px; } window#waybar { - background: @mocha-base; + /* background: @mocha-base; */ + background: transparent; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: background-color .35s ease, color .35s ease; - padding: 4px 8px; } window#waybar.hidden { opacity: 0.2; } -window#waybar.termite { background: @mocha-mantle; } +window#waybar.termite { background: @mocha-base; } window#waybar.chromium { background: @mocha-base; border: none; } /* -------- Module “pill” look -------- */ -#workspaces, #clock, #mpris { - background: @mocha-mantle; - border: 1px solid @mocha-surface2; - border-radius: 10px; +#workspaces, #clock, #mpris, #pulseaudio, #bluetooth, #upower { + background: @mocha-base; + border: none; + border-radius: 5px; padding: 3px 8px; } /* consistent gaps between modules */ .modules-left > widget, .modules-right > widget { - margin: 0 6px; + margin: 0 15px; } .modules-left > widget:first-child { margin-left: 0; } .modules-right > widget:last-child { margin-right: 0; } @@ -73,8 +73,7 @@ button:active { /* -------- Workspaces -------- */ #workspaces { - padding: 4px 6px; - background: @mocha-mantle; + background: @mocha-base; } #workspaces button { @@ -106,16 +105,38 @@ button:active { color: @mocha-base; font-weight: 600; letter-spacing: 0.2px; - padding: 4px 10px; } -/* -------- Clock -------- */ +/* -------- Mpris -------- */ #mpris { background: @mocha-peach; color: @mocha-base; font-weight: 600; letter-spacing: 0.2px; - padding: 4px 10px; +} + +/* -------- Pavu -------- */ +#pulseaudio { + background: @mocha-peach; + color: @mocha-base; + font-weight: 600; + letter-spacing: 0.2px; +} + +/* -------- Bluetooth -------- */ +#bluetooth { + background: @mocha-peach; + color: @mocha-base; + font-weight: 600; + letter-spacing: 0.2px; +} + +/* -------- Upower -------- */ +#bluetooth { + background: @mocha-peach; + color: @mocha-base; + font-weight: 600; + letter-spacing: 0.2px; } /* -------- Helpers -------- */ diff --git a/moduler/programs/waybar/waybar.jsonc b/moduler/programs/waybar/waybar.jsonc index 84e2f81..ce4c371 100644 --- a/moduler/programs/waybar/waybar.jsonc +++ b/moduler/programs/waybar/waybar.jsonc @@ -1,29 +1,70 @@ { - "layer": "top", - "position": "top", - - "modules-left": ["hyprland/workspaces"], - "modules-right": ["mpris","clock"], - "mpris": { - "player": "Feishin", - "format": "{player_icon} {artist} — {title}", - "format-paused": "{player_icon} {title}", - "format-stopped": "", - "player-icons": { "default": "", "Feishin": "" }, - "max-length": 45, - "interval": 1, - "tooltip": true, - "tooltip-format": "{player} — {status}\n{artist}\n{title}\n{album}", - "on-click": "playerctl -p Feishin play-pause", - "on-scroll-up": "playerctl -p Feishin next", - "on-scroll-down": "playerctl -p Feishin previous" - }, - - "clock": { - "format": "{:%c}", - "locale": "sv_SE.UTF-8", - "tooltip": true, - "tooltip-format": "{:%A, %d %B %Y}\n %H:%M:%S", - "interval": 1 - } + "layer": "top", + "position": "top", + "margin-top": 10, + "margin-left": 14, + "margin-right": 14, + "spacing": 12, + "modules-left": [ + "hyprland/workspaces" + ], + "modules-right": [ + "mpris", + "bluetooth", + "pulseaudio", + "clock" + ], + "mpris": { + "player": "Feishin", + "format": "{player_icon} {title} — {artist}", + "format-paused": " {player_icon} {title}", + "format-stopped": "", + "player-icons": { + "default": "", + "Feishin": "" + }, + "max-length": 45, + "interval": 1, + "tooltip": true, + "tooltip-format": "{player} — {status}\n{artist}\n{title}\n{album}", + "on-click": "playerctl -p Feishin play-pause", + "on-scroll-up": "playerctl -p Feishin next", + "on-scroll-down": "playerctl -p Feishin previous" + }, + "bluetooth": { + "format": " {status}", + "format-connected": " {device_alias}", + "format-connected-battery": " {device_alias} {device_battery_percentage}%", + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%", + "on-click": "pgrep .blueman-manage && pkill .blueman-manage || blueman-manager &" + }, + "pulseaudio": { + //"scroll-step": 1, + "format": "{icon} {volume}%", + "format-bluetooth": "{icon}  {volume}%", + "format-muted": "", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": [ + "", + "" + ] + }, + "on-click": "pgrep pavucontrol && pkill pavucontrol || pavucontrol &" + }, + "clock": { + "format": "{:%c}", + "locale": "sv_SE.UTF-8", + "tooltip": true, + "tooltip-format": "{:%A, %d %B %Y}\n %H:%M:%S", + "interval": 1 + } }