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 know this should be the simplest thing, but coming up empty. ;-(

I would like to create a keyboard shortcut ctrl-alt-P that opens a terminal window and runs a ping command:

ping -c 4 somefixeddomain.com

[Useful for quickly checking whether my internet connection is actually working.]

I have attempted to do this (in Unity, Ubuntu v11.10) using:

Settings > Keyboard > Custom Shortcuts

filling in all the obvious stuff, but no luck. All ideas welcome.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

For Ubuntu 11.10 (Unity)

  1. Go to System Settings > Keyboard > Shortcuts > Custom Shortcuts.
  2. Add a new shortcut by pressing the + button.
  3. Choose a name for your shortcut, and in the 'Command' field, enter gnome-terminal -e "ping -c4 [your domain here]".
  4. Assign your shortcut key combination by selecting the shortcut and pressing the combination you desire (e.g. Ctrl + Alt = P).
share|improve this answer
    
gnome-terminal. Exactly what I needed. Thanks, mucho! ;-) –  David Weinraub Mar 26 '12 at 13:10

Hi have you tried doing that from terminal ? If not then try this https://help.ubuntu.com/community/KeyboardShortcuts

hope that helps.

share|improve this answer
1  
Thanks for the response. Within terminal, the shortcut has no effect. Of course, I have created an alias in ~/.bash_aliases that can do my ping, but it requires that I first open a terminal. What I am really looking for is a high-level way to simply bind a shortcut to a CLI command/script (just like I used to do in WinXP). –  David Weinraub Mar 26 '12 at 10:48

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.