install.fairie/system/usr/local/share/run_onchange_after_setup-share-folder

28 lines
992 B
Text
Raw Normal View History

#!/usr/bin/env bash
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
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