PDA

View Full Version : [ubuntu] Shortcut Icons on Desktop



felixvah
September 13th, 2010, 10:51 PM
How would I create a command line (batch) on Ubuntu 9.10 desktop? For example, I go to terminal and type in $sudo /etc/init.d/gdm restart to restart gdm. Instead of having to type in the line every time, how could I write the line in to a batch file and create a short to the desktop to avoid to type in the command every time.

I can do a .bat in Windows, but I don't know how to do it in Ubuntu. Can anyone help?

kerry_s
September 13th, 2010, 11:23 PM
right click the desktop & create a file
put:

#!/bin/bash
your first command
next command
etc...
exit 0


save it, right click the file-> properties-> permissions, check the execute

all done just double click on it.

felixvah
September 16th, 2010, 08:19 PM
thanks, I'll try that.. Do where do I need to store the usename and password? If i'm going to specify sudo than I would need a password right?

kerry_s
September 16th, 2010, 10:34 PM
thanks, I'll try that.. Do where do I need to store the usename and password? If i'm going to specify sudo than I would need a password right?

use "gksudo" so you can type in the password.
or
you can use the "NOPASSWD:" in sudoers for the program's.

kerry_s
September 17th, 2010, 08:29 AM
The word icon is normally placed in the start menu under programs, just right click on it and select send to then desktop create shortcut.

no, he's creating a laucher that launches several programs instead of 1, it's not in the menu.

Gaygerbil
September 18th, 2010, 11:56 AM
You can just make the command a keyboard shortcut also which is much simpler, just create a new shortcut and then put in that command in the command box and assign it to a keybinding...bam done.