Update 2 files

- /home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl
- /home/dot_local/bin/executable_install-program
This commit is contained in:
Brian Zalewski 2023-01-09 11:21:22 +00:00
parent 42c53e5021
commit 6fb8cbbf3d
2 changed files with 7 additions and 3 deletions

View file

@ -46,7 +46,8 @@ async function applyGsettings(settings) {
try { try {
const gsetting = setting.setting const gsetting = setting.setting
const gsettingVal = setting.value const gsettingVal = setting.value
await $`gsettings set ` + gsetting + `${gsettingVal}` const gsettingCmd = 'gsettings set ' + gsetting + ' ' + gsettingVal
await $gsettingCmd
} catch (e) { } catch (e) {
log('error', 'Gsettings Failure', 'Failed to apply gsetting') log('error', 'Gsettings Failure', 'Failed to apply gsetting')
console.error(e) console.error(e)
@ -79,7 +80,8 @@ async function applyDconfSettings(settings) {
if (dconf) { if (dconf) {
for (const setting of settings) { for (const setting of settings) {
try { try {
await $`dconf write ${setting.key} ` + setting.value const dconfCmd = 'dconf write ' + setting.key + ' ' + setting.value
await $dconfCmd
} catch (e) { } catch (e) {
log('error', 'Dconf Failure', 'Failed to apply dconf setting') log('error', 'Dconf Failure', 'Failed to apply dconf setting')
console.error(e) console.error(e)
@ -94,7 +96,6 @@ async function main() {
const promises = [loadThemeSettings(), loadGnomeSettings()] const promises = [loadThemeSettings(), loadGnomeSettings()]
const results = await Promise.all(promises) const results = await Promise.all(promises)
const themeSettings = results[0] const themeSettings = results[0]
console.log(themeSettings)
const gnomeSettings = results[1] const gnomeSettings = results[1]
const settingsPromises = [] const settingsPromises = []
if (themeSettings && themeSettings.gsetting_configs) { if (themeSettings && themeSettings.gsetting_configs) {

View file

@ -635,6 +635,9 @@ async function beforeInstall(packageManager) {
updateDone[packageManager] = true updateDone[packageManager] = true
const logStage = 'Pre-Install Package Manager' const logStage = 'Pre-Install Package Manager'
if (packageManager === 'appimage') { if (packageManager === 'appimage') {
if(!fileExists(`${process.env.HOME}/Applications)) {
runSilentCommand(`mkdir -p "${process.env.HOME}/Applications"`)
}
} else if (packageManager === 'ansible') { } else if (packageManager === 'ansible') {
log('info', logStage, `Temporarily enabling passwordless sudo for Ansible role installations`) log('info', logStage, `Temporarily enabling passwordless sudo for Ansible role installations`)
await $`echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR ANSIBLE INSTALL" | sudo tee -a /etc/sudoers` await $`echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR ANSIBLE INSTALL" | sudo tee -a /etc/sudoers`