mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-21 15:53:32 +01:00
phosh: Handle background dimming at the package level
Should improve performance since we no longer depend on a background gradient in CSS.
This commit is contained in:
parent
dadee6bb08
commit
fe3f38acdd
@ -11,15 +11,10 @@ let
|
|||||||
inherit (lib.gvariant) mkTuple mkUint32;
|
inherit (lib.gvariant) mkTuple mkUint32;
|
||||||
inherit (config.modules.system) username;
|
inherit (config.modules.system) username;
|
||||||
inherit (builtins) attrValues;
|
inherit (builtins) attrValues;
|
||||||
inherit (self.packages.${pkgs.system}) phosh-backgrounds;
|
|
||||||
|
|
||||||
getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}";
|
phosh-backgrounds = self.packages.${pkgs.system}.phosh-backgrounds.override {
|
||||||
|
color = config.lib.stylix.colors.base00;
|
||||||
rgba =
|
};
|
||||||
color: transparency:
|
|
||||||
''rgba(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"}, ${transparency})'';
|
|
||||||
|
|
||||||
bg = ''linear-gradient(${rgba "base00" "0.7"}, ${rgba "base00" "0.7"})'';
|
|
||||||
|
|
||||||
no = {
|
no = {
|
||||||
name = "";
|
name = "";
|
||||||
@ -178,19 +173,19 @@ in
|
|||||||
stylix.targets.gtk.extraCss = # css
|
stylix.targets.gtk.extraCss = # css
|
||||||
''
|
''
|
||||||
phosh-lockscreen {
|
phosh-lockscreen {
|
||||||
background: ${bg}, url('${phosh-backgrounds}/wall-lock.jpg');
|
background: url('${phosh-backgrounds}/wall-lock.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
phosh-app-grid {
|
phosh-app-grid {
|
||||||
background: ${bg}, url('${phosh-backgrounds}/wall-grid.jpg');
|
background: url('${phosh-backgrounds}/wall-grid.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
phosh-top-panel {
|
phosh-top-panel {
|
||||||
background: ${bg}, url('${phosh-backgrounds}/wall-panel.jpg');
|
background: url('${phosh-backgrounds}/wall-panel.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
phosh-home {
|
phosh-home {
|
||||||
background: ${bg}, url('${phosh-backgrounds}/wall-home.jpg');
|
background: url('${phosh-backgrounds}/wall-home.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
phosh-lockscreen, phosh-app-grid, phosh-top-panel, phosh-home {
|
phosh-lockscreen, phosh-app-grid, phosh-top-panel, phosh-home {
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
lib,
|
lib,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
|
fd,
|
||||||
|
imagemagick,
|
||||||
|
color ? "181818",
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
@ -34,6 +37,11 @@ stdenvNoCC.mkDerivation {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
fd
|
||||||
|
imagemagick
|
||||||
|
];
|
||||||
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
runHook preUnpack
|
runHook preUnpack
|
||||||
|
|
||||||
@ -47,7 +55,8 @@ stdenvNoCC.mkDerivation {
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
install -Dm644 *.jpg -t $out
|
mkdir -p $out
|
||||||
|
fd -e jpg -x magick "{}" -fill "#${color}" -colorize 30% "$out/{.}.jpg"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user