aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Distro_update.sh
blob: c687ba0ceff67d3c00bd251ebccc6b97d02c594d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */  ##
# Simple bash script to check and will try to update your system

# Local Paths
iDIR="$HOME/.config/swaync/images/ja.png"

# Check for required tools (kitty)
if ! command -v kitty &> /dev/null; then
  notify-send -i $iDIR "Need Kitty:" "Kitty terminal not found. Please install Kitty terminal."
  exit 1
fi

# Detect distribution and update accordingly
if command -v paru &> /dev/null || command -v yay &> /dev/null; then
  # Arch-based
  if command -v paru &> /dev/null; then
    kitty -T update paru -Syu
    notify-send -i $iDIR -u low 'Arch-based system' 'has been updated.'
  else
    kitty -T update yay -Syu
    notify-send -i $iDIR -u low 'Arch-based system' 'has been updated.'
  fi
elif command -v dnf &> /dev/null; then
  # Fedora-based
  kitty -T update sudo dnf update --refresh -y
  notify-send -i $iDIR -u low 'Fedora system' 'has been updated.'
elif command -v apt &> /dev/null; then
  # Debian-based (Debian, Ubuntu, etc.)
  kitty -T update sudo apt update && sudo apt upgrade -y
  notify-send -i $iDIR -u low 'Debian/Ubuntu system' 'has been updated.'
elif command -v zypper &> /dev/null; then
  # openSUSE-based
  kitty -T update sudo zypper dup -y
  notify-send -i $iDIR -u low 'openSUSE system' 'has been updated.'
else
  # Unsupported distro
  notify-send -i $iDIR -u critical "Unsupported system" "This script does not support your distribution."
  exit 1
fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage