Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to map a key, say ctrl-shift-m to open a terminal, ssh into the mailhost, open pine and go into the compose mail pane. I already have ssh-key setup so i dont have to type my password while doing ssh, so that is not an issue.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

This is how I do when I need:

1) Make a script with all commands needed

Example:

#!/bin/bash

ssh user@server.etc

ssh some-command

others-commands

exit 0

2) Create the shortcut

Run gnome-control-center keyboard then go to "Shortcuts" > "Custom" > "+"

enter image description here

Name: Anything
Command: gnome-terminal -e "bash -c \"/path/to/script ; exit ; exec bash\""

Change "/path/to/script" for the correct path, and

delete "exit" if you don't want the terminal to close after the execution of the script.

Then choose the shortcut you wish.

Enjoy!

share|improve this answer
    
Thankyou so much... This worked like a charm. –  gforce89 Apr 1 '13 at 5:31

you can open terminal and execute command via the following code

gnome-terminal --COMMAND=string

You can add key mapping in

Applications > Keyboard > Shortcut > Custom

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.