You are reading the docs for the unreleased main branch. See the latest release.
Skip to content

Configuration ​

touchcue reads $XDG_CONFIG_HOME/touchcue/config.toml, else ~/.config/touchcue/config.toml. --config <PATH> names another file, which must then exist. A missing default file means the defaults below.

Every key is optional. Unknown keys and out-of-range values are errors: touchcue run refuses to start and touchcue check reports them, both with the location in the file where it is known.

Example ​

The defaults, written out:

toml
# locale is read from the environment when unset

[output]
mode = "popup"
fallback = "notification"

[popup]
position = "center"
output = "focused"
min_display_ms = 800
show_delay_ms = 0
modal = false
modal_dim = 0.4
modal_dismiss = true
animations = true

[notification]
urgency = "critical"
safety_timeout_s = 60

[icons]
# theme is detected when unset

[templates]
title = 'Touch {{ device.vendor or "your security key" }}'
body = '{{ requester.label or process.name or "An application" }} is waiting for {{ request.action }}'

[sources.fido]
enabled = true
keepalive_timeout_ms = 1500
retry_window_ms = 1000

[sources.gpg]
enabled = true

[ipc]
enabled = true

[dbus]
enabled = true

[compat.maxbaz_socket]
enabled = false

[requester]
skip = [
  "sh", "bash", "dash", "zsh", "fish", "nu", "ksh", "mksh", "tcsh", "csh", "elvish", "xonsh",
  "tmux*", "screen", "zellij", "herdr", "abduco", "dtach",
  "timeout", "nice", "nohup", "setsid", "stdbuf", "time", "xargs", "flock", "ionice", "chrt",
  "taskset", "env", "sudo", "doas", "su", "run0",
  "systemd", "init",
]
extend_skip = []

locale ​

KeyValuesDefault
localea locale name such as pl, de or pl_PL.UTF-8from the environment

locale chooses the language of the built-in prompt text: the default title and body, request.action, and the (cancelled) and (timed out) suffix. English, Polish (pl) and German (de) are available. Without locale, or with an empty one, touchcue run reads the first non-empty of LC_ALL, LC_MESSAGES and LANG once at start. The language is the part of the name before the first _, . or @; C, POSIX and other languages mean English; the first non-empty value decides, so an unknown locale does not fall back to the environment. Templates you write are not translated. As a top-level key, locale goes before the first [section] of the file:

toml
locale = "pl"

[output]
mode = "popup"

[output] ​

KeyValuesDefault
modepopup, notification, both, none, commandpopup
fallbackthe samenotification

mode is used when the desktop supports it, else fallback, else nothing is shown.

  • popup shows an overlay popup that takes no input focus. It uses Wayland layer-shell when WAYLAND_DISPLAY or WAYLAND_SOCKET is set and the compositor supports it, else X11 when DISPLAY is set, which includes XWayland. When the display connection is lost, for example because the compositor restarted, touchcue reconnects as it started, through WAYLAND_DISPLAY, else DISPLAY, first after 1 second and then less often, up to once a minute, and shows the prompts still visible again. It does not follow a compositor that comes back under another socket name, and may then reconnect through DISPLAY to XWayland.

  • notification sends a desktop notification over D-Bus; the notification server draws it, here mako:

    A mako notification: Touch your security key, Browser is waiting for a passkey

  • both shows the popup and a notification.

  • none shows nothing.

  • command is accepted, but skipped with a warning. To show prompts through programs such as rofi or fuzzel, use hooks with until; see Launchers.

KeyValuesDefault
positioncenter, top-left, top-right, bottom-left, bottom-right, top, bottomcenter
output"focused", "all", "cursor", or a list of output names"focused"
min_display_ms0 to 600000800
show_delay_ms0 to 6000000
modaltrue, falsefalse
modal_dim0.0 to 1.00.4
modal_dismisstrue, falsetrue
animationstrue, falsetrue

A popup in the top-right corner of an output, with position = "top-right"

Popups are drawn at the scale of the output they are on: at fractional scales such as 1.5 when the Wayland compositor supports fractional-scale-v1, else at the integer scale it prefers. On X11 the scale comes from Xft.dpi.

min_display_ms is the shortest time a shown popup stays visible. show_delay_ms is how long a request must wait before its popup appears.

The default popup, centred: Touch your security key, Browser is waiting for a passkey

Several popups on one output stack in the order the requests started: away from the screen edge, or vertically around the centre with center.

Two stacked popups, one from the browser and one from claude in a terminal

State overlay ​

