Created
November 22, 2016 07:15
-
-
Save ldante86/eb2f969fa487b9de080c876efd0c85b9 to your computer and use it in GitHub Desktop.
desktop launcher tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
printf "\n%s\n\n" "Create a .desktop launcher" | |
# because Unity doesn't have a launcher tool... | |
read -p "Name the launcher: " name | |
[ -z "$name" ] && exit 1 | |
read -p "Code to execute: " execute | |
[ -z "$execute" ] && exit 1 | |
read -p "Does it need a terminal (t/f): " terminal | |
case $terminal in | |
t) terminal=true ;; | |
f) terminal=false ;; | |
*) exit 1 ;; | |
esac | |
read -p "Icon?: " icon | |
file=~/Desktop/${name}.desktop | |
echo "[Desktop Entry] | |
Type=Application | |
Terminal=$terminal | |
Exec="$execute" | |
Name=$name | |
Icon=$icon" > "$file" | |
chmod +x "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment