#!/bin/bash

echo "Disabling automatic apt services..."
sudo systemctl disable apt-daily.service
sudo systemctl disable apt-daily.timer
sudo systemctl disable apt-daily-upgrade.service
sudo systemctl disable apt-daily-upgrade.timer

echo "Disabling update-notifier popups..."
mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/update-notifier.desktop ~/.config/autostart/ 2>/dev/null
echo "Hidden=true" >> ~/.config/autostart/update-notifier.desktop

echo "Disabling GNOME Software update notifications..."
gsettings set org.gnome.software download-updates false
gsettings set org.gnome.software download-updates-notify false

# Optional: Uncomment to completely remove unattended-upgrades
# echo "Removing unattended-upgrades package..."
# sudo apt remove -y unattended-upgrades

echo "All automatic update popups and background update services disabled!"
