Score:10

Run command inside application

mx flag

On Ubuntu 16.04, I had a keyboard shortcut (Alt+F1) that would open a menu to run a command of a specific application.

For instance, if I were using LibreOffice Calc's, I could do Alt+F1, type "freeze row", and select the action that corresponded with that menu event, and Calc would perform the command (freeze a row in this case).

Another example would be for Gimp: I could do Alt+F1 and then type "crop to selection", and then that command would be executed inside the application.

What is the equivalent in Ubuntu 20.04?

Score:10
cn flag

You are referring to some HUD functionality, allowing to search menu commands. Yes, this was build in in the Unity desktop, the Canonical developed desktop environment used in Ubuntu for many years. This was one of its prevalent innovative features. It was not by default Alt+F1, however (this is in many DE's reserved to summon the application menu - the Activities view in Gnome), but the right Alt key (which you could have changed).

However, it did not generally catch on. Add to this that modern trends are to abolish the traditional menu all together, that implementing this is different for different toolkits (GTK programs versus QT programs etc), and on modern Linux desktops. Therefore, it is still not a common concept and we are still supposed to visually scan menus and submenus to find the option we want.

The Unity desktop is still available as a community project, but its future remains uncertain. The much more alive Mate desktop on Ubuntu Mate, however, has adopted that HUD. It is not enabled by default, but you can activate it. It is based on the implemantation of Unity. Apparently, you could hack an implementation in the KDE desktop.

For Gimp, we are lucky. In one of the 2.10 versions, a menu search function was introduced, although it received very little publicity. Hit (in perfect Lotus 123 tradition) the / key, and start typing the keywords of the commands you want to find.

raj avatar
cn flag
raj
Upvoting both the question and your answer as I didn't even know that such an interesting curiosity existed/exists. No more than curiosity for me, however, because I'm sticking to the classic GNOME desktop since GNOME 2 and am very reluctant to accept any "modern" desktop gimmicks. Neither Unity nor GNOME Shell are not my thing. Still interesting to know however.
N0rbert avatar
zw flag
It is always good to know the history of the technology, thanks @vanadium.
vanadium avatar
cn flag
@N0rbert thanks for your answer: it did not occur to me that the HUD is actually available in the Mate desktop, so that is important info to add here.
Arthur Colombini Gusmão avatar
mx flag
Thanks @vanadium, knowing the history of it was quite interesting. Also the tip on GIMP, which was the initial motivation for my question.
Score:8
zw flag

First thing to note is that Ubuntu 16.04 LTS used Unity desktop as desktop environment.
You are probaly talking about HUD.

So on Ubuntu 20.04 LTS you have to install Unity desktop back by

sudo apt-get install ubuntu-unity-desktop

and continue to use it as before:

HUD on Unity

The bad thing there is that Unity is now considered obsolete product.

So better solution is to install MATE desktop by sudo apt-get install ubuntu-mate-desktop^ and then enable HUD in the MATE Tweak and enjoy the HUD by pressing left Alt:

HUD on Ubuntu MATE


Note: you can always remove GNOME Shell using my other answer.

Arthur Colombini Gusmão avatar
mx flag
Thanks for the detailed instructions @N0rbert, super helpful answer.
Score:4
cn flag
Joe

While the other answers handle this specific situation nicely, there's a way to do things like this and a lot more with almost any application or set of actions.

AutoKey allows you to write scripts that emit keyboard and mouse events to perform most tasks you could do manually with your keyboard and mouse. Most applications can't tell it's not you typing and clicking, so they can be controlled even if they don't have any provision such as an API.

AutoKey scripts are written in Python 3, so they can do almost anything. An API is provided to generate keyboard and mouse events and for some desktop/window manager interactions.

A script can be assigned a hotkey so that it runs whenever that hotkey combination is pressed. Window filters can also be defined so a hotkey only triggers a particular script if the current active window matches its filter. Otherwise, the hotkey is passed to the application.

AutoKey also provides phrases. These are like a very powerful autotype/autocorrect feature.

Phrases and scripts can be triggered by hotkeys or run when a specified trigger abbreviation is typed. There are a number of options to fine tune how this works.

AutoKey scripts for most common uses can be written with a very minimal knowledge of Python. You don't need to know most of the language. However, if you do know more, you can easily put it to use.

The current version of AutoKey is available in the Debian repositories used by Ubuntu since 20.04, so you can install it with your package manager.

The project is active and a new beta release is being tested.

For more information, see our wiki and our support forum or our Gitter page.

Little Girl avatar
cn flag
I agree that this would be an excellent solution and would also be useful in other ways. If you run into an issues when writing a script, you can visit the pages Joe linked to and you'll find friendly folks ready to jump in and help with it, too.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.