mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-24 09:13:09 +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 (config.modules.system) username;
|
||||
inherit (builtins) attrValues;
|
||||
inherit (self.packages.${pkgs.system}) phosh-backgrounds;
|
||||
|
||||
getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}";
|
||||
|
||||
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"})'';
|
||||
phosh-backgrounds = self.packages.${pkgs.system}.phosh-backgrounds.override {
|
||||
color = config.lib.stylix.colors.base00;
|
||||
};
|
||||
|
||||
no = {
|
||||
name = "";
|
||||
@ -178,19 +173,19 @@ in
|
||||
stylix.targets.gtk.extraCss = # css
|
||||
''
|
||||
phosh-lockscreen {
|
||||
background: ${bg}, url('${phosh-backgrounds}/wall-lock.jpg');
|
||||
background: url('${phosh-backgrounds}/wall-lock.jpg');
|
||||
}
|
||||
|
||||
phosh-app-grid {
|
||||
background: ${bg}, url('${phosh-backgrounds}/wall-grid.jpg');
|
||||
background: url('${phosh-backgrounds}/wall-grid.jpg');
|
||||
}
|
||||
|
||||
phosh-top-panel {
|
||||
background: ${bg}, url('${phosh-backgrounds}/wall-panel.jpg');
|
||||
background: url('${phosh-backgrounds}/wall-panel.jpg');
|
||||
}
|
||||
|
||||
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 {
|
||||
|
@ -2,6 +2,9 @@
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchurl,
|
||||
fd,
|
||||
imagemagick,
|
||||
color ? "181818",
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
@ -34,6 +37,11 @@ stdenvNoCC.mkDerivation {
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
fd
|
||||
imagemagick
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
|
||||
@ -47,7 +55,8 @@ stdenvNoCC.mkDerivation {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm644 *.jpg -t $out
|
||||
mkdir -p $out
|
||||
fd -e jpg -x magick "{}" -fill "#${color}" -colorize 30% "$out/{.}.jpg"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user