#!/bin/sh

detect_virt=$(systemd-detect-virt)

if ([ ! -z "$DISPLAY" ] && [ "$DISPLAY" != ":0" ]) || ([ "$detect_virt" != "docker" ] && [ "$detect_virt" != "podman" ] && [ "$detect_virt" != "wsl" ]); then

     FLAGFILE="$HOME/.flag-xfce-once"
     #FLAGNET="$HOME/.flag-xfce-net-once"

     if [ -f "$FLAGFILE" ]; then

         ############################################################

         xdg-mime default org.gnome.Nautilus.desktop inode/directory

         ############################################################

         sh ~/.vim_runtime/install_awesome_parameterized.sh ~/.vim_runtime $USER

         theme-switcher -a

         rm -rf "$FLAGFILE"

         systemctl --user enable --now psd
     fi

     #if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then
     #    if [ -f "$FLAGNET" ]; then
     #    # Commented for keeping nist-feed disable. The user decides if enable it.
     #    #	/usr/local/bin/nist-feed -n -l
     #    	rm -rf "$FLAGNET"
     #    fi
     #    /usr/local/bin/htb-update
     #fi

     #If tun0 is down (i.e., after a reboot), the shell prompt must be updated with the running interfaces
     #if ! nmcli c show --active | grep -q tun ; then

     #   /usr/local/bin/prompt-reset

     #fi
fi