# NAME **ala-lape.toml** — [**ala-lape**](cli.md) configuration file # CONFIGURATION **ala-lape**'s configuration file lives at `$XDG_CONFIG_DIR/.ala-lape/config.toml` by default, and as the name implies, is a TOML formatted configuration file. You can configure [**inhibitors**](#inhibitors), both idle inhibitors and [**notification inhibitors**](#inhibitors-notifications), various [**limits and frequencies**](#limits), [**gamepads**](#gamepad), and [**processes**](#process). ## `[inhibitors]` The `[inhibitors]` section lets you configure which inhibitors are enabled. By default, only the [**logind**](#inhibitors-logind) inhibitor is enabled. Other than inhibiting idle, **ala-lape** can also inhibit [**notifications**](#inhibitors-notifications), and allows using [external commands](#inhibitors-exec) do the inhibition, too. **ala-lape** will inhibit via every enabled inhibitor whenever it detects activity. ### `[inhibitors.logind]` The **logind** inhibitor will inhibit idle via **systemd-inhibit(1)**'s DBus interface. It is enabled by default. ```toml [inhibitors.logind] enable = true ``` ### `[inhibitors.exec]` Configuring the **exec** inhibitor is a little bit more involved, but it lets you execute arbitrary commands to inhibit, uninhibit, and check inhibition status. This is an escape hatch if you need a way to inhibit something that isn't covered by built-in functionality. ```toml [inhibitors.exec] enable = true [inhibitors.exec.inhibit] command = "makoctl" args = [ "mode", "-a", "do-not-disturb" ] [inhibitors.exec.uninhibit] command = "makoctl" args = [ "mode", "-r", "do-not-disturb" ] [inhibitors.exec.is_active] command = "bash" args = [ "-c", "makoctl mode | grep -q do-not-disturb" ] ``` Care must be taken that the `is_inhibited` command is working properly: if it does not return success when inhibition is active, `uninhibit` will never be called. Likewise, if it does not return success when inhibition is inactive, `inhibit` will never be called. Do note that there is a native [**mako**](#mako) support, the above is just an example. ### `[inhibitors.notifications]` The **notifications** inhibitor will try to auto-detect the notification daemon running, and will do the inhibition for the one found. It *may* require configuring the appropriate daemon's section too. If this inhibitor is enabled, whichever supported notification daemon is found running, it will be used, even if they're disabled in the configuration. In other words, enabling this has priority over disabling the individual inhibitors. ```toml [inhibitors.notifications] enable = true mako.inhibited_mode = "do-not-disturb" ``` It is recommended to use this method of enabling notification inhibition, unless there's a good reason not to. Available notification inhibitors are: [**swaync**](#swaync), [**dunst**](#dunst), [**kde**](#kde), [**gnome**](#gnome), and [**mako**](#mako). #### `swaync` To enable inhibiting **Sway Notification Center**'s notifications, the following option is available: ```toml [inhibitors.notifications] swaync.enable = true ``` #### `dunst` To enable inhibiting **Dunst**'s notifications, the following option is available: ```toml [inhibitors.notifications] dunst.enable = false ``` #### `kde` To enable inhibiting **KDE**'s notifications, the following option is available: ```toml [inhibitors.notifications] kde.enable = false ``` #### `gnome` To enable inhibiting **GNOME**'s notifications, the following option is available: ```toml [inhibitors.notifications] gnome.enable = false ``` #### `mako` To enable inhibiting **mako**'s notifications, the following option is available: ```toml [inhibitors.notifications] mako.enable = true ``` With **mako**, you can set different modes, and **ala-lape** needs to know which one to use for notification inhibition. As such, when using **mako**, the `inhibited_mode` setting is **required**: ```toml [inhibitors.notifications] mako.enable = true mako.inhibited_mode = "do-not-disturb" ``` ## `[limits]` ```toml [limits] poll_frequency = "60s" activity_timeout = "60s" event_threshold = 6 event_max_threshold = 32 ``` Timeouts are configured in human-readable notation, both default to a minute. The `poll_frequency` determines how frequently the process list is looked at (gamepad monitoring does not require a frequency, **ala-lape** watches input events), while `activity_timeout` determines how long after the last observed activity the inhibition will be suspended. The `event_threshold` setting controls how many sync events a gamepad must produce within `activity_timeout` for it to trigger an activity report. This is a countermeasure for noisy devices. Similarly, `event_max_threshold` sets a limit on how many events can be considered normal between sync events within `activity_timeout`. If this limit is reached, the device state is assumed corrupted, and monitoring for it is restarted. ## `[[gamepad]]` By default, **ala-lape** will monitor all gamepads. This can be disabled by specifying a gamepad explicitly, or disabling the automatic matching. Lets start with the latter: ```toml [[gamepad]] any = false ``` If you want to monitor a specific gamepad only, or one that the tool does not recognize as such, you can match them by name (using a regex): ```toml [[gamepad]] name = "X-Box 360" ``` Matching gamepads are scanned for at every `[limits].poll_frequency` interval, but once a gamepad is matched, activities on it are recognized instantly. ## `[[process]]` If you wish to inhibit when a particular process is running, for the entire time it is running, **ala-lape** can do that with its process monitoring capability. ```toml [[process]] name = "the program name" ``` As in the case of gamepads, the name is a regex, and likewise, matching processes are scanned for at every `[limits].poll_frequency` interval. # SEE ALSO [**ala-lape(1)**](cli.md) # NOTES ## Idle inhibitor - [systemd Inhibitor Locks](https://systemd.io/INHIBITOR_LOCKS/) ## Notification daemons - [dunst](https://dunst-project.org/) - [gnome](https://www.gnome.org/) - [kde](https://kde.org/) - [mako](https://github.com/emersion/mako) - [swaync](https://github.com/ErikReider/SwayNotificationCenter)