Skip to content

Instantly share code, notes, and snippets.

@diki-haryadi
Created January 20, 2023 06:22
Show Gist options
  • Save diki-haryadi/81b6cca5be1dcdd1a2966c98d4d5abc7 to your computer and use it in GitHub Desktop.
Save diki-haryadi/81b6cca5be1dcdd1a2966c98d4d5abc7 to your computer and use it in GitHub Desktop.
# create script
nano create-shortcut.sh
```
#!/bin/bash
echo "Enter the path to the logo image:"
read logo_path
echo "Enter the path to the executable application:"
read executable_path
echo "[Desktop Entry]" > my_shortcut.desktop
echo "Type=Application" >> my_shortcut.desktop
echo "Name=My Shortcut" >> my_shortcut.desktop
echo "Exec=$executable_path" >> my_shortcut.desktop
echo "Icon=$logo_path" >> my_shortcut.desktop
echo "Shortcut created successfully!"
```
# Make the script executable
chmod +x my_shortcut.desktop
# Move the script to the desktop
mv my_shortcut.desktop ~/Desktop/
# Refresh the desktop to show the shortcut
nautilus ~/Desktop/
# You can now double-click the shortcut on your desktop to launch the application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment