From c122cea302f70f8b3dac759bb934b658f042d5d1 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Sat, 15 Feb 2025 01:01:15 +0100 Subject: [PATCH] treewide: use original MoreWaita with patch I originally made my own MoreWaita fork to add a few icons I needed, anticipating for my future ags shell, but applying a patch actually made way more sense, and is also simpler than maintaining my own fork. --- flake.lock | 10 +++++----- flake.nix | 2 +- modules/options/style.nix | 28 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 5cb870e..6adae85 100644 --- a/flake.lock +++ b/flake.lock @@ -738,15 +738,15 @@ "morewaita": { "flake": false, "locked": { - "lastModified": 1739553699, - "narHash": "sha256-gmFavqgaklS1XuWXD9KofAAL48qcRe5daNGH531PUig=", - "owner": "nezia1", + "lastModified": 1736335410, + "narHash": "sha256-gdU4GcNrxMktsMbxRkzd3NdD7oYSAhSo29lBMWp+HQ4=", + "owner": "somepaulo", "repo": "MoreWaita", - "rev": "bd7328ed13bd11cdc545f039e1c635aef292a90f", + "rev": "29ddd25363bf1c4be306f3bf1ea1507b443d8dee", "type": "github" }, "original": { - "owner": "nezia1", + "owner": "somepaulo", "repo": "MoreWaita", "type": "github" } diff --git a/flake.nix b/flake.nix index 81cfbff..04ec75e 100644 --- a/flake.nix +++ b/flake.nix @@ -118,7 +118,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; morewaita = { - url = "github:nezia1/MoreWaita"; # using my own fork for caffeine icons + url = "github:somepaulo/MoreWaita"; flake = false; }; nix-gaming = { diff --git a/modules/options/style.nix b/modules/options/style.nix index 3af2e92..6c58ae5 100644 --- a/modules/options/style.nix +++ b/modules/options/style.nix @@ -8,6 +8,7 @@ }: let inherit (lib) attrNames mkEnableOption mkOption pathExists; inherit (lib.types) attrs bool enum package path str; + inherit (lib.lists) singleton; cfg = config.local.style; in { @@ -102,6 +103,33 @@ in { description = "The GTK icon theme to be used"; default = pkgs.morewaita-icon-theme.overrideAttrs { src = inputs.morewaita; + installPhase = '' + runHook preInstall + + install -d $out/share/icons/MoreWaita + cp -r . $out/share/icons/MoreWaita + cp ${../../assets/icons/my-caffeine-on-symbolic.svg} $out/share/icons/MoreWaita/symbolic/status/my-caffeine-on-symbolic.svg + cp ${../../assets/icons/my-caffeine-off-symbolic.svg} $out/share/icons/MoreWaita/symbolic/status/my-caffeine-off-symbolic.svg + gtk-update-icon-cache -f -t $out/share/icons/MoreWaita && xdg-desktop-menu forceupdate + + runHook postInstall + ''; + + /* + a patch is needed because MoreWaita expects a `meson.build` file in the directory, containing the + name of every icon. + */ + patches = singleton (pkgs.writeText "add-caffeine-icons.patch" '' + diff --git a/symbolic/status/meson.build b/symbolic/status/meson.build + index 4e5bfc5..3bbf989 100644 + --- a/symbolic/status/meson.build + +++ b/symbolic/status/meson.build + @@ -17,2 +17,4 @@ regular_files = [ + 'keepassxc-unlocked.svg', + + 'my-caffeine-off-symbolic.svg', + + 'my-caffeine-on-symbolic.svg', + 'pamac-tray-no-update.svg', + ''); }; }; };