Nata is an application-aware switching layer for Kanata on Linux.
Warning
Please be aware that Nata is currently in its beta version. As such, it may contain bugs that have not yet been identified or resolved.
-
Manual Download: Download the Nata script and make it executable:
chmod +x nata.sh
-
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
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.
To retrieve active window information such as window class and title, you will need one of the following tools based on your display server:
These tools are typically installed by default if you are using:
To use Nata script:
- Configure your configuration file.
- Execute the script with the desired options if necessary.
Here are the properties you can include in your configuration file:
Property | Description |
---|---|
ip |
IP address |
port |
Port number |
interval |
Interval (in ms) for checking active window rules and changing layers. |
base_layer |
Base layer for window rules. |
recipes |
Location of the recipe script. |
window_rules |
If the active window matches the rule, it will change to the specified layer. |
See the config doc for more details.
Here is a list of available options for the Nata script:
Option | Description |
---|---|
-h , --help |
Display help message and exit. |
-v , --version |
Show script version and exit. |
-q , --quiet |
Run quietly; log errors only. |
-i , --interval |
Set update interval for checking the active window. |
-p , --port |
Specify a TCP port or IP address with a port. |
-C , --class |
Change layer if the value matches the rule: { "class": "<VALUE>", "title": "*" } . |
-t , --title |
Change layer if the value matches the rule: { "class": "*", "title": "<VALUE>" } . |
-l , --layer |
Specify a layer name to switch to and exit. |
-c , --config |
Path to the config file in JSON format. |
-r , --recipes |
Path to a script that runs in the background on layer change. |
See the options doc for more details.
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.
We welcome contributions! If you find bugs or have suggestions for improvements, please open an issue or submit a pull request.