From f607256295ba979f7b6ff953ee3aa9f7c2ea447f Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Tue, 10 Jan 2023 09:02:52 +0000 Subject: [PATCH] Update file run_onchange_after_64-grub-settings.tmpl --- .../universal/run_onchange_after_64-grub-settings.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl index ab4e3b53..885e0ac0 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl @@ -29,7 +29,7 @@ SCREEN_RATIO_ULTRAWIDE="2100" GRUB_RESOLUTION_TYPE="1080p" ### Determine screen size ratio (used for picking GRUB2 theme resolution) -if command -v xrandr && command -v uniq; then +if command -v xrandr > /dev/null && command -v uniq > /dev/null; then SCREEN_WIDTH="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)" SCREEN_HEIGHT="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2)" SCREEN_RATIO="$(awk -v height="$SCREEN_HEIGHT" -v width="$SCREEN_WIDTH" 'BEGIN { print ((height / width) * 1000) }')" @@ -87,8 +87,8 @@ if [ -f /etc/default/grub ]; then ### GRUB_FORCE_HIDDEN_MENU logg info 'Setting GRUB_FORCE_HIDDEN_MENU={{ .grub.shiftToSee }} in /etc/default/grub' - sed -i '/GRUB_FORCE_HIDDEN_MENU/d' /etc/default/grub - echo "GRUB_FORCE_HIDDEN_MENU={{ .grub.shiftToSee }}" > /etc/default/grub + sudo sed -i '/GRUB_FORCE_HIDDEN_MENU/d' /etc/default/grub + echo "GRUB_FORCE_HIDDEN_MENU={{ .grub.shiftToSee }}" | sudo tee -a /etc/default/grub ### Remove duplicate lines in /etc/default/grub logg info 'Ensuring there are no duplicate entries in /etc/default/grub'