From 528c1e5ff51e213936e800fc5a9a25da99c0bdf2 Mon Sep 17 00:00:00 2001 From: Perberos Date: Mon, 7 Nov 2011 16:46:58 -0300 Subject: initial --- plugins/externaltools/data/Makefile.am | 65 ++++++++++++++++++++++ plugins/externaltools/data/build.desktop.in | 9 +++ plugins/externaltools/data/build.tool.in | 15 +++++ .../data/open-terminal-here-osx.desktop.in | 8 +++ .../data/open-terminal-here-osx.tool.in | 16 ++++++ .../data/open-terminal-here.desktop.in | 8 +++ .../externaltools/data/open-terminal-here.tool.in | 4 ++ .../data/remove-trailing-spaces.desktop.in | 9 +++ .../data/remove-trailing-spaces.tool.in | 3 + plugins/externaltools/data/run-command.desktop.in | 8 +++ plugins/externaltools/data/run-command.tool.in | 4 ++ 11 files changed, 149 insertions(+) create mode 100755 plugins/externaltools/data/Makefile.am create mode 100755 plugins/externaltools/data/build.desktop.in create mode 100755 plugins/externaltools/data/build.tool.in create mode 100755 plugins/externaltools/data/open-terminal-here-osx.desktop.in create mode 100755 plugins/externaltools/data/open-terminal-here-osx.tool.in create mode 100755 plugins/externaltools/data/open-terminal-here.desktop.in create mode 100755 plugins/externaltools/data/open-terminal-here.tool.in create mode 100755 plugins/externaltools/data/remove-trailing-spaces.desktop.in create mode 100755 plugins/externaltools/data/remove-trailing-spaces.tool.in create mode 100755 plugins/externaltools/data/run-command.desktop.in create mode 100755 plugins/externaltools/data/run-command.tool.in (limited to 'plugins/externaltools/data') diff --git a/plugins/externaltools/data/Makefile.am b/plugins/externaltools/data/Makefile.am new file mode 100755 index 00000000..ae3a1c66 --- /dev/null +++ b/plugins/externaltools/data/Makefile.am @@ -0,0 +1,65 @@ +TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/gedit-tool-merge.pl + +tools_in_files = \ + build.tool.in \ + remove-trailing-spaces.tool.in + +tools_in_linux = \ + open-terminal-here.tool.in \ + run-command.tool.in + +tools_in_osx = \ + open-terminal-here-osx.tool.in + +tools_in_win32 = + +install_tools_in_files = $(tools_in_files) + +if PLATFORM_OSX +install_tools_in_files += $(tools_in_osx) +else +if PLATFORM_WIN32 +install_tools_in_files += $(tools_in_win32) +else +install_tools_in_files += $(tools_in_linux) +endif +endif + +desktop_in_files = $(install_tools_in_files:.tool.in=.desktop.in) +desktop_files = $(install_tools_in_files:.tool.in=.desktop) + +tools_SCRIPTS = $(install_tools_in_files:.tool.in=) +toolsdir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/tools + +all_tools_in_files = \ + $(tools_in_files) \ + $(tools_in_linux) \ + $(tools_in_osx) \ + $(tools_in_win32) + +all_desktop_in_files = $(all_tools_in_files:.tool.in=.desktop.in) +all_desktop_files = $(all_tools_in_files:.tool.in=.desktop) +all_tools_files = $(all_tools_in_files:.tool.in=) + +@INTLTOOL_DESKTOP_RULE@ + +# Tools are generated by merging a script file (.tool.in) with a data file +# (.desktop), which happens to be translated using intltool. +$(tools_SCRIPTS): %: %.tool.in %.desktop $(TOOL_MERGE) + perl $(TOOL_MERGE) -o $@ $< $(word 2,$^) + chmod 755 $@ + +EXTRA_DIST = \ + $(all_desktop_in_files) \ + $(all_tools_in_files) + +CLEANFILES = \ + $(all_desktop_files) \ + $(all_tools_files) + +DISTCLEANFILES = \ + $(all_desktop_files) \ + $(all_tools_files) + + +-include $(top_srcdir)/git.mk diff --git a/plugins/externaltools/data/build.desktop.in b/plugins/externaltools/data/build.desktop.in new file mode 100755 index 00000000..13767ee7 --- /dev/null +++ b/plugins/externaltools/data/build.desktop.in @@ -0,0 +1,9 @@ +[Gedit Tool] +_Name=Build +_Comment=Run "make" in the document directory +Input=nothing +Output=output-panel +Shortcut=F8 +Applicability=local +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/build.tool.in b/plugins/externaltools/data/build.tool.in new file mode 100755 index 00000000..0b81d5b6 --- /dev/null +++ b/plugins/externaltools/data/build.tool.in @@ -0,0 +1,15 @@ +#!/bin/sh + +EHOME=`echo $HOME | sed "s/#/\#/"` +DIR=$GEDIT_CURRENT_DOCUMENT_DIR +while test "$DIR" != "/"; do + for m in GNUmakefile makefile Makefile; do + if [ -f "${DIR}/${m}" ]; then + echo "Using ${m} from ${DIR}" | sed "s#$EHOME#~#" > /dev/stderr + make -C "${DIR}" + exit + fi + done + DIR=`dirname "${DIR}"` +done +echo "No Makefile found!" > /dev/stderr diff --git a/plugins/externaltools/data/open-terminal-here-osx.desktop.in b/plugins/externaltools/data/open-terminal-here-osx.desktop.in new file mode 100755 index 00000000..801b003c --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here-osx.desktop.in @@ -0,0 +1,8 @@ +[Gedit Tool] +_Name=Open terminal here +_Comment=Open a terminal in the document location +Input=nothing +Output=output-panel +Applicability=local +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/open-terminal-here-osx.tool.in b/plugins/externaltools/data/open-terminal-here-osx.tool.in new file mode 100755 index 00000000..c3360064 --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here-osx.tool.in @@ -0,0 +1,16 @@ +#!/usr/bin/osascript + +set the_path to system attribute "GEDIT_CURRENT_DOCUMENT_DIR" +set cmd to "cd " & quoted form of the_path + +tell application "System Events" to set terminalIsRunning to exists application process "Terminal" + +tell application "Terminal" + activate + + if terminalIsRunning is true then + do script with command cmd + else + do script with command cmd in window 1 + end if +end tell diff --git a/plugins/externaltools/data/open-terminal-here.desktop.in b/plugins/externaltools/data/open-terminal-here.desktop.in new file mode 100755 index 00000000..801b003c --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here.desktop.in @@ -0,0 +1,8 @@ +[Gedit Tool] +_Name=Open terminal here +_Comment=Open a terminal in the document location +Input=nothing +Output=output-panel +Applicability=local +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/open-terminal-here.tool.in b/plugins/externaltools/data/open-terminal-here.tool.in new file mode 100755 index 00000000..d2dda8db --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here.tool.in @@ -0,0 +1,4 @@ +#!/bin/sh + +#TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec" +mate-terminal --working-directory=$GEDIT_CURRENT_DOCUMENT_DIR & diff --git a/plugins/externaltools/data/remove-trailing-spaces.desktop.in b/plugins/externaltools/data/remove-trailing-spaces.desktop.in new file mode 100755 index 00000000..99b8b703 --- /dev/null +++ b/plugins/externaltools/data/remove-trailing-spaces.desktop.in @@ -0,0 +1,9 @@ +[Gedit Tool] +_Name=Remove trailing spaces +_Comment=Remove useless trailing spaces in your file +Input=document +Output=replace-document +Shortcut=F12 +Applicability=all +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/remove-trailing-spaces.tool.in b/plugins/externaltools/data/remove-trailing-spaces.tool.in new file mode 100755 index 00000000..83e4c19b --- /dev/null +++ b/plugins/externaltools/data/remove-trailing-spaces.tool.in @@ -0,0 +1,3 @@ +#!/bin/sh + +sed 's/[[:blank:]]*$//' diff --git a/plugins/externaltools/data/run-command.desktop.in b/plugins/externaltools/data/run-command.desktop.in new file mode 100755 index 00000000..b58294b0 --- /dev/null +++ b/plugins/externaltools/data/run-command.desktop.in @@ -0,0 +1,8 @@ +[Gedit Tool] +_Name=Run command +_Comment=Execute a custom command and put its output in a new document +Input=nothing +Output=new-document +Applicability=all +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/run-command.tool.in b/plugins/externaltools/data/run-command.tool.in new file mode 100755 index 00000000..ee611bbb --- /dev/null +++ b/plugins/externaltools/data/run-command.tool.in @@ -0,0 +1,4 @@ +#!/bin/sh + +#TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec" +exec `matedialog --entry --title="Run command - gedit" --text="Command to run"` -- cgit v1.2.1