Nata

June 17, 2025 ยท View on GitHub

Ceasefire Now

Important

This project is no longer maintained.

Hyprkan offers improved performance, and extended functionality as a replacement.

Nata

Nata is an application-aware switching layer for Kanata on Linux.

Table of Contents

Installation

Download the Script and Make It Executable

  1. Manual Download: Download the Nata script and make it executable:

    chmod +x nata.sh
    
  2. Using curl to download the script and make it executable in a single Line:

    curl -O https://raw.githubusercontent.com/mdSlash/nata/refs/heads/main/src/nata.sh && chmod +x nata.sh
    

Dependencies

To run Nata script, you will need the following dependencies installed on your system:

  • nc: A utility to send data to the Kanata server via TCP to change the layer.
  • jq: A command-line JSON processor for managing data from the config file.

Additional Requirements for Active Window Information

To retrieve active window information such as window class and title, you will need one of the following tools based on your display server:

For X11 Users:

For Wayland Users:

These tools are typically installed by default if you are using:

Usage

To use Nata script:

  1. Configure your configuration file.
  2. Execute the script with the desired options if necessary.

Configuration

Here are the properties you can include in your configuration file:

PropertyDescription
ipIP address
portPort number
intervalInterval (in ms) for checking active window rules and changing layers.
base_layerBase layer for window rules.
recipesLocation of the recipe script.
window_rulesIf the active window matches the rule, it will change to the specified layer.

See the config doc for more details.

Options

Here is a list of available options for the Nata script:

OptionDescription
-h, --helpDisplay help message and exit.
-v, --versionShow script version and exit.
-q, --quietRun quietly; log errors only.
-i, --intervalSet update interval for checking the active window.
-p, --portSpecify a TCP port or IP address with a port.
-C, --classChange layer if the value matches the rule: { "class": "<VALUE>", "title": "*" }.
-t, --titleChange layer if the value matches the rule: { "class": "*", "title": "<VALUE>" }.
-l, --layerSpecify a layer name to switch to and exit.
-c, --configPath to the config file in JSON format.
-r, --recipesPath to a script that runs in the background on layer change.

See the options doc for more details.

Recipes

You can create a custom script to execute when switching layers. For example, to send a notification on layer change, you can use:

notify-send -r 12345 "Current Layer" "Layer Name: $LAYER_NAME"

See the recipes doc for more details.

Contributing

We welcome contributions! If you find bugs or have suggestions for improvements, please open an issue or submit a pull request.