Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-19-2007, 09:35 AM   #1
LQ Newbie
Registered: Nov 2007
Location: Sydney, Australia
Distribution: Ubuntu v7.10
Posts: 1

Rep: Reputation: 0
gedit plugin External Tools

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:
gcc -o helloworld helloworld.c"
chmod 744 helloworld
For C++ it would do the same but the first command would be:
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.

#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):

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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gedit has no Text encryption Plugin yeehi General 0 11-09-2007 09:45 AM
Installing GEdit function browser plugin in Ubuntu skails22 Linux - Newbie 3 07-24-2007 05:51 PM
LXer: Montavista's embedded Linux app dev tools go "all-plugin" LXer Syndicated Linux News 0 04-08-2007 12:01 AM
Kate external tools configuration help needed vharishankar Linux - Software 4 07-30-2005 08:51 PM
Gedit 2.2.0 tools menu gone! (Kde, Rh9) robertmarkbram Linux - Software 8 04-06-2004 05:00 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:39 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration