11959435-Ubuntu-Kung-Fu

Page 268

S HUTDOWN ,

REBOOT , HIBERNATE , OR SLEEP

U BUNTU

WITH A SINGLE CLICK

address you discovered earlier. Then click OK. Use this shortcut in future whenever you wish to connect. Alternatively, if you don’t wish to have a desktop shortcut, you can connect once and then create a Nautilus bookmark. Then delete the shortcut. You might also want to look at Tip 131, on page 173, which describes the cornucopia of FTP tools provided under Ubuntu.

227

Shutdown, reboot, hibernate, or sleep Ubuntu with a single click

By creating desktop shortcuts to the terminal commands mentioned in Tip 206, on page 241, you can create one-click shutdown, reboot, hibernate, or sleep commands (although you’ll need to enter your root password each time). You can do this by creating a launcher on the panels. To create a panel launcher, right-click a blank spot on a panel and select Add to panel. Then select Custom Application Launcher and click the Add button. This will open the Create Launcher dialog box. It doesn’t really matter what you type in the Name field of this dialog box—something like Hibernate will do fine, assuming you’re creating a hibernate shortcut, of course. In the Command field, type any of the following, depending on what you’d like the shortcut to do (the function of each command is mentioned in parenthesis after each command—there’s no need to type that part): gksu gksu gksu gksu

telinit 0 (shutdown) telinit 6 (reboot) /etc/acpi/hibernate.sh (hibernate) /etc/acpi/sleepbtn.sh (sleep)

Select an appropriate icon by clicking the icon preview button and then click OK. Note that, aside from the password prompt, there is no confirmation of any of these actions (and remember that the password prompt might not appear if you’re in the sudo/gksu grace period—see Tip 47, on page 110 for details on how to change this). Before clicking any buttons that you create, before sure to save your work and also close open applications.

Prepared exclusively for J.S. Ash

Report erratum this copy is (B2.0 printing, July 15, 2008)

268


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.