'Intellij PyCharm/Idea/etc: how to add a toolbar button that runs a shell script?

In Intellij IDE's such as PyCharm or Idea there is an option to customize the menu and toolbar by right-clicking the toolbar and picking Customize menus and toolbars. While it is possible to select almost any IDE action there doesn't seem to be a way to add a button that runs a custom shell script. The only way to run a shell script seems to be by adding a Run Configuration of type Shell Script and then invoking it via the Run button, but is there a way to have multiple clickable buttons on the toolbar that would run arbitrary shell commands? (no need for an actual console)



Solution 1:[1]

In Jetbrains jargon this is called an external tool and is configured under Preferences -> Tools -> External Tools.

Once you added the commands you need as external tools you can add them as toolbar buttons by right-clicking the toolbar and picking Customize menus and toolbars, expand the node under the Main Toolbar, click ? to add an item and then type external in the search box to select your "external tools" and optionally set custom icons for them.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1