margs=("--list""--radiolist""--height=175""--text=Welcome, fellow penguin, to the Star Citizen LUG Helper Script!""--column=""--column=What would you like to do?")
# Prompt the user for the paths to their wine prefix, game directory, and a backup directory
getdirs(){
message 1"On the next screens, please select your WINE prefix,\nyour Star Citizen installation's LIVE directory,\nand a backup directory for your keybinds."
if["$has_zen" -eq 1];then
prefix="$(zenity --file-selection --directory --title="Select your WINE prefix directory" --filename="$HOME/")"
if["$?" -eq -1 ];then
message 2"An unexpected error has occurred."
fi
path="$(zenity --file-selection --directory --title="Select your Star Citizen LIVE directory" --filename="$prefix/")"
if["$?" -eq -1 ];then
message 2"An unexpected error has occurred."
fi
backups="$(zenity --file-selection --directory --title="Select a backup directory for your keybinds" --filename="$HOME/")"
if["$?" -eq -1 ];then
message 2"An unexpected error has occurred."
fi
else
clear
echo -e "Enter the full path to your WINE prefix directory"
echo -e "ie. /home/USER/.wine/"
whileread -rp ": " prefix;do
if[ ! -d "$prefix"];then
echo -e "That directory is invalid or does not exist. Please try again.\n"
else
break
fi
done
echo -e "\nEnter the full path to your Star Citizen installation LIVE directory"
echo -e "ie. /home/USER/.wine/drive_c/Program Files/Roberts Space Industries/Star Citizen/LIVE/"
whileread -rp ": " path;do
if[ ! -d "$path"];then
echo -e "That directory is invalid or does not exist. Please try again.\n"
else
break
fi
done
echo -e "\nEnter the full path to a backup directory for your keybinds"
echo -e "ie. /home/USER/backups/"
whileread -rp ": " backups;do
if[ ! -d "$backups"];then
echo -e "That directory is invalid or does not exist. Please try again.\n"
message 1"Before proceeding, please be sure you have\nmade a backup of your Star Citizen keybinds!\nTo do this from within the game, go to\nOptions->Keybindings->Control Profiles->Save Control Settings\nGive it a name and save it to the backup location\nthat you specified in this script's variables."
message 2"As far as this script can detect, your system is not configured\nto allow Star Citizen to use more than ~8GB or memory.\n\nYou will most likely experience crashes."
if message 3"It looks like you already configured your system to work with Star Citizen, and saved the setting to persist across reboots. However, for some reason the persistence part did not work.\n\nFor now, would you like to enable the setting again until the next reboot?";then
if message 3"Running Star Citizen requires changing a system setting.\n\nvm.max_map_count must be increased to at least 16777216\nto avoid crashes in areas with lots of geometry.\n\nAs far as this script can detect, the setting\nhas not been changed on your system.\n\nWould you like to change the setting now?";then
message 1"To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.d/20-max_map_count.conf && sysctl -p'"
else
message 1"To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.conf && sysctl -p'"
fi
# Anyone who wants to do it manually doesn't need another warning
message 1"To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.d/20-max_map_count.conf && sysctl -p'"
else
message 1"To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w vm.max_map_count=16777216'\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"vm.max_map_count = 16777216\" >> /etc/sysctl.conf && sysctl -p'"
fi
# Anyone who wants to do it manually doesn't need another warning