From a03973e7eaaa91e0b4fddaccfe7c1a844cf62c9a Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Sat, 26 Aug 2023 17:20:18 +0200 Subject: [PATCH] pinwheel: Extract `waybar` module --- hosts/pinwheel/configuration.nix | 1 + hosts/pinwheel/home.nix | 29 ------------ hosts/pinwheel/modules/waybar/default.nix | 56 +++++++++++++++++++++++ 3 files changed, 57 insertions(+), 29 deletions(-) create mode 100644 hosts/pinwheel/modules/waybar/default.nix diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index 374f942..2ef6229 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -18,6 +18,7 @@ ./modules/vim ./modules/foot ./modules/hyprland + ./modules/waybar ./modules/swaylock ./modules/syncthing ./modules/firefox diff --git a/hosts/pinwheel/home.nix b/hosts/pinwheel/home.nix index 16ef208..2e27fae 100644 --- a/hosts/pinwheel/home.nix +++ b/hosts/pinwheel/home.nix @@ -12,35 +12,6 @@ bemenu ]; - programs.waybar = { - enable = true; - - settings = { - mainBar = { - layer = "top"; - position = "top"; - height = 30; - output = [ - "eDP-1" - "HDMI-A-1" - ]; - modules-left = [ "hyprland/workspaces" ]; - modules-center = [ "custom/hello-from-waybar" ]; - modules-right = [ ]; - - "custom/hello-from-waybar" = { - format = "hello {}"; - max-length = 40; - interval = "once"; - exec = pkgs.writeShellScript "hello-from-waybar" '' - echo "from within waybar" - ''; - }; - }; - }; - - style = ''''; - services.dunst.enable = true; home.stateVersion = "23.05"; diff --git a/hosts/pinwheel/modules/waybar/default.nix b/hosts/pinwheel/modules/waybar/default.nix new file mode 100644 index 0000000..840cfdf --- /dev/null +++ b/hosts/pinwheel/modules/waybar/default.nix @@ -0,0 +1,56 @@ +{ home-manager, pkgs, ... }: +{ + home-manager.users.alex = { + programs.waybar = { + enable = true; + + settings = { + bar1 = { + name = "bar1"; + layer = "top"; + position = "top"; + height = 30; + output = [ + "eDP-1" + "HDMI-A-1" + ]; + + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "custom/hello" ]; + modules-right = [ "tray" "wireplumber" "battery" "clock" ]; + + "custom/hello" = { + format = "hello {}"; + max-length = 40; + interval = "once"; + exec = pkgs.writeShellScript "hello-from-waybar" '' + echo "from within waybar" + ''; + }; + + wireplumber = { + format = "{volume}%"; + format-muted = ""; + on-click = "pavucontrol"; + max-volume = 150; + scroll-step = 0.2; + }; + }; + }; + + style = '' + #workspaces button.active { + background: red; + } + + window#waybar { + background-color: blue; + } + + #custom-hello { + background-color: yellow; + } + ''; + }; + }; +}