LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 12-17-2012, 11:25 PM   #1
brezer
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

http://www.ceveni.com/2009/05/how-to...ux-debian.html

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, 08:12 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
A shortcut can be created using soft link, for example:
Code:
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 08:17 AM. Reason: Correction
 
Old 12-19-2012, 08:42 AM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
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
Code:
$ 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:
Code:
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:
Code:
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.
  


Reply


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 11:48 AM
Create shortcut one for a program and one for a service ASTRAPI Linux - Newbie 3 10-24-2009 03:14 AM
Can't create a shortcut to my newest program Foundationstone ruguloo Linux - Desktop 0 07-25-2009 05:23 AM
how create a shortcut on the linux desktop for a executive program cy163 Linux - Newbie 2 12-10-2007 11:41 PM
Create Shell Shortcut for Terminal PhuckFonix Linux - Newbie 6 03-29-2004 07:36 PM


All times are GMT -5. The time now is 08:56 PM.

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