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:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user