mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-15 02:02:08 -04:00
nix: fix greeter custom theme (#954)
This commit is contained in:
@@ -10,13 +10,14 @@
|
|||||||
|
|
||||||
user = config.services.greetd.settings.default_session.user;
|
user = config.services.greetd.settings.default_session.user;
|
||||||
|
|
||||||
|
cacheDir = "/var/lib/dms-greeter";
|
||||||
greeterScript = pkgs.writeShellScriptBin "dms-greeter" ''
|
greeterScript = pkgs.writeShellScriptBin "dms-greeter" ''
|
||||||
export PATH=$PATH:${lib.makeBinPath [cfg.quickshell.package config.programs.${cfg.compositor.name}.package]}
|
export PATH=$PATH:${lib.makeBinPath [cfg.quickshell.package config.programs.${cfg.compositor.name}.package]}
|
||||||
${lib.escapeShellArgs ([
|
${lib.escapeShellArgs ([
|
||||||
"sh"
|
"sh"
|
||||||
"${../../quickshell/Modules/Greetd/assets/dms-greeter}"
|
"${../../quickshell/Modules/Greetd/assets/dms-greeter}"
|
||||||
"--cache-dir"
|
"--cache-dir"
|
||||||
"/var/lib/dmsgreeter"
|
cacheDir
|
||||||
"--command"
|
"--command"
|
||||||
cfg.compositor.name
|
cfg.compositor.name
|
||||||
"-p"
|
"-p"
|
||||||
@@ -27,6 +28,8 @@
|
|||||||
"${pkgs.writeText "dmsgreeter-compositor-config" cfg.compositor.customConfig}"
|
"${pkgs.writeText "dmsgreeter-compositor-config" cfg.compositor.customConfig}"
|
||||||
])} ${lib.optionalString cfg.logs.save "> ${cfg.logs.path} 2>&1"}
|
])} ${lib.optionalString cfg.logs.save "> ${cfg.logs.path} 2>&1"}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
jq = lib.getExe pkgs.jq;
|
||||||
in {
|
in {
|
||||||
imports = let
|
imports = let
|
||||||
msg = "The option 'programs.dankMaterialShell.greeter.compositor.extraConfig' is deprecated. Please use 'programs.dankMaterialShell.greeter.compositor.customConfig' instead.";
|
msg = "The option 'programs.dankMaterialShell.greeter.compositor.extraConfig' is deprecated. Please use 'programs.dankMaterialShell.greeter.compositor.customConfig' instead.";
|
||||||
@@ -93,17 +96,17 @@ in {
|
|||||||
material-symbols
|
material-symbols
|
||||||
];
|
];
|
||||||
systemd.tmpfiles.settings."10-dmsgreeter" = {
|
systemd.tmpfiles.settings."10-dmsgreeter" = {
|
||||||
"/var/lib/dmsgreeter".d = {
|
${cacheDir}.d = {
|
||||||
user = user;
|
user = user;
|
||||||
group =
|
group =
|
||||||
if config.users.users.${user}.group != ""
|
if config.users.users.${user}.group != ""
|
||||||
then config.users.users.${user}.group
|
then config.users.users.${user}.group
|
||||||
else "greeter";
|
else "greeter";
|
||||||
mode = "0755";
|
mode = "0750";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.services.greetd.preStart = ''
|
systemd.services.greetd.preStart = ''
|
||||||
cd /var/lib/dmsgreeter
|
cd ${cacheDir}
|
||||||
${lib.concatStringsSep "\n" (lib.map (f: ''
|
${lib.concatStringsSep "\n" (lib.map (f: ''
|
||||||
if [ -f "${f}" ]; then
|
if [ -f "${f}" ]; then
|
||||||
cp "${f}" .
|
cp "${f}" .
|
||||||
@@ -112,9 +115,16 @@ in {
|
|||||||
cfg.configFiles)}
|
cfg.configFiles)}
|
||||||
|
|
||||||
if [ -f session.json ]; then
|
if [ -f session.json ]; then
|
||||||
if cp "$(${lib.getExe pkgs.jq} -r '.wallpaperPath' session.json)" wallpaper.jpg; then
|
if cp "$(${jq} -r '.wallpaperPath' session.json)" wallpaper.jpg; then
|
||||||
mv session.json session.orig.json
|
mv session.json session.orig.json
|
||||||
${lib.getExe pkgs.jq} '.wallpaperPath = "/var/lib/dmsgreeter/wallpaper.jpg"' session.orig.json > session.json
|
${jq} '.wallpaperPath = "${cacheDir}/wallpaper.jpg"' session.orig.json > session.json
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f settings.json ]; then
|
||||||
|
if cp "$(${jq} -r '.customThemeFile' settings.json)" custom-theme.json; then
|
||||||
|
mv settings.json settings.orig.json
|
||||||
|
${jq} '.customThemeFile = "${cacheDir}/custom-theme.json"' settings.orig.json > settings.json
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user