11

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

Screenshot: "Run Application" dialog box

7 Answers 7

8

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.

4

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.

3

In case of Mate Desktop use

mate-panel --run-dialog
2

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"

2

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

1
gnome-panel-control --run-dialog
1
  • 3
    You need to install gnome-panel-control to tun this command.
    – Pilot6
    Jul 17, 2017 at 18:25
1
bash -c "$(zenity --entry --title 'Enter a Command' --text '' --width 400)"
2
  • 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. Mar 22, 2018 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. Mar 23, 2018 at 20:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .