Fix wallpaper path handling with spaces (#908)

* Fix wallpaper path handling with spaces

* fix linting errors

---------

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
Sumit Pathak
2025-04-29 05:46:56 +05:30
committed by GitHub
parent 07a990f1f8
commit 0c82ce9704
4 changed files with 8 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ class Wallpaper extends GObject.Object {
'60',
'--transition-pos',
cursorPosition.replace(' ', ''),
WP,
`"${WP}"`,
].join(' ');
sh(transitionCmd)
@@ -50,7 +50,7 @@ class Wallpaper extends GObject.Object {
this.#blockMonitor = true;
try {
await sh(`cp ${path} ${WP}`);
await sh(`cp "${path}" "${WP}"`);
this.#wallpaper();
} catch (error) {
console.error('Error setting wallpaper:', error);

View File

@@ -30,9 +30,11 @@ export async function generateMatugenColors(): Promise<MatugenColors | undefined
const normalizedContrast = contrast.get() > 1 ? 1 : contrast.get() < -1 ? -1 : contrast.get();
const contents = await bash(
`matugen image --dry-run -q ${wallpaperPath} -t scheme-${scheme_type.get()} --contrast ${normalizedContrast} --json hex`,
`matugen image --dry-run -q "${wallpaperPath}" -t scheme-${scheme_type.get()} --contrast ${normalizedContrast} --json hex`,
);
await bash(
`matugen image -q "${wallpaperPath}" -t scheme-${scheme_type.get()} --contrast ${normalizedContrast}`,
);
await bash(`matugen image -q ${wallpaperPath} -t scheme-${scheme_type.get()} --contrast ${normalizedContrast}`);
return JSON.parse(contents).colors[options.theme.matugen_settings.mode.get()];
} catch (error) {