English | 日本語
Open With asks which application should open a file this time, as
Finder’s and Explorer’s Open With do. The default application and the
open rule in File Associations still decide
what open_with_os does every other time; Open With is for the time you want
something else.
Choose File → Open With ▸ Choose App…, or Open With… in the
context menu, or run open_with from the
command palette. It has no key in any keymap
preset; give it one in KEY_BINDINGS if you use it often (see
Key Bindings).
A list of applications opens over the active pane. Type to narrow it, and
press Enter to open the selected files — or the file under the cursor — in
the one highlighted. The line under the list shows the command it runs or
where the application is, and the OS’s default application for the file says
default on the right.
The application you chose last for a file type is listed first the next time, and XeFM remembers it after a restart.
Two kinds of entries, in this order:
open_with lists of the
FILE_ASSOCIATIONS rules the file matches (see below).gio) offers for the file.The OS’s applications are listed in the desktop app, and in the terminal app
when it runs on the computer you sit at. Over SSH they are left out: they
would open on the other machine, not on yours. On Linux the terminal app also
needs a graphical session (DISPLAY or WAYLAND_DISPLAY).
With several files selected, only the applications that can open every one of them are listed, and all the files go to the one you choose in one launch. Photos and a PDF together, say, list what opens both. When nothing opens them all, XeFM says No app can open all selected files.
A program from a '*' rule matches every file, so it is always listed — a
good place for an editor or a hex viewer.
Give a FILE_ASSOCIATIONS rule an open_with list in ~/.xefm/config.py.
Each entry is shaped like a PROGRAMS entry:
a name, a command list, and optional options.
FILE_ASSOCIATIONS = [
{
'pattern': ['*.jpg', '*.png'],
'open': ['open', '-a', 'Preview'],
'open_with': [
{'name': 'GIMP', 'command': ['open', '-a', 'GIMP']},
{'name': 'Pixelmator', 'command': ['open', '-a', 'Pixelmator Pro']},
],
},
{
'pattern': '*',
'open_with': [
{'name': 'VS Code', 'command': ['code']},
{'name': 'Hex view', 'command': ['hexyl'], 'terminal': True},
],
},
]
open, view and
edit, where the first matching rule wins. The lists are joined top to
bottom, so a photo above is offered GIMP, Pixelmator, VS Code and Hex view.XEFM_*
environment a PROGRAMS entry gets.'terminal': True hands the terminal to the program and waits, for
full-screen tools like less or hexyl — in the desktop app it runs in a
terminal session of XeFM’s own instead (see Terminal).
Without it the program runs in the background and its output goes to the
log pane.External Programs (programs) lists every
PROGRAMS entry whatever the cursor is on: it is for commands that work on
XeFM’s state — a Git command, a disk-usage report, a script reading
XEFM_*. Open With lists only what fits the files: it is for opening them in
an application.
open, view and edit per file typePROGRAMS and the terminal option