#!/usr/bin/env bash
grab &>/dev/null
bash /usr/local/bin/StratOS-configure-gnome
if [[ -d /bedrock ]]; then
    bash /usr/local/bin/enable-display-manager
    python /opt/maneki-neko/main.py # don't execute in the live env
    ping -c 1 gnu.org
    if [[ $? -ne 0 ]]; then
	notify-send "No internet connection found. This script will execute when the device is connected to the internet. Exiting."
	exit 1
    fi
    notify-send "Bootstrapping Ubuntu..."
    pkexec /bedrock/bin/brl fetch ubuntu
    notify-send "Cleaning up..."
    pkexec sed 's/timeout = 30/timeout = 0/g' -i /bedrock/etc/bedrock.conf # make this change regardless of whether a distro is installed or not
    rm -f $HOME/.config/autostart/ubuntu.desktop
    sudo apt update
    sudo apt -y upgrade
	sudo apt -y install nala
    notify-send 'Ubuntu bootstrapped successfully.'
fi
