From 96b853c3c252ca027c043354fe28b4c8d2835322 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Tue, 6 Dec 2022 09:38:28 +0000 Subject: [PATCH] Update .local/share/chezmoi/system/usr/local/share/run_onchange_after_setup-share-folder, .local/share/chezmoi/system/usr/local/bin/executable_squash-symlink, .local/share/chezmoi/home/dot_local/bin/executable_squash-symlink, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_12-update-dom0, .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_after_11-set-wallpaper --- .../qubes/run_onchange_after_11-set-wallpaper | 3 +++ .../qubes/run_onchange_before_12-update-dom0 | 10 ++++++++ .../dot_local/bin/executable_squash-symlink | 18 ++++++++++++++ .../usr/local/bin/executable_squash-symlink | 18 ++++++++++++++ .../run_onchange_after_setup-share-folder | 24 +++++++++++++++++++ 5 files changed, 73 insertions(+) create mode 100644 .local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_after_11-set-wallpaper create mode 100644 .local/share/chezmoi/home/dot_local/bin/executable_squash-symlink create mode 100644 .local/share/chezmoi/system/usr/local/bin/executable_squash-symlink create mode 100644 .local/share/chezmoi/system/usr/local/share/run_onchange_after_setup-share-folder diff --git a/.local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_after_11-set-wallpaper b/.local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_after_11-set-wallpaper new file mode 100644 index 00000000..6c59a56f --- /dev/null +++ b/.local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_after_11-set-wallpaper @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ksetwallpaper --file /usr/local/share/wallpapers/Betelgeuse/contents/images/3440x1440.jpg diff --git a/.local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_12-update-dom0 b/.local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_12-update-dom0 index f592d94e..a13dbc17 100644 --- a/.local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_12-update-dom0 +++ b/.local/share/chezmoi/home/.chezmoiscripts/qubes/run_onchange_before_12-update-dom0 @@ -6,6 +6,16 @@ sudo qubesctl --show-output state.sls update.qubes-dom0 logg info 'Updating dom0 via `qubes-dom0-update`' sudo qubes-dom0-update --clean -y +### Install qubes-repo-contrib +logg info "Installing qubes-repo-contrib" +sudo qubes-dom0-update -y qubes-repo-contrib + +### Install dependencies +for PACKAGE of latte-dock nautilus nautilus-gtkhash nautilus-search-tool kde-settings-qubes kdeplasma-addons konsole kscreen kvantum plymouth-kcm sssd-kcm sddm-kcm; do + logg info "Installing $PACKAGE" + sudo qubes-dom0-update -y "$PACKAGE" || true +done + ### Ensure sys-whonix is running logg info 'Ensuring `sys-whonix` is running' qvm-start sys-whonix --skip-if-running diff --git a/.local/share/chezmoi/home/dot_local/bin/executable_squash-symlink b/.local/share/chezmoi/home/dot_local/bin/executable_squash-symlink new file mode 100644 index 00000000..2dcd435c --- /dev/null +++ b/.local/share/chezmoi/home/dot_local/bin/executable_squash-symlink @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e +for link; do + test -h "$link" || continue + dir=$(dirname "$link") + reltarget=$(readlink "$link") + case $reltarget in + /*) abstarget=$reltarget;; + *) abstarget=$dir/$reltarget;; + esac + rm -fv "$link" + cp -afv "$abstarget" "$link" || { + # Restore link on failure + rm -rfv "$link" + ln -sfv "$reltarget" "$link" + } +done diff --git a/.local/share/chezmoi/system/usr/local/bin/executable_squash-symlink b/.local/share/chezmoi/system/usr/local/bin/executable_squash-symlink new file mode 100644 index 00000000..2dcd435c --- /dev/null +++ b/.local/share/chezmoi/system/usr/local/bin/executable_squash-symlink @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e +for link; do + test -h "$link" || continue + dir=$(dirname "$link") + reltarget=$(readlink "$link") + case $reltarget in + /*) abstarget=$reltarget;; + *) abstarget=$dir/$reltarget;; + esac + rm -fv "$link" + cp -afv "$abstarget" "$link" || { + # Restore link on failure + rm -rfv "$link" + ln -sfv "$reltarget" "$link" + } +done diff --git a/.local/share/chezmoi/system/usr/local/share/run_onchange_after_setup-share-folder b/.local/share/chezmoi/system/usr/local/share/run_onchange_after_setup-share-folder new file mode 100644 index 00000000..a08e4fd3 --- /dev/null +++ b/.local/share/chezmoi/system/usr/local/share/run_onchange_after_setup-share-folder @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +logg info 'Ensure /usr/local/share is a directory' +sudo mkdir -p /usr/local/share + +logg info 'Clean up old theme files' +for ITEM_TO_BE_REMOVED of "/usr/share/backgrounds/images" "/usr/share/backgrounds/f32" "/usr/share/backgrounds/qubes" "/usr/share/wallpapers"; do + if [ -d "$ITEM_TO_BE_REMOVED" ] || [ -f "$ITEM_TO_BE_REMOVED" ]; then + logg info "Removing $ITEM_TO_BE_REMOVED" + sudo rm -rf "$ITEM_TO_BE_REMOVED" + fi +fi + +logg info 'Copy /usr/local/src/{{ .theme }}/share to /usr/local/share' +sudo cp -rf /usr/local/src/{{ .theme }}/share/ /usr/local/share + +logg info 'Converting all symlinks to equivalent regular files' +sudo find /usr/local/src -type l -exec squash-symlink {} + + +logg info 'Ensure /boot/grub2/themes is a directory' +sudo mkdir -p /boot/grub2/themes + +logg info 'Copy GRUB themes to /boot/grub2/themes' +sudo cp -rf /usr/local/share/grub/themes/ /boot/grub2/themes