Ubuntu / Linux news and application reviews.

Unity Reboot Custom Launcher

I triple boot on my netbook and dual boot on my main computer so I wanted a quick way to reboot in a different Linux distribution. Using the instructions in our previous post on how to reboot in Windows from Ubuntu, I've created a script that creates a custom Unity launcher you can use to reboot in some other Linux distribution (or any other OS) you have installed via quicklists.

The launcher will not change the GRUB menu entries order. When GRUB starts, the first GRUB menu item is highlighted - selecting to reboot from a this custom launcher quicklist will highlight the menu entry you set and will boot it if you don't select a different option in the GRUB menulist (so the GRUB menu will still be displayed if you've set a GRUB timeout higher than 0).

Before using it, please note that the script is experimental and I've only tested it on one computer so far.



Setting up Unity-Reboot custom launcher



1. To be able to use the Unity-Reboot custom launcher, you must firstly make some changes to the /etc/default/grub file. Be careful when editing this file or your computer might not boot!!

Let's open the file with Gedit:

gksu gedit /etc/default/grub

In this file, modify the "GRUB_DEFAULT=0" value (it should be on line 4) from "0" to "saved" (without the quotes) so that it looks like this:
GRUB_DEFAULT=saved

Then, upgrade GRUB using the following command:
sudo update-grub

2. Now you need to download the script and run it - this will create a .desktop file with your GRUB menu entries (without the recovery and memtest entries). To do this, run the following commands:
mkdir -p ~/scripts && cd ~/scripts
wget http://webupd8.googlecode.com/files/unity-reboot_0.1.tar.gz
tar -xvf unity-reboot_0.1.tar.gz && rm unity-reboot_0.1.tar.gz
chmod +x unity-reboot
./unity-reboot

3. To add the newly created .desktop file to the Unity Launcher, open Nautilus, navigate to /home/YOUR_USERNAME/.local/share/applications/ (".local" is a hidden folder so press CTRL + H to see it), then drag and drop the "unity-reboot.desktop" file to the Unity launcher.

4. The Unity-Reboot launcher needs to be updated each time you install a new OS, upgrade or remove a kernel and so on, so add the script to your startup applications. To do this, open Dash and search for "Startup Applications", then click "Add" and add browse for the script (if you've followed our exactly instructions, you can find it in the "scripts" folder in your home directory).


Notes:
  • clicking the icon on the Unity launcher doesn't do anything. All the functionality is in the quicklists so you need to right click the icon and select an an item. Your computer will then reboot and automatically select the item you've clicked in the GRUB menu.
  • If you've removed a kernel or an OS and just booted, the launcher needs an extra reboot (or a logout or an Unity reload) to be updated. This is a limitation in Unity. But this isn't something that you do frequently so you will probably not even notice this.

And two tips:
  1. If you have a huge list of Kernels showing up in the quicklists, use Ubuntu-Tweak to remove some old kernels.
  2. Change the GRUB timeout to a low value (or even 0) to quickly boot in your selected OS / kernel.