Worker file manager

1. Filtering

The list view can be filtered to only show some of the entries in the directory.

1.1. Permanent filters

Filters can be set with the "set filter" command that are active until changed explicitly. Example usage is to hide all backup files ending with ~.

1.2. Temporary filters

When searching for entries in the list view with the command "search entry", only the matching entries are shown in the default configuration. This allows to easier spot the wanted entry especially for large directories. The matching characters are highlighted in the file name until the search is finished by moving the cursor or pressing Escape.

In the default configuration, the key "Ctrl-s" calls the "search entry" command and thus activates the search mode. Calling the command again (or pressing "Ctrl-s" again), will enter the search string previously used.

There are two ways of entering such filters. The first method is matching just the file name by entering a pattern. The second method, supported since Worker 3.6, supports more complex expressions.

1.2.1. File name matching

The search string can contain wildcards like "*.c". If no entry matches, the so-called flexible matching is applied. With this mode, all entries matches that contain the characters in the given order no matter if any other character is between two search characters.

1.2.2. Expression matching

Since Worker 3.6, it is also possible to enter a more complex expression to allow more flexible filters. The idea is that multiple variables are defined and can be checked against specific values in a boolean expression. For example, if you want to show only those files which contains one of two different patterns and is of a minimum size, you can enter something like this: "((name == *foo* || name == *bar* ) && size > 10m)".

To use this matching method, the entered string must start with a "(". Then the whole string is parsed as a boolean expression and all entries will be shown, for which the expression evaluates to true.

The list view bar shows the valid part of the entered string to help identifying correct expressions.

1.2.2.1. Basic expressions

A valid expression must contain of at least one of the following comparisons:

Variable Types of comparison Description
name == pattern ==, !=, <, <=, >=, >, ~
  • The expression compares the file name against the given pattern.
  • When using the operator "==" or "!=", the pattern may contain the wildcards *.
  • When using the operator "~", the flexible matching method is used, described above.
  • For the other operators "<, <=, >=, >", lexicographical comparison is used.
  • The pattern can be with or without quotes. If used without quotes, some characters like whitespaces, parentheses, etc, are not allowed (basically anything that makes the string ambiguously).
type == pattern ==, !=, <, <=, >=, >, ~ The comparison is similar to the "name" variable, but in this case the file type is used for comparison instead.
size == value[modifier] ==, !=, <, <=, >=, >, ~
  • The expression compares the file size against the given value, with an optional modifier.
  • When using the operator "~", the actual file size may be 10% larger or smaller than the given value.
  • The optional modifier can be one of the following:
    • k or kb for 1000 times the value
    • kib for 1024 times the value (2^10)
    • m or mb for 1,000,000 times the value
    • mib for 1,048,576 times the value (2^20)
    • g or gb for 1,000,000,000 times the value
    • gib for 1,073,741,824 times the value (2^30)
state == selected ==, !=
  • The expression checks if the file is selected or not.
timemod == time description ==, !=, <, <=, >=, >
  • The expression checks if the file has been modified before or after the given time description.
  • The time description can be an absolute date in the format YYYY-MM-DD, or an relative date from now.
  • For absolute times, greater means younger than the date, for relative times it means older than the the given time span from now.
  • Relative dates can use the suffix "m" for minutes, "h" for hours, "d" for days, and "w" for weeks.
  • Examples:
    • (timemod >= 2016-01-01) shows only files that have been modified after first of January 2016.
    • (timemod >= 1d) shows only files that have been modified more than one day ago.
timeaccess == time description ==, !=, <, <=, >=, >
  • Similar to timemod, this expression checks if the file has been accessed before or after the given time.
1.2.2.2. Boolean combinations

Any of the basic expressions can be combined so that all or any of the expressions must be true.

Examples:
1.2.2.3. Shortcuts

For convenience and faster typing, it is also possible to use shorter forms of the expressions. Most spaces are also not necessary to enter. The following abbreviations are possible:

Abbreviation Description
n short form for "name"
s short form for "size"
t short form for "type"
st short form for "state"
tm short form for "timemod"
ta short form for "timeaccess"
sel short form for "selected"
= short form for "=="
| short form for "||"
&& short form for "&&"
Examples:
1.2.2.4. Interactive help

To make entering filter expressions easier, Worker will show some help in the statebar listing all possible continuations for the current filter string. The help will appear one second after the last text change and will remain visible for five seconds.

The help tries to give hints about what the internal parser expects to see next, although it is not very strict. The possible abbreviations listed above are not taken into account, and elements like the file name pattern is only shown as a suggestion when the pattern is missing completely. After the first character, the next possible element is shown even though the pattern can still be modified.

Examples:
  1. When entering "(", the help will show that you may enter "name", "size", etc.
  2. When entering "(name==" ,the help will indicate that it expects a file name pattern.
  3. When entering "(name==f", the help will suggest "&&", "||", ")" but the pattern can still be continued.

1.3. Examples


Example: This is the src directory of Worker without any filter applied.


Example: The filter "*worker" is applied, only the matching entries are shown and the matching characters are highlighted. The filter string itself is visible in the top list view bar.


Example: Now the filter string is "orker". Since no file starts with "orker, the flexible matching is used. The highlighted characters are shown again making it easier to spot the relevant matches. The filter string in the list view bar starts with a tilde to indicate that the flexible matching is active.

The flexible matching actually saves you from entering wild cards. Usually this is much faster to enter since you only need to enter the characters and don't have to think about some unimportant characters in between.


Example: The expression ((n=*.cc|n=*.hh)&s<=10k) is applied to only show files ending with .cc or .hh and the size is less than 10k. The filter string in the list view bar starts with "e:" to indicate that the following expression is used to filter the list view.