From 308219bae7a82fdbfa77360295dd878348f647ce Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 9 Jan 2023 02:35:05 +0000 Subject: [PATCH] Update 2 files - /home/dot_local/bin/executable_install-program - /home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl --- ..._onchange_after_20-apply-settings.mjs.tmpl | 58 +++++++++++++------ home/dot_local/bin/executable_install-program | 2 +- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl index 69c41275..f530f322 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl @@ -40,36 +40,56 @@ async function loadGnomeSettings() { } async function applyGsettings(settings) { - for (const setting of settings) { - try { - await $`gsettings set ${setting.setting} ${setting.value}` - } catch (e) { - log('error', 'Gsettings Failure', 'Failed to apply gsetting') - console.error(e) + const gsettings = which.sync('gsettings', { nothrow: true }) + if (gsettings) { + for (const setting of settings) { + try { + console.log(setting.setting) + console.log('-- val ---') + console.log(setting.value) + const gsetting = setting.setting + const gsettingVal = setting.value + await $`gsettings set ${gsetting} ${gsettingVal}` + } catch (e) { + log('error', 'Gsettings Failure', 'Failed to apply gsetting') + console.error(e) + } } + } else { + log('info', 'Gsettings Not Installed', 'gsettings does not appear to be available') } } async function applyXconfSettings(settings) { - for (const setting of settings) { - try { - const xfconfType = setting.value_type ? setting.value_type : 'string' - await $`xfconf-query --channel '${setting.channel}' --property '${setting.property}' --type ${xfconfType} --set ${setting.value}` - } catch (e) { - log('error', 'Xfconf Failure', 'Failed to apply gsetting') - console.error(e) + const xfconfQuery = which.sync('xfconf-query', { nothrow: true }) + if (xfconfQuery) { + for (const setting of settings) { + try { + const xfconfType = setting.value_type ? setting.value_type : 'string' + await $`xfconf-query --channel '${setting.channel}' --property '${setting.property}' --type ${xfconfType} --set ${setting.value}` + } catch (e) { + log('error', 'Xfconf Failure', 'Failed to apply gsetting') + console.error(e) + } } + } else { + log('info', 'xfconf-query Not Installed', 'xfconf-query does not appear to be available') } } async function applyDconfSettings(settings) { - for (const setting of settings) { - try { - await $`dconf write ${setting.key} ${setting.value}` - } catch (e) { - log('error', 'Dconf Failure', 'Failed to apply dconf setting') - console.error(e) + const dconf = which.sync('dconf', { nothrow: true }) + if (dconf) { + for (const setting of settings) { + try { + await $`dconf write ${setting.key} ${setting.value}` + } catch (e) { + log('error', 'Dconf Failure', 'Failed to apply dconf setting') + console.error(e) + } } + } else { + log('info', 'Dconf Not Installed', 'dconf does not appear to be available') } } diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index 56f82d28..f61dad6a 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -1437,7 +1437,7 @@ async function pruneInstallOrders(installOrders) { } }) } else if (pkgManager === 'flatpak') { - const flatpakInstallation = await $`flatpak --installation` + const flatpakInstallation = await $`flatpak --installations` newOrders[pkgManager] = await asyncFilter(newOrders[pkgManager], async (pkg) => { try { await runSilentCommand(`test -d ${flatpakInstallation}/app/${pkg}`)