Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-18-2012, 12:25 AM   #1
LQ Newbie
Registered: Dec 2012
Posts: 4

Rep: Reputation: Disabled
Create a shortcut for a program that launches in a root terminal

I am trying to figure out how to make a short cut that will open the root terminal and start a program. Iam using gnome, i tried to make a short cut by right clicking the desktop, when i run it the terminal window flashs and i can see my program running but it flashs out it does not run.

I used this as an example

I am needing it to go to
/home/username/workspace/MMOCoreORB-Testing/bin and then ./core3 to start it up.

Was wondering if anyone had an idea how to do this or how i could make the short cut on the desktop that would open the root and i would like the terminal window to stay open also.

Thanks for any advice guys
Old 12-19-2012, 09:12 AM   #2
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
A shortcut can be created using soft link, for example:
ln -s </path/to/target_file> <link_name>

But I didn't understand root terminal? Do you mean a terminal launched by root i.e. root is logged in that terminal to invoke the programme? Although a shortcut can be created, but problem is that if you're logged in as a normal user, then it will ask you to enter root's password, when you'll launch that shortcut.

Last edited by shivaa; 12-19-2012 at 09:17 AM. Reason: Correction
Old 12-19-2012, 09:42 AM   #3
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
To launch a terminal as root in Gnome 2 you can try the beesu command. In order to keep it open after the execution of the command has terminated and to specify the command itself, you can create a new Profile. At first run the command
$ beesu gnome-terminal
from any terminal, write the root's password when prompted and in the newly open terminal go to Edit --> Profiles. Click New to add a Profile, choose a name and click Create. In the next window (Editing profile) go to the Title and Command tab and check "Run command as a login shell" and "Run a custom command instead of my shell". In the Custom command text box type:
bash -c "cd /home/username/workspace/MMOCoreORB-Testing/bin; ./core3
Finally in the When command exits drop-down menu select "Hold the terminal open".

Now you have to create a custom launcher on your desktop and in the Command box type:
beesu gnome-terminal --window-with-profile=ProfileName
where ProfileName is the name you chose before. Now, when you click the launcher you will be prompted for root password, a terminal will open and the command executed as root and it will stay on your desktop until you explicitly close it.

This procedure is valid on CentOS 6 with Gnome 2.28 installed. I cannot test on Fedora or Debian-like distributions, but maybe the method is slightly different. Hope this helps.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
gnome-terminal:keyboard shortcut launches terminal with / directory default! deepclutch Linux - Desktop 1 06-21-2010 12:48 PM
Create shortcut one for a program and one for a service ASTRAPI Linux - Newbie 3 10-24-2009 04:14 AM
Can't create a shortcut to my newest program Foundationstone ruguloo Linux - Desktop 0 07-25-2009 06:23 AM
how create a shortcut on the linux desktop for a executive program cy163 Linux - Newbie 2 12-11-2007 12:41 AM
Create Shell Shortcut for Terminal PhuckFonix Linux - Newbie 6 03-29-2004 08:36 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration