Update .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_12-update-dom0, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_11-update-timezone, .local/share/chezmoi/system/etc/yum.repos.d/qubes-dom0.repo, .local/share/chezmoi/system/etc/qubes/repo-templates/qubes-templates.repo, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_13-install-official-templates, .local/share/chezmoi/home/.chezmoidata.yaml, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_14-ensure-minimal-vms-passwordless, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_15-install-unofficial-templates, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_16-update-template-vms, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_17-install-mirage-firewall, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_18-configure-sys-usb, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_19-setup-sys-gui, .local/share/chezmoi/system/etc/grub.d/31-hold-shift, .local/share/chezmoi/system/etc/default/modify_grub, .local/share/chezmoi/system/.chezmoidata.yaml, .local/share/chezmoi/system/.chezmoiexternal.toml, .local/share/chezmoi/system/usr/share/run_onchange_after_setup-share-folder, .local/share/chezmoi/system/boot/efi/EFI/qubes/modify_grubenv, .local/share/chezmoi/system/etc/sddm.conf, .local/share/chezmoi/system/etc/modify_environment
2022-12-06 00:59:10 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-12-25 01:09:00 -08:00
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
|
|
{{ includeTemplate "universal/logg" }}
|
|
|
|
|
Update .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_12-update-dom0, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_11-update-timezone, .local/share/chezmoi/system/etc/yum.repos.d/qubes-dom0.repo, .local/share/chezmoi/system/etc/qubes/repo-templates/qubes-templates.repo, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_13-install-official-templates, .local/share/chezmoi/home/.chezmoidata.yaml, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_14-ensure-minimal-vms-passwordless, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_15-install-unofficial-templates, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_16-update-template-vms, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_17-install-mirage-firewall, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_18-configure-sys-usb, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_19-setup-sys-gui, .local/share/chezmoi/system/etc/grub.d/31-hold-shift, .local/share/chezmoi/system/etc/default/modify_grub, .local/share/chezmoi/system/.chezmoidata.yaml, .local/share/chezmoi/system/.chezmoiexternal.toml, .local/share/chezmoi/system/usr/share/run_onchange_after_setup-share-folder, .local/share/chezmoi/system/boot/efi/EFI/qubes/modify_grubenv, .local/share/chezmoi/system/etc/sddm.conf, .local/share/chezmoi/system/etc/modify_environment
2022-12-06 00:59:10 -08:00
|
|
|
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.stdout }} -v width={{ screen_width.stdout }} 'BEGIN { print ((height / width) * 1000) }')"
|
|
|
|
SCREEN_RATIO="${SCREEN_RATIO%.*}"
|
|
|
|
SCREEN_RATIO_ULTRAWIDE="2100"
|
|
|
|
GRUB_RESOLUTION_TYPE="1080p"
|
|
|
|
|
|
|
|
### Determine if screen is ultrawide
|
|
|
|
if (( $(echo "$SCREEN_RATIO $SCREEN_RATIO_ULTRAWIDE" | awk '{print ($1 > $2)}') )); then
|
|
|
|
GRUB_RESOLUTION_TYPE="ultrawide"
|
|
|
|
fi
|
|
|
|
|
|
|
|
### Optimize the GRUB resolution
|
|
|
|
logg info 'Optimizing the GRUB resolution'
|
|
|
|
if cat /etc/default/grub | grep GRUB_GFX_MODE; then
|
|
|
|
sudo sed -i '/.*GRUB_GFXMODE.*/GRUB_GFXMODE=auto/' /etc/default/grub
|
|
|
|
else
|
|
|
|
echo "GRUB_GFXMODE=auto" | sudo tee -a /etc/default/grub
|
|
|
|
fi
|
|
|
|
|
|
|
|
### Add GRUB_GFXPAYLOAD_LINUX=keep
|
|
|
|
logg info 'Ensuring GRUB_GFXPAYLOAD_LINUX is set to keep'
|
|
|
|
if cat /etc/default/grub | grep GRUB_GFXPAYLOAD_LINUX; then
|
|
|
|
sudo sed -i '/.*GRUB_GFXPAYLOAD_LINUX.*/GRUB_GFXPAYLOAD_LINUX="keep"/' /etc/default/grub
|
|
|
|
else
|
|
|
|
echo 'GRUB_GFXPAYLOAD_LINUX="keep"' | sudo tee -a /etc/default/grub
|
|
|
|
fi
|
|
|
|
|
|
|
|
### Set GRUB theme
|
|
|
|
logg info "Setting GRUB2 theme to {{ .theme }}-$GRUB_RESOLUTION_TYPE"
|
|
|
|
if cat /etc/default/grub | grep GRUB_THEME; then
|
|
|
|
sudo sed -i '/.*GRUB_THEME.*/GRUB_THEME="{{ .theme }}-'"$GRUB_RESOLUTION_TYPE"'"/' /etc/default/grub
|
|
|
|
else
|
|
|
|
echo 'GRUB_THEME="{{ .theme }}-'"$GRUB_RESOLUTION_TYPE"'"' | sudo tee -a /etc/default/grub
|
|
|
|
fi
|
|
|
|
|
|
|
|
### Set GRUB background
|
|
|
|
logg info 'Set GRUB background to prevent FOUC'
|
|
|
|
if cat /etc/default/grub | grep GRUB_BACKGROUND; then
|
|
|
|
sudo sed -i '/.*GRUB_BACKGROUND.*/GRUB_BACKGROUND="/usr/local/share/grub/{{ .theme }}-blue.png"/' /etc/default/grub
|
|
|
|
else
|
|
|
|
echo 'GRUB_BACKGROUND="/usr/local/share/grub/{{ .theme }}-blue.png"' | sudo tee -a /etc/default/grub
|
|
|
|
fi
|
|
|
|
|
|
|
|
### Configure Shift to see menu feature
|
|
|
|
logg info 'Configuring Shift to see GRUB2 menu feature'
|
|
|
|
sed -i '/GRUB_FORCE_HIDDEN_MENU/d' /etc/default/grub
|
|
|
|
echo "GRUB_FORCE_HIDDEN_MENU={{ .grub.shiftToSeeMenu }}" > /etc/default/grub
|
|
|
|
|
|
|
|
### Remove duplicate lines
|
|
|
|
logg info 'Ensuring there are no duplicate entries in /etc/default/grub'
|
|
|
|
cat /etc/default/grub | uniq -u | sudo tee /etc/default/grub
|