Update 2 files

- /home/dot_local/bin/executable_install-program
- /home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl
This commit is contained in:
Brian Zalewski 2023-01-09 02:35:05 +00:00
parent b3ac99fecc
commit 308219bae7
2 changed files with 40 additions and 20 deletions

View file

@ -40,36 +40,56 @@ async function loadGnomeSettings() {
} }
async function applyGsettings(settings) { async function applyGsettings(settings) {
for (const setting of settings) { const gsettings = which.sync('gsettings', { nothrow: true })
try { if (gsettings) {
await $`gsettings set ${setting.setting} ${setting.value}` for (const setting of settings) {
} catch (e) { try {
log('error', 'Gsettings Failure', 'Failed to apply gsetting') console.log(setting.setting)
console.error(e) 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) { async function applyXconfSettings(settings) {
for (const setting of settings) { const xfconfQuery = which.sync('xfconf-query', { nothrow: true })
try { if (xfconfQuery) {
const xfconfType = setting.value_type ? setting.value_type : 'string' for (const setting of settings) {
await $`xfconf-query --channel '${setting.channel}' --property '${setting.property}' --type ${xfconfType} --set ${setting.value}` try {
} catch (e) { const xfconfType = setting.value_type ? setting.value_type : 'string'
log('error', 'Xfconf Failure', 'Failed to apply gsetting') await $`xfconf-query --channel '${setting.channel}' --property '${setting.property}' --type ${xfconfType} --set ${setting.value}`
console.error(e) } 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) { async function applyDconfSettings(settings) {
for (const setting of settings) { const dconf = which.sync('dconf', { nothrow: true })
try { if (dconf) {
await $`dconf write ${setting.key} ${setting.value}` for (const setting of settings) {
} catch (e) { try {
log('error', 'Dconf Failure', 'Failed to apply dconf setting') await $`dconf write ${setting.key} ${setting.value}`
console.error(e) } 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')
} }
} }

View file

@ -1437,7 +1437,7 @@ async function pruneInstallOrders(installOrders) {
} }
}) })
} else if (pkgManager === 'flatpak') { } else if (pkgManager === 'flatpak') {
const flatpakInstallation = await $`flatpak --installation` const flatpakInstallation = await $`flatpak --installations`
newOrders[pkgManager] = await asyncFilter(newOrders[pkgManager], async (pkg) => { newOrders[pkgManager] = await asyncFilter(newOrders[pkgManager], async (pkg) => {
try { try {
await runSilentCommand(`test -d ${flatpakInstallation}/app/${pkg}`) await runSilentCommand(`test -d ${flatpakInstallation}/app/${pkg}`)