The application icon is drawn dimmed, with the request's state centred over it. A popup without an icon shows the state alone in the icon's place.

  • While the request waits for a touch, a spinner turns over the icon.

  • When the operation ends, the spinner gives way to a mark on a coloured disc: a check on green after a touch, a cross on red after a cancel or failure, and a clock on amber after a timeout.

    A popup whose spinner turns over the dimmed browser icon, then gives way to a check on a green disc after a touch

    A popup whose spinner gives way to a cross on a red disc after a cancel

    A popup whose spinner gives way to a clock on an amber disc after a timeout

  • When a client retries, the mark gives way to the spinner again.

    A popup whose spinner gives way to the timeout clock, turns again when the client retries, and gives way to the touch check

Each change fades and grows into place over 250 ms. With animations = false, or when the desktop asks for reduced motion, the spinner stands still and each mark appears at once. touchcue reads the desktop preference once at start, through the XDG desktop portal: reduced-motion = 1 in org.freedesktop.appearance, or enable-animations = false in org.gnome.desktop.interface where the portal provides it. Without a portal, motion is not reduced.

Outputs ​

output chooses the monitors that show the popup. The popup's output is chosen when it appears.

  • "focused" lets the Wayland compositor pick, usually the focused monitor. On X11 it is the monitor under the mouse pointer.

  • "all" shows a popup on every output.

    The same popup centred on each of two outputs

  • "cursor" uses the output under the mouse pointer. On Wayland this works only on Hyprland, through its IPC socket. Elsewhere, or when the query fails, touchcue logs a warning and falls back to "focused". On X11 it is the same as "focused".

  • A list such as ["DP-1", "HDMI-A-1"] shows a popup on each listed output that exists. Wayland names come from the compositor (hyprctl monitors, swaymsg -t get_outputs), X11 names from RandR (xrandr --listmonitors). When none of them exists, touchcue logs a warning and falls back to "focused". An empty list or an empty name is an error.

With modal = true, a popup that waits for a touch also blocks clicks: on each of its outputs, a full-screen layer behind the popup takes every click. The keyboard is never grabbed. Keyboard input remains with the focused window. The overlay is removed when no request on that output waits any more, and after 120 seconds at most, even when requests still wait; requests that start while it is shown do not extend it. After those 120 seconds, that output gets no new overlay for 30 seconds.

A modal popup over a dimmed output

  • modal_dim is how dark the overlay is, up to 1.0 (black). 0.0 blocks clicks without dimming:

    A modal popup with modal_dim = 0.0: the output is not dimmed

  • With modal_dismiss = true, a click or touch on the overlay hides the popups and overlays of the requests on it. Only the display is hidden: the request keeps waiting for a touch. The next request on that output gets a new overlay right away. Only the left, middle and right buttons dismiss; scrolling and side buttons do not.

  • With modal_dismiss = false, requests that follow each other can keep an output dimmed for longer than 120 seconds: the limit applies to each overlay, and a new request gets a new overlay once the previous one ended, or 30 seconds after it reached the limit. The keyboard keeps working throughout.

On X11 the overlay blocks clicks without dimming; modal_dim has no effect. On Wayland the overlay is on the layer-shell overlay layer, above windows and panels.

[notification] ​

KeyValuesDefault
urgencylow, normal, criticalcritical
safety_timeout_s0 to 60060

safety_timeout_s is the time after which the notification server withdraws a notification even if the request still waits; touchcue passes it as the notification's expiry, where 0 means never.

[icons] ​

KeyValuesDefault
themethe directory name of an icon theme, such as Papirus-Darkdetected

Application icons from desktop entries and the icon names of [[rules]] are looked up in this theme, then in the themes it inherits from, then in hicolor, as the freedesktop Icon Theme Specification describes, at 64 pixels. Themes are found in ~/.icons, in icons below $XDG_DATA_HOME (~/.local/share when unset) and below each directory of $XDG_DATA_DIRS (/usr/local/share:/usr/share when unset), and in /usr/share/pixmaps, in that order; the first index.theme found for a theme describes it. An icon that no theme holds is then looked for as a file named after it directly in those directories. Only PNG and SVG files are used, and a .png, .svg or .xpm ending of an icon name, as in Icon=app.png of some desktop entries, is ignored. The result of each name lookup is kept: a name found in no theme is not looked up again until the daemon restarts or more than 512 names have been looked up, and a file found is checked to still exist each time it is used. A value that is empty, . or .., or contains / or control characters is a configuration error.

