Let's rewind a bit: you could already run external process in donna by using the
exec which supports a few modes: simply run the specified command
line, run & wait for it to be over, run it in a(n external) terminal, or capture
its output and process it as search results.
This was done using prefixes, e.g.
exec:>foobar would run
foobar inside a
terminal, as indicated by the greater than sign.
First of all: you can now define which prefixes to use for each modes: a few
options have been added in
providers/exec so you can define the prefix for
each mode, as well as the default mode to use (i.e. when no prefix was used).
Support multiple terminals
In addition, for the mode "terminal" you can also use a "secondary prefix" to
specify which terminal to use. This might be of interest if you'd like to use
different terminal emulators from time to time, or to use different options
(e.g. whether or not the terminal should automatically close its window after
the process ended or not, often an option
-hold or similar).
The command line prefix to start the terminal is defined under option
providers/exec/terminal/cmdline Let's say you set it to use urxvt as your
Now you want to be able to start some process in another terminal, e.g. xterm.
Then you would simply add a secondary prefix - e.g.
xt: - for this case. An
example configuration could be:
[providers/exec] prefix_terminal=> [providers/exec/terminal] cmdline=urxvt -e [providers/exec/terminal/] prefix=xt: cmdline=xterm -e
With such a config, you can start something in urxvt or xterm simply by using
exec:>foobar (urxvt) or
The other addition in the support of embedded terminals. Once again, donna will let you use the terminal of your choice, so embedding terminals is done via the XEMBED protocol (supported, for example, by urxvt or xterm).
To use an embedded terminal, you first need to add it to your layout. This is
done simply by adding a new componement "terminal" Much like for treeviews, it
should be followed by a colon and a name, identifying it & defining where its
configuration will be found (namely, under
After that, you can start a process in the embedded terminal using command
terminal_add_tab() Embedded terminals are indeed automatically tabbed, so when
starting a new process within a new embedded terminal, a new tab is added to
donna's terminal component (which is only visible if there's at least one tab).
The command takes a few arguments, besides the actual terminal (name) to use: The command line of the process to start of course, but also optionally the command line for starting the terminal emulator.
If not specified, option
terminals/<NAME>/cmdline will be used. And as a
facility, it can also be a string starting with a colon, to load an alternative
option. For example with ":foobar" option
would be used.
This command line must contain
%w which will be parsed to the window id to be
used by the terminal emulator, as per XEMBED protocol.
Terminals support a few options:
always_show_tabswill determine whether the tab bar is visible even if there's only one tab (true), or only when there are at least 2 tabs (false, the default).
Double clicking a tab will send the focus to the embedded terminal. By default,
clicking in a terminal should also give it focus. Note that for this to work,
donna needs to do some work & handle mouse events on its own, as (most) terminal
emulators do not implement a click-to-focus model. If this is causing issue with
your terminal, you can disable it by setting boolean option
focusing_clickmakes it that a left click on the terminal will only focus it, but the click (button press) won't be sent to the terminal. This can be disabled by setting it to false. Also note that this obviously only works when option
As usual, options can be set under
terminals/<TERMINAL>/ for terminal-specific
options, or under
defaults/terminals for options common to all terminals.
By default, tabs will use the command line as title. donna will then update
the title as a window manager would, relying on the properties
WM_NAME) set on the window by the emulator.
Via the exec domain
Of course you can also use embedded terminals via the exec domain, since a new prefix/option cas been added: "embedded_terminal"
providers/exec/embedded_terminal/terminal must be set to the name of
the terminal component to use; And you can also use option
specify the command line to use to start the terminal emulator.
Again, via the use of secondary prefixes this will allow to specify which emulator to use, of use different options.
Updating your config to benefit from all of this
Now, there's still work to do when it comes to upgrades in donna. Specifically,
there isn't currently a way to update/import new defaults, so that is a manual
operation. Archers, think of this as some king of
.pacnew handling! ;)
Here's the patch to update your donnatella.conf (from last time) :
- diff --git a/misc/donnatella.conf b/misc/donnatella.conf
- index 39ac154..d45fd98 100644
- --- a/misc/donnatella.conf
- +++ b/misc/donnatella.conf
- @@ -5,7 +5,7 @@
- @@ -38,6 +38,10 @@ prefix=~
- @@ -61,10 +65,10 @@ replacement=command:
- # ALIASES
- @@ -771,12 +775,21 @@ trigger=command:node_trigger(@ask_text(Enter FL to trigger))
- trigger=command:tv_start_interactive_search (%o)
- +# F2 to rename
- +trigger=command:tv_column_edit (%o, %n, name)
- # F6 to edit focused item (vim in a terminal)
- -trigger=exec:>vim %:n
- +trigger=exec:!vim %:n
- # F9 to view focused item (less in a terminal)
- -trigger=exec:>less %:n
- +trigger=exec:!less %:n
- +# Terminals
- # selection stuff -- note that this required a patched GTK (to invert range)
- @@ -1105,7 +1118,32 @@ not_active_list=true
- -terminal=urxvt -hold -e
- +cmdline=urxvt -e
- +cmdline=urxvt -hold -e
- +# TERMINALS
- +cmdline=urxvt -embed %w -e
- +cmdline_hold=urxvt -embed %w -hold -e
And with that config (and assuming you have urxvt installed, if not you might want to update things to use whatever emulator you prefer), you can now view a file within donna by pressing F9, and edit it by pressing F6. This will be done usnig less/vim inside an embedded terminal.
You can also start a new shell in the current location, in an embedded terminal
t or in an external terminal via
Where to get it?
For a a complete list of all changes/bug fixes please refer to the git log.
And in case you read all that and are wondering what donnatella is, or are looking for more information, download links, etc please refer to donnatella.
As always, bug reports, suggestions or any other form of constructive criticism is very much welcome. You can open issues on github, use the thread on Arch Linux forums, or simply email me.