From a55c75925c0ec421c8460bc31b9d018c59a6161f Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Thu, 25 Jul 2024 21:15:07 -0700 Subject: [PATCH 1/4] waybar mpris --- modules/desktop/waybar.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index 8430450..194c2b0 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -40,11 +40,19 @@ in { "clock" ]; modules-right = [ + "group/playback" "group/status" "tray" "group/power" ]; + "group/playback" = { + orientation = "inherit"; + modules = [ + "mpris" + ]; + }; + "group/status" = { orientation = "inherit"; modules = [ @@ -210,6 +218,17 @@ in { { type = "audio-in"; } ]; }; + mpris = { + format = "♫ {dynamic}"; + format-paused = "{status_icon} {dynamic}"; + dynamic-order = [ "title" ]; + tooltip-format = "{player}: {dynamic}"; + interval = 1; + status-icons = { + playing = "▶"; + paused = "⏸"; + }; + }; clock = { format = "{:%H:%M}"; format-alt = "{:%a %b %d %R}"; From cb510f51731571770318e8323719218ada5e2534 Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Thu, 25 Jul 2024 21:22:21 -0700 Subject: [PATCH 2/4] reorganize theme stuff --- modules/desktop/hyprland.nix | 14 -------- modules/desktop/rofi.nix | 1 - modules/desktop/themes/catppuccin/default.nix | 33 +++++++++++++++++-- .../desktop/themes/catppuccin}/rofi.rasi | 0 .../desktop/themes/catppuccin}/waybar.css | 0 modules/desktop/themes/default.nix | 30 +++++++++++++++-- modules/desktop/waybar.nix | 4 --- modules/desktop/wob.nix | 6 +--- 8 files changed, 60 insertions(+), 28 deletions(-) rename {config => modules/desktop/themes/catppuccin}/rofi.rasi (100%) rename {config => modules/desktop/themes/catppuccin}/waybar.css (100%) diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 009bf72..028ef82 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -293,20 +293,6 @@ in { initial_workspace_tracking = 0; }; }; - - extraConfig = '' - general { - col.active_border=$pink - col.inactive_border=$surface0 - } - decoration { - col.shadow=$surface0 - col.shadow_inactive=$surface0 - } - misc { - background_color=$crust - } - ''; }; }; } diff --git a/modules/desktop/rofi.nix b/modules/desktop/rofi.nix index 5724685..d27c114 100644 --- a/modules/desktop/rofi.nix +++ b/modules/desktop/rofi.nix @@ -16,7 +16,6 @@ in { extraConfig = { show-icons = true; }; - theme = ../../config/rofi.rasi; }; }; } diff --git a/modules/desktop/themes/catppuccin/default.nix b/modules/desktop/themes/catppuccin/default.nix index ed61419..a63e269 100644 --- a/modules/desktop/themes/catppuccin/default.nix +++ b/modules/desktop/themes/catppuccin/default.nix @@ -5,9 +5,10 @@ let cfg = config.modules.desktop.themes; accent = "pink"; variant = "mocha"; + colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha; in { config = mkIf (cfg.active == "catppuccin") { - colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha; + colorScheme = colorScheme; modules.desktop.themes = { dark = true; @@ -63,7 +64,35 @@ in { }; }; - hyprland = "${inputs.hyprland-catppuccin}/themes/${variant}.conf"; + hyprland = { + source = "${inputs.hyprland-catppuccin}/themes/${variant}.conf"; + extraConfig = '' + general { + col.active_border=''$${accent} + col.inactive_border=$surface0 + } + decoration { + col.shadow=$surface0 + col.shadow_inactive=$surface0 + } + misc { + background_color=$crust + } + ''; + }; + + waybar = builtins.concatStringsSep "\n" [ + "@import \"${inputs.waybar-catppuccin}/themes/${variant}.css\";" + (lib.readFile ./waybar.css) + ]; + + wob = with colorScheme.palette; { + borderColor = "${base04}FF"; + backgroundColor = "${base01}66"; + barColor = "${base05}FF"; + }; + + rofi = ./rofi.rasi; }; }; } diff --git a/config/rofi.rasi b/modules/desktop/themes/catppuccin/rofi.rasi similarity index 100% rename from config/rofi.rasi rename to modules/desktop/themes/catppuccin/rofi.rasi diff --git a/config/waybar.css b/modules/desktop/themes/catppuccin/waybar.css similarity index 100% rename from config/waybar.css rename to modules/desktop/themes/catppuccin/waybar.css diff --git a/modules/desktop/themes/default.nix b/modules/desktop/themes/default.nix index 7671167..d38dbc4 100644 --- a/modules/desktop/themes/default.nix +++ b/modules/desktop/themes/default.nix @@ -44,7 +44,20 @@ in { }; }; - hyprland = mkOpt (nullOr str) null; + hyprland = { + source = mkOpt (nullOr str) null; + extraConfig = mkOpt (nullOr str) null; + }; + + waybar = mkOpt str ""; + + wob = { + borderColor = mkOpt (nullOr str) null; + backgroundColor = mkOpt (nullOr str) null; + barColor = mkOpt (nullOr str) null; + }; + + rofi = mkOpt (nullOr path) null; }; config = mkIf (cfg.active != null) { @@ -96,6 +109,19 @@ in { }; }; - hm.wayland.windowManager.hyprland.settings.source = mkIf (cfg.hyprland != null) [ cfg.hyprland ]; + hm.wayland.windowManager.hyprland = { + settings.source = mkIf (cfg.hyprland.source != null) [ cfg.hyprland.source ]; + extraConfig = mkIf (cfg.hyprland.extraConfig != null) cfg.hyprland.extraConfig; + }; + + hm.programs.waybar.style = cfg.waybar; + + hm.services.wob.settings."" = { + border_color = cfg.wob.borderColor; + background_color = cfg.wob.backgroundColor; + bar_color = cfg.wob.barColor; + }; + + hm.programs.rofi.theme = cfg.rofi; }; } diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index 194c2b0..27c1e3b 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -18,10 +18,6 @@ in { hm.programs.waybar = { enable = true; package = cfg.package; - style = builtins.concatStringsSep "\n" [ - "@import \"${inputs.waybar-catppuccin}/themes/mocha.css\";" - (lib.readFile ../../config/waybar.css) - ]; settings = { mainBar = { layer = "top"; diff --git a/modules/desktop/wob.nix b/modules/desktop/wob.nix index 5c0cb30..de88a37 100644 --- a/modules/desktop/wob.nix +++ b/modules/desktop/wob.nix @@ -22,7 +22,7 @@ in { in [ script ]; hm.services.wob = { enable = true; - settings = with config.colorScheme.palette; { + settings = { "" = { timeout = 1000; @@ -36,10 +36,6 @@ in { margin = 12; - border_color = "${base04}FF"; - background_color = "${base01}66"; - bar_color = "${base05}FF"; - overflow_mode = "nowrap"; output_mode = "focused"; }; From af72f39c2ea02cd4aa13d7f2612c66db77d18795 Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Thu, 25 Jul 2024 21:26:27 -0700 Subject: [PATCH 3/4] set waybar player --- modules/desktop/waybar.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index 27c1e3b..f21fa05 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -224,6 +224,7 @@ in { playing = "▶"; paused = "⏸"; }; + player = "firefox"; }; clock = { format = "{:%H:%M}"; From 76396da7ba082e70635eb4d11339bb995ca56f3a Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Fri, 26 Jul 2024 01:28:24 -0700 Subject: [PATCH 4/4] some accent stuff --- modules/desktop/themes/catppuccin/default.nix | 10 ++++++---- modules/desktop/themes/catppuccin/waybar.css | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/desktop/themes/catppuccin/default.nix b/modules/desktop/themes/catppuccin/default.nix index a63e269..54987d2 100644 --- a/modules/desktop/themes/catppuccin/default.nix +++ b/modules/desktop/themes/catppuccin/default.nix @@ -5,16 +5,17 @@ let cfg = config.modules.desktop.themes; accent = "pink"; variant = "mocha"; - colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha; + colorScheme = inputs.nix-colors.colorSchemes.${"catppuccin-${variant}"}; + pascalCase = s: (toUpper (substring 0 1 s)) + (toLower (substring 1 (stringLength s) s)); in { config = mkIf (cfg.active == "catppuccin") { colorScheme = colorScheme; modules.desktop.themes = { - dark = true; + dark = variant != "latte"; gtkTheme = { - name = "catppuccin-mocha-pink-compact+rimless"; # TODO: put accent in here + name = "catppuccin-${variant}-${accent}-compact+rimless"; package = pkgs.catppuccin-gtk.override { variant = variant; accents = [ accent ]; @@ -46,7 +47,7 @@ in { editor = { vscode = { colorTheme = { - name = "Catppuccin Mocha"; + name = "Catppuccin ${pascalCase variant}"; extension = (pkgs.vscode-extensions.catppuccin.catppuccin-vsc.override { accent = accent; boldKeywords = false; @@ -83,6 +84,7 @@ in { waybar = builtins.concatStringsSep "\n" [ "@import \"${inputs.waybar-catppuccin}/themes/${variant}.css\";" + "@define-color accent @${accent};" (lib.readFile ./waybar.css) ]; diff --git a/modules/desktop/themes/catppuccin/waybar.css b/modules/desktop/themes/catppuccin/waybar.css index 5c2363c..bb72f31 100644 --- a/modules/desktop/themes/catppuccin/waybar.css +++ b/modules/desktop/themes/catppuccin/waybar.css @@ -71,7 +71,7 @@ window#waybar { } #workspaces button.active { - background: @pink; + background: @accent; color: @surface0; } #workspaces button:hover { @@ -80,7 +80,7 @@ window#waybar { box-shadow: none; } #workspaces button.active:hover { - background: @pink; + background: @accent; color: @surface0; }