Swappy: Patch the default color.
This commit is contained in:
parent
74609a80d8
commit
8bfcebcd27
|
@ -42,6 +42,10 @@ in {
|
|||
accent-g = mkStrOption stylix.colors.base0A-rgb-g;
|
||||
accent-b = mkStrOption stylix.colors.base0A-rgb-b;
|
||||
|
||||
accent-dec-r = mkStrOption stylix.colors.base0A-dec-r;
|
||||
accent-dec-g = mkStrOption stylix.colors.base0A-dec-g;
|
||||
accent-dec-b = mkStrOption stylix.colors.base0A-dec-b;
|
||||
|
||||
bg-r = mkStrOption stylix.colors.base00-rgb-r;
|
||||
bg-g = mkStrOption stylix.colors.base00-rgb-g;
|
||||
bg-b = mkStrOption stylix.colors.base00-rgb-b;
|
||||
|
|
16
overlay/Swappy.nix
Normal file
16
overlay/Swappy.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
__findFile,
|
||||
config,
|
||||
pkgs,
|
||||
util,
|
||||
...
|
||||
} @args: {
|
||||
# SEE: https://github.com/jtheoof/swappy/issues/131
|
||||
nixpkgs.overlays = [(final: prev: {
|
||||
swappy = prev.swappy.overrideAttrs (old: {
|
||||
patches = (old.patches or [ ]) ++ [
|
||||
(import <patch/swappy/DefaultColor.nix> args).file
|
||||
];
|
||||
});
|
||||
})];
|
||||
}
|
31
patch/swappy/DefaultColor.nix
Normal file
31
patch/swappy/DefaultColor.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
util,
|
||||
...
|
||||
}: let
|
||||
color = config.module.style.color;
|
||||
accentR = color.accent-dec-r;
|
||||
accentG = color.accent-dec-g;
|
||||
accentB = color.accent-dec-b;
|
||||
in {
|
||||
file = pkgs.writeText "SwappyDefaultColorPatch" (util.trimTabs ''
|
||||
diff --git a/src/application.c b/src/application.c
|
||||
index 5b98590..86788b6 100644
|
||||
--- a/src/application.c
|
||||
+++ b/src/application.c
|
||||
@@ -875,9 +875,9 @@ static gboolean is_file_from_stdin(const char *file) {
|
||||
}
|
||||
|
||||
static void init_settings(struct swappy_state *state) {
|
||||
- state->settings.r = 1;
|
||||
- state->settings.g = 0;
|
||||
- state->settings.b = 0;
|
||||
+ state->settings.r = ${accentR};
|
||||
+ state->settings.g = ${accentG};
|
||||
+ state->settings.b = ${accentB};
|
||||
state->settings.a = 1;
|
||||
state->settings.w = state->config->line_size;
|
||||
state->settings.t = state->config->text_size;
|
||||
'');
|
||||
}
|
Loading…
Reference in a new issue