From f79af8f76b0e285da6379c26dd9030c8648017ba Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Thu, 2 Feb 2023 02:58:49 +0000 Subject: [PATCH] Update file run_onchange_after_61-plymouth-settings.tmpl --- ...n_onchange_after_61-plymouth-settings.tmpl | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl index c81e0b97..0a5d538c 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl @@ -9,6 +9,21 @@ if command -v install-software > /dev/null; then install-software plymouth fi +### Create /etc/plymouth/plymouthd.conf +if [ -f /etc/plymouth/plymouthd.conf ]; then + ### Back up original plymouthd.conf + if [ ! -f /etc/plymouth/plymouthd.conf.bak ]; then + logg info 'Backing up /etc/plymouth/plymouthd.conf to /etc/plymouth/plymouthd.conf.bak' + sudo cp -f /etc/plymouth/plymouthd.conf /etc/plymouth/plymouthd.conf.bak + fi + + ### Create new plymouthd.conf + logg info 'Populating the /etc/plymouth/plymouthd.conf file' + echo "[Daemon]" | sudo tee /etc/plymouth/plymouthd.conf > /dev/null + echo "Theme={{ .theme }}" | sudo tee -a /etc/plymouth/plymouthd.conf > /dev/null + echo "ShowDelay=1" | sudo tee -a /etc/plymouth/plymouthd.conf > /dev/null +fi + ### Apply update-alternatives if command -v update-alternatives > /dev/null; then if [ -f "/usr/local/share/plymouth/themes/{{ .theme }}/{{ .theme }}.plymouth" ]; then @@ -25,16 +40,17 @@ else fi ### Update /etc/plymouth/plymouthd.conf -if [ -f /etc/plymouth/plymouthd.conf ]; then - logg info 'Setting ShowDelay=1 in /etc/plymouth/plymouthd.conf' - if cat /etc/plymouth/plymouthd.conf | grep ShowDelay; then - sudo sed -i 's/^ShowDelay=.*/ShowDelay=1/' /etc/plymouth/plymouthd.conf - else - echo 'ShowDelay=1' | sudo tee -a /etc/plymouth/plymouthd.conf > /dev/null - fi -else - logg warn '/etc/plymouth/plymouthd.conf does not exist!' -fi +# Replaced by code above +# if [ -f /etc/plymouth/plymouthd.conf ]; then +# logg info 'Setting ShowDelay=1 in /etc/plymouth/plymouthd.conf' +# if cat /etc/plymouth/plymouthd.conf | grep ShowDelay; then +# sudo sed -i 's/^ShowDelay=.*/ShowDelay=1/' /etc/plymouth/plymouthd.conf +# else +# echo 'ShowDelay=1' | sudo tee -a /etc/plymouth/plymouthd.conf > /dev/null +# fi +# else +# logg warn '/etc/plymouth/plymouthd.conf does not exist!' +# fi ### Symlink /usr/local/share/plymouth/themes to /usr/share/plymouth/themes if [ ! -d '/usr/share/plymouth/themes/{{ .theme }}' ]; then