Configure Oriel
Where the file livesPermalink to Where the file lives#
Oriel reads one configuration file when it starts. It looks in these places, in order, and uses the first one that applies:
The path in
ORIEL_CONFIG, if you've set it.$XDG_CONFIG_HOME/oriel/config.sgl, if you've setXDG_CONFIG_HOME.~/.config/oriel/config.sgl.
On Windows, the default configuration path is %LOCALAPPDATA%\Oriel\config\config.sgl; ORIEL_CONFIG can select a different file.
Oriel picks exactly one file. If you set ORIEL_CONFIG, it reads that file and never also reads the one in ~/.config. That makes ORIEL_CONFIG a good way to try out a new configuration without touching your real one:
ORIEL_CONFIG=~/experiments/oriel.sgl oriel https://usesigil.org/Oriel doesn't expand ~ or variables inside ORIEL_CONFIG itself, so let your shell do it, as it does above. A relative path is fine too: it's taken from the directory you start Oriel in.
Having no file at all is normal, and Oriel starts quietly with its defaults. But if ORIEL_CONFIG names a file that doesn't exist, Oriel treats that as a mistake and tells you, because you clearly meant to load something.
Oriel reads the file once, at startup. To apply a change, restart Oriel.
What a configuration looks likePermalink to What a configuration looks like#
A configuration file is a Sigil program whose last expression is a config. In config, you name each setting you want to change, followed by its value. Everything you leave out keeps its default.
Here's a configuration that sets search, quickmarks, hints and keys:
(config
hint-characters: "asdfjkl"
default-search: "ddg"
quickmarks: (quickmarks
"ddg" "https://duckduckgo.com/?q={}"
"w" "https://en.wikipedia.org/w/index.php?search={}"
"hub" "https://github.com/{}"
"ghn" "https://github.com/notifications"
"mail" "https://fastmail.com")
nav-keymap: (keys "x" 'tab-close
"gw" '(hints new)))You don't need to import anything. config, quickmarks, keys and the other names on this page are already available when Oriel reads your file, along with Sigil's usual libraries for strings, lists, math, files and processes. You can still import any other Sigil library you have installed.
Each setting can appear only once, and Oriel checks every value when it loads the file. A misspelled setting name, a setting given twice, or a value of the wrong kind is an error, not something Oriel quietly ignores.
Choose your settings lists general settings and defaults. Adjust text, prompts and scrolling covers the interface, fonts and pointer preferences.
Dark and light pagesPermalink to Dark and light pages#
Most sites have a dark theme and a light one, and they pick between them by asking the browser which the reader prefers. Oriel answers "dark" unless you say otherwise, so sites that have a dark theme show it, and pages don't flash white while they load.
To see light pages instead, or to follow your desktop's light or dark setting, set color-scheme::
(config
color-scheme: 'system)To switch while you're browsing, use :color-scheme light, :color-scheme dark or :color-scheme system, or press td to flip between dark and light. :color-scheme-toggle does the same as td. :color-scheme on its own tells you which you asked for and which is in effect. Open tabs and new ones follow the change without reloading, and it lasts until you close Oriel. Oriel never writes it into your configuration.
Downloads and release checksPermalink to Downloads and release checks#
These download settings apply to Linux and macOS. The Windows preview doesn't handle downloads; see Download and upload files.
On Linux, Oriel opens the desktop Save As dialog for each download. The configured download directory and the server's suggested filename are the defaults. Canceling saves nothing. If the desktop portal is unavailable, Oriel saves in the configured directory and reports the fallback. When there is no configured directory, the default is your desktop's XDG download directory or ~/Downloads. The portable Guix installer shares only the configured download directory with Oriel for saving files. Confirm Replace in the dialog to replace an existing regular file you own. On macOS, the default is ~/Downloads, and the destination must be on an APFS volume. Folders on exFAT, FAT32 or HFS+ drives and network shares refuse with a message and save nothing. To choose a directory yourself and turn off release checks, use a complete file like this:
(config
download-directory: "/home/you/Downloads/oriel"
update-check: #f)Supported Linux and macOS portable releases check in the background at startup and on a daily schedule. They fetch authenticated release metadata from pkg.usesigil.org, without cookies, browsing history or a device identifier. A newer compatible release produces a notice. :update-release opens its release page only when you ask; nothing downloads or installs automatically. Offline failures stay in the log. A killed check can retry once after a cooldown.
Set update-check: #f to stop both check requests and access to update state. A configuration or quickmark loading error disables checks for that session too. Checks remain disabled in the Windows preview even with #t. Private browsing follows the same update policy and shares the desktop update state, separately from the private page profile.
QuickmarksPermalink to Quickmarks#
quickmarks takes pairs of strings: a name, then an address. Names use letters, digits, underscores and hyphens, and they're case-sensitive. Using the same name twice in one quickmarks is an error, so you never have to wonder which one wins.
Oriel also has one built-in quickmark, ddg, for DuckDuckGo. It's a fallback: your quickmarks: don't remove it, and a quickmark of your own named ddg takes its place. To turn off searching from the address prompt, set default-search: #f.
Every address starts with http:// or https://. To make a quickmark that takes an argument, put a pair of braces, {}, exactly once, either in the path or in a query value:
You type | Oriel opens |
|---|---|
|
|
|
|
|
|
|
|
Everything after the name is one argument, with spaces kept. Oriel encodes it for the spot it goes into: in a query value, everything but letters, digits and -._~ is encoded, and in a path, slashes are kept as well. That's why the last example can't sneak a query onto the address. If you need literal braces in an address, write them as %7B%7D.
Quickmarks from other filesPermalink to Quickmarks from other files#
Use read-quickmarks-file to keep some quickmarks in another file. It reads data in the same format as quickmarks.sgv; it doesn't run the file as a program. For example, put this in personal.sgv:
(quickmarks "docs" "https://scheme.com/tspl4/")Then combine your inline entries with that file and a file you keep only on your work machine:
(config
quickmarks: (append (quickmarks "mail" "https://fastmail.com")
(read-quickmarks-file "personal.sgv")
(read-quickmarks-file "work.sgv" missing: '())))No import is needed. Relative paths start in the directory of the configuration file Oriel captured at startup, including a file selected with ORIEL_CONFIG. A path starting with ~/ starts in your home directory. A missing file is an error unless you supply missing:; Oriel returns that value only when the file is absent. Use missing: '() for a file that exists on only some machines. Other read errors, malformed or trailing data and invalid addresses still produce a diagnostic with the file path and make Oriel use its defaults.
Duplicate names in the combined configured lists are errors; no entry wins. These configured entries take precedence over managed quickmarks.sgv, which takes precedence over built-ins. A parameterized entry read from a file can be your default-search:. Private sessions can read the files too. Oriel never writes to these extra files: :quickmark-add and :quickmark-remove still write only to managed quickmarks.sgv.
Quickmarks you add while browsingPermalink to Quickmarks you add while browsing#
Quickmarks you add with :quickmark-add are saved in quickmarks.sgv, in the same directory as your configuration file. It uses the same quickmarks form, so you can move entries between the two files by copy and paste:
;;; Managed by Oriel via :quickmark-add and :quickmark-remove; safe to edit.
(quickmarks
"docs" "https://scheme.com/tspl4/"
"npm" "https://www.npmjs.com/search?q={}")Oriel reads this file as data and never runs it, and it rewrites it in its own tidy layout when you add or remove an entry, so comments you add will be lost. You're welcome to edit it by hand while Oriel isn't changing it.
When a name is in both files, the one in config.sgl wins. That's why :quickmark-add and :quickmark-remove refuse a name your configuration defines: they'd have no visible effect. Edit the configuration for those. Oriel also won't let you remove the quickmark your default-search: points to; choose another default first.
If quickmarks.sgv gets damaged, Oriel tells you when it starts, keeps the quickmarks from your configuration working, and leaves the file alone until you fix it. It never replaces your file with an empty one.
Build on a configurationPermalink to Build on a configuration#
Because your file is a program, a configuration can be a value you name and build on. based-on: starts from another configuration instead of the defaults. This file keeps one configuration for home and adds work quickmarks when you start Oriel with WORK=1:
(define home
(config
default-search: "ddg"
quickmarks: (quickmarks
"ddg" "https://duckduckgo.com/?q={}"
"mail" "https://fastmail.com")))
(define work
(config based-on: home
quickmarks: (append (config-quickmarks home)
(quickmarks
"jira" "https://jira.example.com/browse/{}"
"wiki" "https://wiki.example.com/"))))
(if (getenv "WORK") work home)Two things are worth seeing here. The last expression is an if, and that's fine: Oriel only needs the file to end with a configuration, however it gets there. And quickmarks: replaces the base's quickmarks rather than adding to them, so the work configuration appends its own to the ones it reads back with config-quickmarks.
Both configurations are built every time the file loads, so a mistake in the work quickmarks shows up at home too, not on the first day you need them.
config-with does the same as config based-on:, with the base written first: (config-with home default-search: #f).
When something goes wrongPermalink to When something goes wrong#
Oriel loads all of your configuration or none of it. If anything in the file fails, whether that's a typo in the Sigil, an unknown setting or a quickmark with a bad address, Oriel starts with its defaults instead and tells you why, both in the browser and on standard error:
default-search: "dgg" isn't a quickmark with {} in it (/home/you/.config/oriel/config.sgl:2)
Using defaults. Fix the file and restart Oriel.The message stays on screen until you dismiss it, and :config-error shows it again later in the session. Oriel never rewrites or repairs your file. Quickmarks in quickmarks.sgv still load when the configuration fails, as long as that file is fine itself.