76 lines
2.4 KiB
Plaintext
76 lines
2.4 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
#############################################################
|
||
|
# Zenity interface for G203 (Prodigy & Ligthsync) driver #
|
||
|
# Last change: 28-03-2021 #
|
||
|
# Author: q3aql #
|
||
|
# Contact: q3aql@protonmail.ch #
|
||
|
# License: GPL v2.0 #
|
||
|
#############################################################
|
||
|
VERSION="1.0"
|
||
|
M_DATE="060721"
|
||
|
|
||
|
# Link with gksudo,gksu o bessu
|
||
|
function showRootMessage() {
|
||
|
if [ -f /usr/bin/gksudo ] ; then
|
||
|
gksudo /usr/bin/zenidrv-g203
|
||
|
exit
|
||
|
elif [ -f /bin/gksudo ] ; then
|
||
|
gksudo /usr/bin/zenidrv-g203
|
||
|
exit
|
||
|
elif [ -f /usr/bin/gksu ] ; then
|
||
|
gksu /usr/bin/zenidrv-g203
|
||
|
exit
|
||
|
elif [ -f /bin/gksu ] ; then
|
||
|
gksu /usr/bin/zenidrv-g203
|
||
|
exit
|
||
|
elif [ -f /usr/bin/beesu ] ; then
|
||
|
beesu /usr/bin/zenidrv-g203
|
||
|
exit
|
||
|
elif [ -f /bin/beesu ] ; then
|
||
|
beesu /usr/bin/zenidrv-g203
|
||
|
exit
|
||
|
elif [ -f /bin/sudo ] ; then
|
||
|
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "sudo zenidrv-g203"
|
||
|
exit
|
||
|
elif [ -f /usr/bin/sudo ] ; then
|
||
|
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "sudo zenidrv-g203"
|
||
|
exit
|
||
|
elif [ -f /usr/bin/su ] ; then
|
||
|
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "su -c 'zenidrv-g203'"
|
||
|
exit
|
||
|
elif [ -f /bin/su ] ; then
|
||
|
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "su -c 'zenidrv-g203'"
|
||
|
exit
|
||
|
else
|
||
|
zenity -h &> /dev/null
|
||
|
output=$?
|
||
|
if [ ${output} -eq 0 ] ; then
|
||
|
zenity --title "zenidrv-g203 ${VERSION} (${M_DATE})" --info \
|
||
|
--text "The 'zenidrv-g203' program could not be run as administrator\n\nPlease run the command 'zenidrv-g203' as root user in terminal"
|
||
|
else
|
||
|
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "zenidrv-g203-admin --error"
|
||
|
fi
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# Function to show error message
|
||
|
function errorMessage() {
|
||
|
echo ""
|
||
|
echo "* ATTENTION!:"
|
||
|
echo ""
|
||
|
echo "* The 'zenidrv-g203' program could not be run as administrator"
|
||
|
echo ""
|
||
|
echo "* Please run the command 'zenidrv-g203' as root user in terminal"
|
||
|
echo ""
|
||
|
echo -n "* Press ENTER to exit... " ; read continue
|
||
|
exit
|
||
|
}
|
||
|
|
||
|
# Inicio del script
|
||
|
if [ "${1}" == "--error" ] ; then
|
||
|
errorMessage
|
||
|
else
|
||
|
showRootMessage
|
||
|
fi
|