#!/bin/bash

# Copyright 2024 Zorin OS Technologies Ltd.
#
# This program is free software you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 3, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT ANY
# WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
# more details.

if grep -zq casper /proc/cmdline; then
	installer=~/Desktop/ubiquity.desktop
	if [[ -f "$installer" ]]; then
		chmod +x "$installer"
		gio set -t string "$installer" metadata::xfce-exe-checksum "$(sha256sum $installer | awk '{print $1}')"
	fi
fi

if [[ -e ~/.config/autostart/zorin-installer-trusted-autostart.desktop ]]; then
	rm ~/.config/autostart/zorin-installer-trusted-autostart.desktop
fi
