re-add functionality

This file is needed to restore preview and flatpak update functionality
This commit is contained in:
AustrianToast 2024-09-08 22:48:27 +02:00
parent 81b07991aa
commit e2d4253050
Signed by: AustrianToast
GPG Key ID: 1B4D0AAF6E558816

30
update.zsh Normal file
View File

@ -0,0 +1,30 @@
preview() {
yay -Syy && yay -Qu
[[ -x /usr/bin/flatpak ]] && flatpak remote-ls --updates
}
flatpak-update() {
TMP="/tmp/update"
DATE="$(date +"%Y-%m-%dT%H:%M:%S%:z")"
BACKUP_LOCATION="/opt"
[[ -d $TMP ]] && rm --recursive --force "$TMP"
mkdir --parents "$TMP"/before-backup_"$DATE" "$TMP"/after-backup_"$DATE"
flatpak list --all --show-details > "$TMP"/before-backup_"$DATE"/flatpak-before.txt
tar --create --zstd --file "$TMP"/before-backup_"$DATE".tar.zst "$TMP"/before-backup_"$DATE"
flatpak update --assumeyes
flatpak list --all --show-details > "$TMP"/after-backup_"$DATE"/flatpak-after.txt
tar --create --zstd --file "$TMP"/after-backup_"$DATE".tar.zst "$TMP"/after-backup_"$DATE"
rsync -a "$TMP"/before-backup_"$DATE".tar.zst "$TMP"/after-backup_"$DATE".tar.zst "$BACKUP_LOCATION"
rm --recursive --force "$TMP"
}
update () {
yay
flatpak-update
}