Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to config Geany to build and execute at the same time?

Tags:

geany

I just started using Geany for a week. And always having to hit F9 to build and then hit F5 to run, it just sucks. So is there any way to config Geany so that it'll build and then execute immediately (like F9 in CodeBlocks) ?

like image 537
Lâm Nguyễn Avatar asked Oct 19 '22 07:10

Lâm Nguyễn


2 Answers

You can add your own custom commands or even adjust existing ones. Go to Build->Set Build Commands and change the compile command to something like command1 && command 2. The && should cause your POSIX shell to execute command 2 if command 1 was successful. Inside wiki there is a more verbose version of documentation what can be done on "Set Build Commands"

like image 66
frlan Avatar answered Oct 21 '22 22:10

frlan


I know this is old but I just figured out how to do this on Ubuntu Linux.

-Click "Build" in the menu at the top

-At the bottom go to "Set Build Commands"

-Prepend the command in the "Build" section before the command in the "Execute" section.

Execute should look like g++ -Wall -o "%e" "%f" && "./%e".

Here are before and after images.

Default Build Commands

Build and Execute Combined

You should now be able to build and run your program by pressing F5 (default) once or running execute from the build dropdown menu.

like image 38
bluespider23 Avatar answered Oct 21 '22 22:10

bluespider23