Without theme, touchcue run detects the theme once at start, from the first of these that names an installed theme:

  1. the XDG desktop portal settings icon-theme of org.gnome.desktop.interface, then Theme of org.kde.kdeglobals.Icons;
  2. gtk-icon-theme-name in the [Settings] group of ~/.config/gtk-4.0/settings.ini, then of ~/.config/gtk-3.0/settings.ini;
  3. Theme in the [Icons] group of ~/.config/kdeglobals;
  4. icon_theme in the [Appearance] group of ~/.config/qt6ct/qt6ct.conf, then of ~/.config/qt5ct/qt5ct.conf;
  5. hicolor.

~/.config stands for $XDG_CONFIG_HOME when it is set. On a desktop whose XDG_CURRENT_DESKTOP lists KDE, the KDE portal setting is read before the GNOME one. The portal is skipped when no portal is installed or running on the session bus, and when connecting, starting it and reading both settings take more than 1.5 s. Detection, reading the chosen theme included, takes at most 3 s; after that the daemon starts with hicolor and logs a warning. A configured or detected theme that is not installed is skipped with a warning, and the next source is tried: a configured theme is followed by the detection above. A theme changed on the desktop is used after the daemon restarts. touchcue check prints the theme and where it came from, for example icons: theme = "Papirus-Dark" (portal org.gnome.desktop.interface).

[templates] ​

KeyDefault
titleTouch {{ device.vendor or "your security key" }}
body{{ requester.label or process.name or "An application" }} is waiting for {{ request.action }}

These are the English defaults. With Polish or German as the locale, the defaults are:

Languagetitlebody
PolishDotknij klucza {{ device.vendor or "bezpieczeństwa" }}{{ requester.label or process.name or "Aplikacja" }} czeka na {{ request.action }}
GermanBitte {{ device.vendor ~ "-Schlüssel" if device.vendor else "Sicherheitsschlüssel" }} berühren{{ requester.label or process.name or "Eine Anwendung" }} wartet auf {{ request.action }}

The default body names the requester and its application through requester.label: claude in Kitty is waiting for a GPG signature, or Firefox is waiting for a passkey when the application asks itself. request.action words what the request waits for.

Templates use Jinja syntax with placeholders. A template that fails while rendering is replaced by the next of: the matching rule's template, the [templates] template, the default above, and an empty text. A request that ended without a touch keeps its prompt briefly: the popup shows the outcome in its state overlay, and a notification appends (cancelled) or (timed out) to the body, in Polish (anulowano) or (upłynął limit czasu), in German (abgebrochen) or (Zeitüberschreitung).

The title wraps to at most two lines and the body to at most six; longer text ends with an ellipsis:

A popup whose long title and body wrap and end with an ellipsis

Three popups with the same text: a touched request with a check, a cancelled one with a cross and a timed-out one with a clock

[[rules]] ​

Rules change the prompt for matching requests. The first rule whose match entries all equal the request's placeholder values applies; later rules are ignored.

toml
[[rules]]
match = { "process.name" = "ssh", "request.method" = "fido2" }
title = "Touch your key for ssh"
body = '{{ requester.label or "ssh" }} is signing in{% if request.detail %}: {{ request.detail }}{% endif %}'
icon = "utilities-terminal"

[[rules]]
match = { "requester.name" = "claude" }
icon = "~/.local/share/icons/claude.svg"

[[rules]]
match = { "app.id" = "org.mozilla.firefox" }
suppress = true
KeyTypeMeaning
matchtable of stringsPlaceholder names and values. Required and non-empty. Values compare exactly and case-sensitively; a placeholder without a value never matches.
titletemplateReplaces templates.title.
bodytemplateReplaces templates.body.
iconpath or nameIcon shown instead of the application's icon: an absolute path, a path starting with ~/ in your home directory, or an icon name.
suppressbooleanShows nothing for matching requests. IPC still publishes them. Default false.

An icon path must name a PNG or SVG file. A ~/ path must stay in your home directory: an absolute rest, as in ~//etc, or a .. part is a configuration error. A value without /, such as utilities-terminal, is an icon name, looked up in the icon theme like application icons. Other relative paths are a configuration error. Icon paths are looked up whenever a prompt is shown or changes, within 0.5 s. Files created after startup are eligible. An icon name that was not found stays unfound until the daemon restarts or more than 512 names have been looked up, as described under [icons]. When no file is found in time, the prompt shows the application's icon and the daemon logs a warning.

A popup with a rule's title and key icon below a popup with the application's icon

The icon shown is not proof of which program asked for a touch: any program running as your user can put lookalike icons in ~/.icons or ~/.local/share/icons, or install desktop entries that name another application's icon.

[[hooks]] ​

