#!/bin/sh

#*********************************************************************************************************
#*   __     __               __     ______                __   __                      _______ _______   *
#*  |  |--.|  |.---.-..----.|  |--.|   __ \.---.-..-----.|  |_|  |--..-----..----.    |       |     __|  *
#*  |  _  ||  ||  _  ||  __||    < |    __/|  _  ||     ||   _|     ||  -__||   _|    |   -   |__     |  *
#*  |_____||__||___._||____||__|__||___|   |___._||__|__||____|__|__||_____||__|      |_______|_______|  *
#* http://www.blackpantheros.eu | http://www.blackpanther.hu - kbarcza[]blackpanther.hu * Charles Barcza *
#*************************************************************************************(c)2002-2016********


export TEXTDOMAIN="default-apps"
export TEXTDOMAINDIR="/usr/share/locale"

if [ -x /usr/libexec/kf5/kdesu ];then
    /usr/libexec/kf5/kdesu -i blackPanther-dark $@
elif [ -x /usr/lib/libexec/kdesu ];then
    /usr/lib/libexec/kdesu $@
elif [ -x /usr/libexec/kdesu ];then
    /usr/libexec/kdesu $@
elif [ -x /usr/lib/kdesu ];then
    /usr/libexec/kdesu $@
elif [ -x /usr/lib/kde4/libexec/kdesu ];then
    /usr/lib/kde4/libexec/kdesu $@
else
    reporter=$(echo `which kdialog 2>/dev/null ||which zenity 2>/dev/null`)
    if [ ! -n "$reporter" ];then
	notify-send -u critical $(gettext "Error") $(gettext "Graphical SU application not found! Please report this error to blackPanther Developers")
	exit
     else 
	$reporter --error $(gettext "Graphical SU not found! Please report this error to blackPanther OS developers. You can use your command in terminal.")

    fi

fi