raffi 0.25.0

A simple fuzzel launcher based on YAML file
Documentation
---
title: System Commands
description: Lock, suspend, hibernate, log out, reboot or shut down from Raffi
---

import { Aside } from '@astrojs/starlight/components';
import { Image } from 'astro:assets';
import systemScreenshot from '../../../assets/screenshots/system-commands.png';

<Image src={systemScreenshot} alt="System commands including Lock, Suspend, Hibernate, Log out and Reboot, with the Lock command preview" width={800} />

Type `sys ` (with the trailing space) to list session and power commands.
Words after the keyword filter the list, so `sys reb` leaves only Reboot.

<Aside type="note">
System commands are only available in native mode. They are on by default.
</Aside>

| Entry     | Default command                                   |
|-----------|---------------------------------------------------|
| Lock      | `loginctl lock-session`                           |
| Suspend   | `systemctl suspend`                               |
| Hibernate | `systemctl hibernate`                             |
| Log out   | Hyprland's exit dispatcher on Hyprland, `niri msg action quit --skip-confirmation` on niri, `swaymsg exit` on sway, otherwise `loginctl terminate-session $XDG_SESSION_ID` |
| Reboot    | `systemctl reboot`                                |
| Shut down | `systemctl poweroff`                              |

To open the list from a key binding, pass the keyword as the initial query:

```sh
raffi -u native -i "sys "
```

<Aside type="caution">
The `sys ` keyword takes over any search starting with "sys ", so a launcher
search such as `sys monitor` opens the system commands instead. Set
`addons.system.trigger` to another keyword, or `addons.system.enabled: false`,
if you need those searches.
</Aside>

## Confirmation

Lock runs on the first Enter. Every other entry asks first: the row reads
"Press Enter again to reboot", and only a second Enter on the same entry runs
it. Moving the selection, editing the query, or pressing or releasing a
modifier cancels the request. Holding Enter down does not confirm.

If the program behind an entry is not installed, the row says so (for
example "hyprlock not found") and Enter does nothing. On Hyprland, Log out
uses `hyprctl eval` with a Lua config (Hyprland 0.55 or later) and
`hyprctl dispatch exit` otherwise. On niri it asks niri to quit without its
own confirmation dialog, and on sway it runs `swaymsg exit`. Elsewhere, the
default Log out needs
`XDG_SESSION_ID`; without it the row says so.

Raffi closes before running the command. If it fails, Raffi reports the error
as a notification (a Hyprland notification on Hyprland, `notify-send`
elsewhere).

## Custom commands

Replace any command with an argument list. Commands run directly, without a
shell. Use `hide` to remove entries, or give an entry an empty list:

```yaml
addons:
  system:
    commands:
      lock: ["hyprlock"]
      logout: ["uwsm", "stop"]
    hide: [hibernate]
```

Queries typed in this mode are not saved in the search history.

See the [addon reference](../../reference/addon-configuration/#system-commands) for
every field.