Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Customizing

One of the main goals of Henactor is to be completely customizable. Most, if not all, things you see in the screen can be changed. The best way to do so is by using themes.

A theme is a combination of a css file named theme.css and an optional file named icons.toml. At startup Henactor will search for themes inside the themes directory in your configuration. Each theme should be on it's own directory under themes.

Tip: If you set the Auto reload option every change to the theme will be instantly reflected. You don't have to worry about restarting the application.

For more details in both theming files follow this links:

As a reminder, there a few things that can be easily changed under the Settings -> Appeareance.

CSS

Icons

Henactor is shipped with it's own set of icons that come from Lucide. They are used by default and as fallback when something goes wrong.

There are two categories of icons that are used across the application:

  • UI icons: General icons used mostly for buttons
  • Rule icons: Icons that are applied for a certain file or directory

Let's make some changes!

Create icons.toml under $CONFIG/henactor/themes/$THEME and copy this:

[ui]
directory = "flat-color-icons:folder"
file = "flat-color-icons:file"
link_to_dir = "lucide:folder-symlink:#FAC529"

[rules]
'application/json' = "vscode-icons:file-type-json"
'.*\.go' = "vscode-icons:file-type-go"

As you can see, there is a section for each icon category. Each item has a key followed by = and then a value. Each value is what we call an Icon String. You should read Icon String to learn more about.

In the ui section, the keys are predefined. You can find them all in UI icons.

In the rule section, the keys can be either a mimetype or a regex. Rules are checked as the following in that same order:

  • If the mimetype of an file matches a key then that will be used as icon
  • If no match is found then every key will be considered as regex and the first one that matches will be used
  • If no regex matches then the icon defined for this kind of file in the ui section will be used
  • If no icon was specified there then the default will be used

The regex is checked against full paths instead of names.

Tip: You can see the mimetype of a file by toggling the Detailed kind column in the list view. Not all of them have one though.

Icon String

An Icon String is nothing but a text used to represent an icon. It follows a certain format and can be any of the following.

Absolute Path

A file system path starting at the root directory. That is / if you are in a UNIX based system or \ on Windows.

  • /path/to/an/icon.png

Relative Path

A file system path starting at ./ or ../. In our context, they are resolved by joining it with the absolute path of the theme you're editing.

  • ./icon.png -> /my/config/henactor/themes/mytheme/icon.png
  • ../icon.png -> /my/config/henactor/themes/icon.png

URL

Any valid URL. Usually, it start with https, but in theory it can be any protocol the <img> tag supports and that is allowed by Henactor's CSP options.

  • https://a.com/icon.pgn
  • ftp://a.com/icon.pgn

Iconify

A text following the format of prefix:icon:color where

  • prefix is an icon set, such as vscode-icons or tabler
  • icon is an icon under that set, such as file-type-go or 10k
  • color is hex color, such as #000 or #FFFFFF. This one is optional and you can omit the whole :color

This is "translated" to a resource under https://api.iconify.design which is as service that provides unified access to many open-source icon sets. You can browse it here.

Check them out! Iconify

  • lucide:folder-symlink:#FAC529
  • vscode-icons:file-type-ocaml

Literal

A regular text with no special meaning. It follows the format of literal;color where literal is any text such as pdf or yaml and color is an optional hex color such as #BE23aF or #FFAB32

  • pdf;#8839ef
  • yaml

UI icons

This is a list of every icon used across Henactor's UI. You can set them in your theme or not. If not, defaults will be provided. Read Icons to learn more.

  • sort:
  • filter:
  • directory:
  • file:
  • link_to_dir:
  • link_to_file:
  • x:
  • plus:
  • search:
  • grid_view:
  • list_view:
  • tree_view:
  • empty_dir:
  • settings:
  • commands:
  • keyboard:
  • rotate:
  • edit:

Note for myself: Remember to keep this up to date 👽.

Filtering

Henactor allows you to filter entries inside the current directory. It gives access to a small, simple and yet powerful language to write expressions that are evaluated to filters.

If you are into that, check the grammar!

Roughly what happens is that every entry has it's [Properties] checked against the expression, which always evaluate to a boolean value (either true or false). If it yields true then you'll see it in your explorer. If not, it will be hidden.

The language

This little language we spoke about is very short and has only a few kinds of objects and operators. Because of the few checks that are made, you gain a lot of flexibility to write anything, but this come with an eventual hard time trying to understand why you see something that is expected to not be there (or the other way around).

Objects

These objects represent all values that you can use in your expression. They can be combined with operators, but they also have a "default" value when used alone. created = $05/04/2031$ is the same as $05/04/2031$.

Word

It's a text with no special meaning. Such as potato or tomato.

secret or "public" is the same as name = secret or name = "public".

You can use " for words if you like or if you want something with special meaning to be escaped.

Date

Dates should always be surrounded by $. They should also be formatted like the following.

  • 2018-02-14 00:28:07
  • 2018-02-14

name = file and $2023-03-22$ is the same as name = file and created = $2023-03-22$

Regex

Just like Dates regular expressions should also be surrounded, but / should be used instead.

  • /.*\.log$/
  • /.log/

/.log/ is the same as name = /.log/ or path = /.log/.

Kind

Kind can be one of

  • link or l
  • directory or d
  • file or f

If you want the literal value you should surround it with ". file is diferent from "file".

link and name = "file" is the same as kind = link and name = "file"

Pretty byte

It's a floating point or integer number followed by a size. This is what you can use:

  • B for bytes
  • GB for gigabytes
  • GIB for gibibytes
  • KB for kilobytes
  • KIB for kibibytes
  • MB for megabytes
  • MIB for mebibyte
  • PB for petabytes
  • PIB for pebibytes
  • TB for terabytes
  • TIB for tebibytes

Again, you can escape it's meaning surrounding it with ".

3.2MB and kind = file is the same as size = 3.2MB and kind = file

Operators

Properties

Every entry, either a file or directory, has a few properties that are "Filterable". Each of these can be compared with some of the objects you just read about.

  • name
  • path
  • kind
  • size
  • created
  • modified: Last modification date
  • accessed: Last access date

You're felling lazy you can type just the first letter of a property. name is the same as n.

Commands

In order to minimize the need for mouse usage, Henactor heavily relies on a command system. Roughly, a command is just an interaction that can be made using the Command pallet or a Keybind.

When you look at Settings -> Keybinds, you'll see a huge list of commands. Each one of them is followed by a list of keyboard shortcuts. You can change them as you like. If all the key binds are removed, the only way to call the command is by using the Command pallet.

If you also removed binds for the Command pallet you can find a button in the Tools section of the sidebar 👍

Using the same shortcuts

Using the same keyboard shortcuts for different commands is allowed, but can sometimes be problematic. Internally Henactor keeps track of the context in which a command can be executed. If multiples commands can be executed in a given context, the first one that can will be executed. That simple. In order to never have to worry about that, always use different binds to each command.

The default configuration includes a few commands that share key binds. We carefully select those and is safe to keep them.