79 lines
2.5 KiB
Bash
Executable File
79 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
#############################################################
|
|
# Zenity interface for G203 (Prodigy & Ligthsync) driver #
|
|
# Last change: 24-08-2021 #
|
|
# Author: q3aql #
|
|
# Contact: q3aql@duck.com #
|
|
# License: GPL v2.0 #
|
|
#############################################################
|
|
VERSION="1.3"
|
|
M_DATE="240821"
|
|
|
|
# Variables
|
|
iconPath="/usr/share/icons/logitech/logitech-black.png"
|
|
|
|
# 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})" --window-icon=${iconPath} --info \
|
|
--text "El programa 'zenidrv-g203' no pudo ser ejecutado como administrador\n\nPor favor, ejecuta el comando 'zenidrv-g203' como root en tu 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 "* El programa 'zenidrv-g203' no pudo ser ejecutado como administrador"
|
|
echo ""
|
|
echo "* Por favor, ejecuta el comando 'zenidrv-g203' como root en tu terminal"
|
|
echo ""
|
|
echo -n "* Pulsa ENTER para salir... " ; read continue
|
|
exit
|
|
}
|
|
|
|
# Startup script
|
|
if [ "${1}" == "--error" ] ; then
|
|
errorMessage
|
|
else
|
|
showRootMessage
|
|
fi
|