Skip to content

Commit

Permalink
[New] External Tools: Launch system tools, like terminal or file manager
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gkatev committed Apr 14, 2024
1 parent a8f26ab commit 7555c3a
Show file tree
Hide file tree
Showing 13 changed files with 869 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ M: Pavel Roschin <rpg89(at)post(dot)ru>
W: http://plugins.geany.org/defineformat.html
S: Maintained

externaltools
P: George Katevenis <george_kate(at)hotmail(dot)com>
g: @gkatev
M: George Katevenis <george_kate(at)hotmail(dot)com>
W: http://plugins.geany.org/externaltools.html
S: Maintained

geanyctags
P: Jiří Techet <[email protected]>
g: @techee
Expand Down
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ if ENABLE_DEFINEFORMAT
SUBDIRS += defineformat
endif

if ENABLE_EXTERNALTOOLS
SUBDIRS += externaltools
endif

if ENABLE_GEANYCTAGS
SUBDIRS += geanyctags
endif
Expand Down
9 changes: 9 additions & 0 deletions build/externaltools.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
AC_DEFUN([GP_CHECK_EXTERNALTOOLS],
[
GP_ARG_DISABLE([ExternalTools], [auto])
GP_COMMIT_PLUGIN_STATUS([ExternalTools])
AC_CONFIG_FILES([
externaltools/Makefile
externaltools/src/Makefile
])
])
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GP_CHECK_CODENAV
GP_CHECK_COMMANDER
GP_CHECK_DEBUGGER
GP_CHECK_DEFINEFORMAT
GP_CHECK_EXTERNALTOOLS
GP_CHECK_GEANYCTAGS
GP_CHECK_GEANYDOC
GP_CHECK_GEANYEXTRASEL
Expand Down
1 change: 1 addition & 0 deletions externaltools/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
George Katevenis <george_kate(at)hotmail(dot)com>
340 changes: 340 additions & 0 deletions externaltools/COPYING

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions externaltools/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2024-04-14 Version 0.1

* Initial plugin release, with support for
'Open Terminal' and 'Open Directory'.
4 changes: 4 additions & 0 deletions externaltools/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include $(top_srcdir)/build/vars.auxfiles.mk

SUBDIRS = src
plugin = externaltools
1 change: 1 addition & 0 deletions externaltools/NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See "ChangeLog"
57 changes: 57 additions & 0 deletions externaltools/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
External Tools
==============

About
-----
This plugin provides a way to quickly launch external tools (i.e. non-geany
tools) in the same context as a document. For example, this may include
starting a terminal or a file manager in the same directory as the current
file.

Supported tools
---------------
The tools currently supported include:

1. Open Terminal: This option launches a terminal in the same directory as the
current document.

2. Open Directory: Launches a file manager, in the same directory as the
current document.

They may be launched from the *Tools* menu, or via a shortcut.

Configuration
-------------
In the plugin's preferences you can adjust the command used to spawn each
tool. Occurrences of `%f` in the provided commands are substituted with the
path to the current file, while `%d` is substituted with the path to the
directory in which the file resides.

If the current document is *untitled*, %d is replaced with the home directory,
while %f is effectively erased.

**Tip:** Some file managers support opening a window at a directory *and*
placing focus on a specific file. Examples: `nemo %f`, `nautilus %f`, `dolphin
--select %f`.

Adding new tools
----------------
At the moment, adding new tools requires modifying the plugin's source, though
the code is structured in a way to easily accommodate this.

Bug reports, suggestions, patches
---------------------------------
You can report bugs, or suggest new tools or other improvements at the
geany-plugins project on GitHub: https://github.com/geany/geany-plugins. You
may page the developer using `@gkatev`.

License
-------
The External Tools plugin is distributed under the terms of the GNU General
Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. A copy of this license
can be found in the file COPYING included with the source code of this program.

Contact
-------
George Katevenis <george_kate(at)hotmail(dot)com>
11 changes: 11 additions & 0 deletions externaltools/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include $(top_srcdir)/build/vars.build.mk
plugin = externaltools

geanyplugins_LTLIBRARIES = externaltools.la

externaltools_la_SOURCES = externaltools.c

externaltools_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"ExternalTools\"
externaltools_la_LIBADD = $(COMMONLIBS)

include $(top_srcdir)/build/cppcheck.mk
Loading

0 comments on commit 7555c3a

Please sign in to comment.