Skip to content

Commit e45a274

Browse files
committed
[New] External Tools: Launch system tools, like terminal or file manager
This plugin serves to quickly launch external tools in the context of the current document, i.e. in the same directory, or with focus on the file. The current implementation includes a Terminal and a File Manager. The commands to execute are configurable in the Plugin preferences. The tools may be launched from the Tools menu, or via keybinds. The code is modular to support easy addition of extra tools, though in the feature it would be really nice to support such additions directly in the preferences without code modification.
1 parent a8f26ab commit e45a274

13 files changed

+863
-0
lines changed

MAINTAINERS

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ M: Pavel Roschin <rpg89(at)post(dot)ru>
6161
W: http://plugins.geany.org/defineformat.html
6262
S: Maintained
6363

64+
externaltools
65+
P: George Katevenis <george_kate(at)hotmail(dot)com>
66+
g: @gkatev
67+
M: George Katevenis <george_kate(at)hotmail(dot)com>
68+
W: http://plugins.geany.org/externaltools.html
69+
S: Maintained
70+
6471
geanyctags
6572
P: Jiří Techet <[email protected]>
6673
g: @techee

Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ if ENABLE_DEFINEFORMAT
3737
SUBDIRS += defineformat
3838
endif
3939

40+
if ENABLE_EXTERNALTOOLS
41+
SUBDIRS += externaltools
42+
endif
43+
4044
if ENABLE_GEANYCTAGS
4145
SUBDIRS += geanyctags
4246
endif

build/externaltools.m4

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
AC_DEFUN([GP_CHECK_EXTERNALTOOLS],
2+
[
3+
GP_ARG_DISABLE([ExternalTools], [auto])
4+
GP_COMMIT_PLUGIN_STATUS([ExternalTools])
5+
AC_CONFIG_FILES([
6+
externaltools/Makefile
7+
externaltools/src/Makefile
8+
])
9+
])

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ GP_CHECK_CODENAV
3737
GP_CHECK_COMMANDER
3838
GP_CHECK_DEBUGGER
3939
GP_CHECK_DEFINEFORMAT
40+
GP_CHECK_EXTERNALTOOLS
4041
GP_CHECK_GEANYCTAGS
4142
GP_CHECK_GEANYDOC
4243
GP_CHECK_GEANYEXTRASEL

externaltools/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
George Katevenis <george_kate(at)hotmail(dot)com>

externaltools/COPYING

+340
Large diffs are not rendered by default.

externaltools/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2024-04-14 Version 0.1
2+
3+
* Initial plugin release, with support for
4+
'Open Terminal' and 'Open Directory'.

externaltools/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include $(top_srcdir)/build/vars.auxfiles.mk
2+
3+
SUBDIRS = src
4+
plugin = externaltools

externaltools/NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See "ChangeLog"

externaltools/README

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
External Tools
2+
==============
3+
4+
About
5+
-----
6+
This plugin provides a way to quickly launch external tools (i.e. non-geany
7+
tools) in the same context as a document. For example, this may include
8+
starting a terminal or a file manager in the same directory as the current
9+
file.
10+
11+
Supported tools
12+
---------------
13+
The tools currently supported include:
14+
15+
1. Open Terminal: This option launches a terminal in the same directory as the
16+
current document.
17+
18+
2. Open Directory: Launches a file manager, in the same directory as the
19+
current document.
20+
21+
They may be launched from the *Tools* menu, or via a shortcut.
22+
23+
Configuration
24+
-------------
25+
In the plugin's preferences you can adjust the command used to spawn each
26+
tool. Occurrences of `%f` in the provided commands are substituted with the
27+
path to the current file, while `%d` is substituted with the path to the
28+
directory in which the file resides.
29+
30+
If the current document is *untitled*, %d is replaced with the home directory,
31+
while %f is effectively erased.
32+
33+
**Tip:** Some file managers support opening a window at a directory *and*
34+
placing focus on a specific file. Examples: `nemo %f`, `nautilus %f`, `dolphin
35+
--select %f`.
36+
37+
Adding new tools
38+
----------------
39+
At the moment, adding new tools requires modifying the plugin's source, though
40+
the code is structured in a way to easily accommodate this.
41+
42+
Bug reports, suggestions, patches
43+
---------------------------------
44+
You can report bugs, or suggest new tools or other improvements at the
45+
geany-plugins project on GitHub: https://github.com/geany/geany-plugins. You
46+
may page the developer using `@gkatev`.
47+
48+
License
49+
-------
50+
The External Tools plugin is distributed under the terms of the GNU General
51+
Public License as published by the Free Software Foundation; either version 2
52+
of the License, or (at your option) any later version. A copy of this license
53+
can be found in the file COPYING included with the source code of this program.
54+
55+
Contact
56+
-------
57+
George Katevenis <george_kate(at)hotmail(dot)com>

externaltools/src/Makefile.am

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include $(top_srcdir)/build/vars.build.mk
2+
plugin = externaltools
3+
4+
geanyplugins_LTLIBRARIES = externaltools.la
5+
6+
externaltools_la_SOURCES = externaltools.c
7+
8+
externaltools_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"ExternalTools\"
9+
externaltools_la_LIBADD = $(COMMONLIBS)
10+
11+
include $(top_srcdir)/build/cppcheck.mk

0 commit comments

Comments
 (0)