-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
After running the installer on multiple PCs, no shortcut appeared for GPT4ALL, and running the "chat" binary didn't start the app. I used the following script and desktop file to fix it.
Save as "fix.sh":
#!/bin/bash
Sometimes missing, preventing launch
sudo apt update
sudo apt install -y libopengl0
Target directory for .desktop files
TARGET_DIR="$HOME/.local/share/applications"
mkdir -p "$TARGET_DIR"
echo "π¦ Searching for .desktop files in the current directory..."
Gather all .desktop files into an array
mapfile -t desktop_files < <(find . -maxdepth 1 -type f -name "*.desktop")
If none found, show message and exit
if [ ${#desktop_files[@]} -eq 0 ]; then
echo "β No .desktop files found in this directory."
echo "βΉοΈ Please place your .desktop files in the same folder as this script before running it."
exit 1
fi
Process each file
for desktop_file in "${desktop_files[@]}"; do
base_name=$(basename "$desktop_file")
echo "β‘ Found: $base_name"
# Ask user
read -rp "Install this file? [y/N]: " answer
case "$answer" in
[yY]|[yY][eE][sS])
echo "β‘ Copying: $desktop_file"
cp "$desktop_file" "$TARGET_DIR/"
chmod +x "$TARGET_DIR/$base_name"
echo "β
Installed: $base_name"
;;
*)
echo "βοΈ Skipped: $base_name"
;;
esac
done
Reload the launcher database
echo "π Updating application database..."
update-desktop-database "$TARGET_DIR"
echo "π Processing complete."
Open the applications directory
echo "π Opening $TARGET_DIR..."
xdg-open "$TARGET_DIR" &>/dev/null &
echo "β Folder opened in your file manager."
Save as "GPT4ALL.desktop" in the same directory as "fix.sh":
[Desktop Entry]
Type=Application
Terminal=false
Exec="/home/llama/gpt4all/bin/chat"
Name=GPT4All
Icon=/home/llama/gpt4all/gpt4all-48.png
Name[en_US]=GPT4All