13

Months ago I saw a guy running commands from a small, textbox-like window, showing nothing else other than the box for you to write the command. It would popup by pressing some keyboard shortcut. Specifically, from what I remember, he was using Lubuntu, and mostly opening apps (like Chrome, Audacious, etc.).

Is it a known extension for lxde or did he most probably create it by himself?

Thanks everyone!

EDIT: some guys recommended Alt + F2, but nothing happens.

3 Answers3

14

Alt + F2 worked for me (i know you suggested it didn't work for you, however its worth reinforcing for others!).

Kubuntu 15.04

HankCa
  • 266
6

This type of GUI for running commands is basically known as "Run" interface. It's fairly simple idea.

In the Ubuntu's Unity environment Alt+F2 allows running specific commands using the default shell, dash or Debian Amquist Shell. Of course, you have to remember that you are running commands "blindly", meaning without the STDOUT output from command or STDERR streams going. So unless you are running a GUI app, you won't know if your command failed or not.

There are tweaks for Gnome desktop environment to utilise the same keybinding as well, which if I am not mistaken , can be configured using from Gnome Tweak Tool

For blackbox desktop environment there exists bbrun package, which also does very much the same functionality.

At the very bottom of things, one could build such tool by themselves, using any programming language available or desired. For instance, here's some examples

Shell script + zenity

#!/bin/sh
exec $(zenity --entry --title "Enter command" --text "") 

Java:

//runSomething.java
import javax.swing.JOptionPane;
import java.lang.Runtime;
import java.io.IOException;
public class runSomething
{
 public static void main(String [] args) throws IOException
 {
  String cmd = JOptionPane.showInputDialog("Enter command:");
  Runtime.getRuntime().exec(cmd); 
 }
}
0

I think you're talking about a shell script, which has extensive help available on the internet. I'll get you started, though.

  1. Make a new text file. Don't put an extension on, or delete the one already on, if there is one.
  2. Open the file with Gedit.
  3. Now, at the top line, write !#/bin/bash.
  4. The lines below are where you put your commands, one per line. Make sure to include sudo before if the commands require it.
  5. Save the file and then go into its properties.
  6. Under the Permissions tab, check the Is Executable option, so that it can be run.
  7. Now, this depends on what type of Ubuntu you're using (Lubuntu, Xubuntu, Kubuntu, Unity, etc.), but in System Settings, there will be a place to assign keyboard shortcuts to programs. Here, make the shortcut you want and type the path to the location of your script. Comment your flavor below and I'll give more specific instructions.

Example File (Opens Unity's Preferences app):

!#/bin/bash
unity-control-center
TheWanderer
  • 19,525
  • 12
  • 52
  • 65