#!/bin/bash

function main() {
  if [[ -e /etc/apt/sources.list ]]; then
    sudo DEBIAN_FRONTEND=noninteractive apt install xorg xfce4 -y -qq
  elif [[ -d /etc/yum.repos.d ]]; then
    sudo yum install -y epel-release
    sudo yum groupinstall "Xfce" -y
    # https://wiki.archlinux.org/title/xfce
    sudo sed -i 's/^PREFERRED=.*$/PREFERRED=$(type -p startxfce4)/' /etc/X11/xinit/Xclients
  else
    echo "not supported distro"
    exit 1
  fi
}

main