Hooks run a command on touchcue events. See Hooks for the events, the environment the command gets, and recipes. With hooks, this file runs commands as your user: keep it writable only by you, and never run the daemon as root with a configuration file another user can write.

toml
[[hooks]]
on = ["started"]
match = { "request.method" = "fido2" }
command = ["pw-play", "/usr/share/sounds/freedesktop/stereo/message.oga"]
timeout_ms = 5000
concurrency = 4
KeyTypeMeaning
onlist of event namesEvents that run the command. Required and non-empty. An unknown name is an error.
matchtable of stringsPlaceholder names and values that must all be equal, as in [[rules]]. Optional; without it, every listed event runs the command. Device events only have device.* values and daemon events none. A match requiring values absent from the event does not run. match only selects events: application and process names are set by the processes themselves.
commandlist of stringsThe program and its arguments, run without a shell. Required, and the program must not be empty.
timeout_ms1 to 600000Time the command may run before it is ended. Default 5000. Not allowed with until.
concurrency1 to 32Most runs of this hook at once. Default 4. Not allowed with until.
untilendedRuns one process per request until the request ends, instead of one run per event; on may then list only started and waiting. See Hooks that last for a request.
on_changerestart, stream, ignoreWith until: what a change of the request does to its process. Default restart.
stop_signalSIGTERM, SIGINT, SIGHUPWith until: signal that stops the process. Default SIGTERM.
stop_grace_ms0 to 2000With until: time between stop_signal and SIGKILL. Default 1000.
restart_interval_ms0 to 600000With until: shortest time between two starts of the process of one request. Default 200.

[sources.fido] ​

KeyValuesDefault
enabledbooleantrue
keepalive_timeout_ms100 to 6000001500
retry_window_ms1 to 6000001000

keepalive_timeout_ms is how long a FIDO request survives without a keepalive from the key. retry_window_ms is how long an ended operation waits for a client retry. A client retry during that interval continues the same prompt.

[sources.gpg] ​

KeyValuesDefault
enabledbooleantrue

Turns on the helper socket $XDG_RUNTIME_DIR/touchcue/helper.sock, through which the gpg-agent wrapper and touchcue askpass report operations.

[requester] ​

KeyValuesDefault
skiplist of process namesshells, multiplexers, wrappers and service managers, as in the example above
extend_skiplist of process names[]

These lists name the processes passed over when looking for the requester. skip replaces the built-in list, and skip = [] passes over nothing; extend_skip adds names to skip or to the built-in list. To also pass over the editor whose terminal you work in:

toml
[requester]
extend_skip = ["nvim"]

An entry is a name, compared exactly and case-sensitively with the process's comm, or with its executable's file name when comm cannot be read, or a prefix ending in *, such as tmux*. The kernel truncates comm to 15 bytes. Use a prefix entry for longer names. An invalid entry is reported with its location in the file. touchcue check prints the effective list; copy the list after skip = into the configuration to start from it.

IPC ​

SectionKeyDefault
[ipc]enabledtrue
[dbus]enabledtrue
[compat.maxbaz_socket]enabledfalse

All endpoints need XDG_RUNTIME_DIR. They only send; clients cannot change anything.

  • Event socket, $XDG_RUNTIME_DIR/touchcue/events.sock, from [ipc]. Each line is one JSON object with kind (started, updated or ended), id, state, reason (set only for ended: touched, cancelled, failed or timed_out), source and values. A new client first gets a started line for every active request. Only processes of the same user may connect.
  • D-Bus, from [dbus]: the session bus name io.github.theaifam5.Touchcue, object /io/github/theaifam5/Touchcue, interface io.github.theaifam5.Touchcue1. It has the property Active, the method ActiveRequests, and the signals RequestStarted, RequestUpdated and RequestEnded.
  • Compatible socket, $XDG_RUNTIME_DIR/yubikey-touch-detector.socket, from [compat.maxbaz_socket]. It sends the 5-byte messages of yubikey-touch-detector: U2F_1/U2F_0 for FIDO, GPG_1/GPG_0 for gpg and ssh, and MAC_1/MAC_0. Only requests that still wait for a touch count.

values holds only these placeholders: every request.* key, device.vendor, device.model, device.product, device.kind, device.transport, device.vid, device.pid, app.name, app.id, app.icon, app.container, process.name, process.chain, requester.name and requester.label. Executable paths, pids, uids and command lines are never published. process.chain and requester.* do expose the names of the client's parent processes, such as the shell and tools that ran it, to every client of the socket and the bus name.

A second touchcue run exits while the event socket or the bus name is in use.