With gedit, it has a neat plugin called External Tools. I'm new to whatever programming/scripting language it uses for it's command section and wondering if someone could put together a few simple scripts (basically the same but for different languages) for me. I want to add something called "Compile & Run in <language>".
Let's say the file is called helloworld.c, it would open terminal (with the current directory selected) and execute the following:
Quote:
gcc -o helloworld helloworld.c"
chmod 744 helloworld
./helloworld
|
For C++ it would do the same but the first command would be:
Quote:
g++ helloworld -o helloworld.cpp
|
(I'm unsure where the -o goes, but you get the drift)
This plugin by default already has a command called "Open terminal here" which basically opens terminal with the current directory selected. So I assume it wouldn't be hard to extend that onto a few commands to do as I've asked.
Quote:
#!/bin/sh
#TODO: use "gconftool-2 -g /desktop/gnome/applications/terminal/exec"
gnome-terminal --working-directory=$GEDIT_CURRENT_DOCUMENT_DIR &
|
For information on the environment variables and the plugin you can find it here (couldn't make link active due to restriction of first post): http://live.gnome.org/Gedit/ToolLauncherPlugin
I only want two commands, one for C, and one for C++, which I'll then combine into one when GEDIT_CURRENT_DOCUMENT_TYPE becomes available (it says to be added). Though, if someone would take it that step further and have a binary selection to see if the filename extension is .c or .cpp and then combine the command into one that'd be great.
Hopefully this isn't too much trouble. Thanks.