#!/bin/sh

set -e

if [ "$1" = configure ]; then
  if [ -d /usr/share/gnome-shell ]
  then
    if [ ! -d /usr/share/gnome-shell/theme ]
    then
        mkdir /usr/share/gnome-shell/theme
    fi

    if [ ! -d /usr/share/gnome-shell/theme/ZorinBlue-Dark ]
    then
        mkdir /usr/share/gnome-shell/theme/ZorinBlue-Dark
    fi

    if [ ! -d /usr/share/gnome-shell/theme/ZorinBlue-Light ]
    then
        mkdir /usr/share/gnome-shell/theme/ZorinBlue-Light
    fi

    if [ ! -e /usr/share/gnome-shell/theme/ZorinBlue-Dark/gnome-shell-theme.gresource ]
    then
      ln -s /usr/share/themes/ZorinBlue-Dark/gnome-shell/gnome-shell-theme.gresource /usr/share/gnome-shell/theme/ZorinBlue-Dark/gnome-shell-theme.gresource
    fi

    if [ ! -e /usr/share/gnome-shell/theme/ZorinBlue-Light/gnome-shell-theme.gresource ]
    then
      ln -s /usr/share/themes/ZorinBlue-Light/gnome-shell/gnome-shell-theme.gresource /usr/share/gnome-shell/theme/ZorinBlue-Light/gnome-shell-theme.gresource
    fi

    update-alternatives --install \
      /usr/share/gnome-shell/gdm-theme.gresource \
      gdm-theme.gresource \
      /usr/share/gnome-shell/theme/ZorinBlue-Dark/gnome-shell-theme.gresource \
      20
  fi
fi

#DEBHELPER#
