mirror of
https://abf.rosa.ru/djam/auto-krokodil.git
synced 2025-02-23 10:32:57 +00:00
48 lines
1 KiB
Bash
Executable file
48 lines
1 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
set -a
|
|
|
|
if test -f kroko-cli.sh
|
|
then
|
|
SOURCING=1 . kroko-cli.sh
|
|
else
|
|
SOURCING=1 . kroko-cli
|
|
fi
|
|
|
|
COMMON_ZENITY_ARGS="--window-icon=geany --title=kroko-gui"
|
|
|
|
_zenity(){
|
|
zenity $COMMON_ZENITY_ARGS "$@"
|
|
}
|
|
|
|
# if use _zenity() here, PID is incorrect (probably subshell's PID is taken)
|
|
zenity $COMMON_ZENITY_ARGS --progress --pulsate --text=$"Selecting the best NVIDIA driver…" &
|
|
zenity_pid=$!
|
|
|
|
if o="$(_cli_get_gpus)"
|
|
then
|
|
:
|
|
else
|
|
rc=$?
|
|
kill $zenity_pid
|
|
case $rc in
|
|
$EXIT_ENOGPU )
|
|
_zenity --error --text=$"No NVIDIA GPUs found""!"
|
|
exit $EXIT_ENOGPU
|
|
;;
|
|
$EXIT_ENODRIVER )
|
|
_zenity --error --text=$"No suitable drivers found""!"
|
|
exit $EXIT_ENODRIVER
|
|
;;
|
|
$EXIT_ENOCOMMONDRIVER )
|
|
_zenity --error --text=$"This computer has multiple NVIDIA GPUs".$"A driver which would work with all of them has not been found".
|
|
exit $EXIT_ENOCOMMONDRIVER
|
|
;;
|
|
* )
|
|
_zenity --error --text=$"An unknown error occured".$"Something went wrong""!".
|
|
exit $EXIT_ENOCOMMONDRIVER
|
|
;;
|
|
esac
|
|
fi
|
|
#echo "$o" | _select_best_driver
|
|
|