Run commands “without” terminal

22,201

Solution 1

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

Kubuntu 15.04

Solution 2

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); 
 }
}
Share:
22,201

Related videos on Youtube

Lucas Farias
Author by

Lucas Farias

I'm a data scientist holding an MSc in applied mathematics and a BA in economics. My main interests lie in machine learning and statistics.

Updated on September 18, 2022

Comments

  • Lucas Farias
    Lucas Farias over 1 year

    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.

  • Lucas Farias
    Lucas Farias almost 9 years
    I'm using Lubuntu 14.04.2 LTS! Thanks a lot!
  • Lucas Farias
    Lucas Farias almost 9 years
    You might be right, but I feel like he was just running commands as if he was in terminal, not running scripts.
  • TheWanderer
    TheWanderer almost 9 years
    That's what a script does.
  • TheWanderer
    TheWanderer almost 9 years
    I'm sorry, but I have to give instructions tomorrow. You're welcome to look up how to assign keyboard shortcuts in Lubuntu, though.
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy over 7 years
    I find it highly ironic that this accepted answer just says "use Alf+F2 even though it didn't work for you", while real solution is posted by OP in the comments.
  • HankCa
    HankCa over 7 years
    I was simply saying that this worked for me on the specified platform (the OP didn't give details for their platform). And if that DOES work for you then its better to try that first than the linked to answer (that said to write keybindings). The second answer that was linked to in the questions said ... wait for it ... Press Alt+F2 . And it was accepted. Your down vote now throws people off what appears to be the correct answer. Though I take your point that the OP said ALT+F2 doesn't work yet that was the ans given.
  • Lucas Farias
    Lucas Farias about 7 years
    @Serg It's the simple fact that, though you gave more details, he answered it right first (chronologically), the fact that it was not working for me was another issue.