How can I open a dialog box as below from a terminal?

Screenshot: "Run Application" dialog box


Install the X11 keyboard/mouse input simulator xdotool and run xdotool key Alt+F2.

You can add this alias to your ~/.bashrc file to make typing easier:

alias rd="xdotool key Alt+F2"

Now all you need to do is type rd.

Hacky, but works.

| improve this answer | |

Two options:

  1. Install gmrun from Software Center or with sudo apt-get install gmrun then use command gmrun from the terminal
  2. Compile gnome-run from source and run gnome-run from the terminal. Instructions here. [Editor's note: instruction page contains dead links.]

Unfortunately this is harder than it should be.

| improve this answer | |

I found another way to do it:

  1. Install the xautomation Install xautomation package
  2. Run this command: xte 'keydown Alt_L' 'key F2' 'keyup Alt_L'

Thanks htorque for the hint "keyboard/mouse input"

| improve this answer | |

In case of Mate Desktop use

mate-panel --run-dialog
| improve this answer | |
gnome-panel-control --run-dialog
| improve this answer | |
  • 3
    You need to install gnome-panel-control to tun this command. – Pilot6 Jul 17 '17 at 18:25

For LXDE/Lubuntu/LightDM, run lxpanelctl run in the terminal.

| improve this answer | |
bash -c "$(zenity --entry --title 'Enter a Command' --text '' --width 400)"
| improve this answer | |
  • 1
    That will result in an error if the dialogue is cancelled. It would be better to capture the output of zenity and only proceed if it returned successfully: cmd="$(zenity --entry --title 'Enter a Command' --text '' --width 400)" && bash -c "$cmd" or even zenity --entry --title 'Enter a Command' --text '' --width 400 | bash. – David Foerster Mar 22 '18 at 19:29
  • On Ubuntu 18.04 the original command runs without error. Tested dialogue cancel, providing valid command, providing invalid command, and providing no command. Not sure why our systems are behaving differently. – TooManyPets Mar 23 '18 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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