Warning: include_once(/home/winit/hackedpotatoes.com/wp-content/plugins/wordsocial/wordsocial.php): failed to open stream: Permission denied in /home/winit/hackedpotatoes.com/wp-settings.php on line 303

Warning: include_once(): Failed opening '/home/winit/hackedpotatoes.com/wp-content/plugins/wordsocial/wordsocial.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/winit/hackedpotatoes.com/wp-settings.php on line 303

Warning: Cannot modify header information - headers already sent by (output started at /home/winit/hackedpotatoes.com/wp-settings.php:303) in /home/winit/hackedpotatoes.com/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 60
Custom Launchers in Ubuntu 12.04 LTS «
23Oct/126

Custom Launchers in Ubuntu 12.04 LTS

I know that I'm straying into Lifehacker territory here, but this is a tip I couldn't help but share. I've always wanted to create customer launchers for the Unity dock, and I've finally found how. I'm going to apply this to Minecraft, but you can use to create an icon for just about any program or command that you might need to run in Ubuntu. Read on for instructions...

We'll do most of this from the terminal, just because we can. First, create a hidden directory in your home folder for  the launcher and icon files.

mkdir /home/joel/.minecraft/

Change the directory to the new hidden folder.

cd /home/joel/.minecraft/

Download Minecraft for Linux.

wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft.jar

Make it executable.

sudo chmod +x minecraft.jar

Download a png or svg to use as an icon. I really liked this one. I recommend getting your icon in place before you create the .desktop file that references it; I had some problems getting Unity to pick up the icon if I did it the other way around.

wget  http://fc06.deviantart.net/fs70/f/2010/325/1/8/minecraft_icon_by_dharmainitiative2010-d33ca5p.png

Ugh, give that thing a reasonable name! The mv command will "move" it, changing it's name in the process.

mv minecraft_icon_by_dharmainitiative2010-d33ca5p.png minecraft.png

Now that we have our files in place, create a .desktop file. These steps might be the only thing you came to this article for.

sudo nano /usr/share/applications/minecraft.desktop

Paste this in, or modify to fit your purposes. The fields are pretty self explanatory, but notice that in the "Exec" field I'm not just giving in the .jar file, but the actual command to execute.

[Desktop Entry]
Name=Minecraft
GenericName=Minecraft
Comment=Minecraft
Keywords=minecraft;game
Exec=java -jar /home/joel/.minecraft/minecraft.jar
Terminal=false
Type=Application
StartupNotify=true
Icon=/home/joel/.minecraft/minecraft.png

Press Ctrl+X to close the file, and Y and Enter to save it.

Give Ubuntu a moment to update the icon and...

That'sssssssssssss a nicccccccccccccce Unity icon you have there.

- Joel / FuelCell250

 

  • http://twitter.com/Badger32d Sol

    Don’t you mean “Custom Launcher?”

  • http://www.isaiahjroberts.com/ Isaiah J Roberts (Izzy)

    Great tip! Gotta say I love that icon. Let’s throw up a “tips” category, make it easy to find little tricks like this to make life easier.

  • Aloious Kathcart Alqonquin

    I went ’round and ’round trying many other methods. This one woked for me. Thanks so much!

  • YYFREAK

    This did not work for me HELLLLLLLLPPPPPPPPP

    • Ben

      The directory/filenames are case sensitive, ensure that when you’re entering ‘minecraft.jar’ the actual filename isn’t ‘Minecraft.jar’ etc

  • KajliesGCT

    The terminal says command ‘nano’ not found?? Please help!