LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-28-2007, 02:22 AM   #1
dhaus111
LQ Newbie
 
Registered: Feb 2006
Posts: 26

Rep: Reputation: 15
creating useful launchers


Hey all,

I'm trying to figure out how to make scripts or launchers do my bidding.
basically I'd like to have an icon i can click on to run commands or more specifically lists of commands. most of these would require sudo privileges. One of the things I'd like to do is have a button "turn on" another X server which would use ssh and the -X switch to login to an X server on another computer on my LAN.

currently what I have to do to accomplish this is:

switch to tty2 and:
Code:
X :1
now this renders this tty stuck running 2nd x server

switch to tty1 and:
Code:
xterm -display :1
this opens up a terminal in the x server for me to execute the next command

Code:
ssh -X myuser@192.168.1.5
and then:
Code:
gnome-session
This sets up a fully functional remote gnome session on my 2nd xserver, which is pretty nice. There are probably better ways to do this, but this is what I figured out, any improvements would be appreciated.

now for the purpose of this post, I'd like to know how to automate this into a single click of a script or launcher of sorts. Is this possible? how would I configure my local gnome session to prompt me for passwords the way everything else does (with the pretty little password dialog).

Thanks for reading, and hopefully posting...
 
Old 04-29-2007, 11:11 AM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Well, you can make a simple sh script. Basically, all you do is list the commands you want to execute in a file since you say you're using Gnome, I'll assume you have gksduo or gksu, the programs that do the password asking. To figure out which you have, open a terminal, type them in, and see which doesn't complain about not existing.

Then, with the passwords, your script should look kinda like this:
Code:
gksu firstCommand && secondCommand && thirdComand
---OR IF YOU HAVE GKSUDO---
gksudo firstCommand && secondCommand && thirdComand
Then, you can just add a normal launcher to the gnome toolbar, and where it asks for the executable location, pass it your script
 
  


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
Menus, Panels, and Launchers? Bojamin Linux - Newbie 11 09-06-2005 03:43 PM
'Command' field in Gnome launchers Comreak Linux - Software 7 06-05-2005 01:25 AM
Gnome's vanishing launchers oberonix Linux - Newbie 3 08-31-2004 08:07 AM
where did my mandrake buttons/launchers go? bigPipes Linux - Newbie 2 03-12-2004 10:15 PM
How to get Gnome Launchers working? terosaur Linux - Software 1 11-11-2003 03:03 PM


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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration