Crates.io | kb-auto-switch-hyprland |
lib.rs | kb-auto-switch-hyprland |
version | 0.1.0 |
created_at | 2025-08-28 02:04:02.059371+00 |
updated_at | 2025-08-28 02:04:02.059371+00 |
description | A simple Rust-based console utility that automatically switches keyboard layouts per active window in **Hyprland**. |
homepage | https://gitlab.com/itcreator/kb-auto-switch-hyprland.git |
repository | https://gitlab.com/itcreator/kb-auto-switch-hyprland.git |
max_upload_size | |
id | 1813463 |
size | 29,348 |
A simple Rust-based console utility that automatically switches keyboard layouts per active window in Hyprland.
This tool monitors the currently active window and remembers the keyboard layout used for each application, restoring it when switching back. It supports multiple keyboard layouts and uses hyprctl
to interact with Hyprland.
hyprctl activewindow -j
.hyprctl devices -j
.trace
, info
, warn
) using the log
crate.hyprctl
command-line toolYou can install the utility directly from crates.io using Cargo:
cargo install kb-auto-switch-hyprland
After installation, the kb-auto-switch-hyprland
binary will be available in your Cargo bin directory ($HOME/.cargo/bin
by default).
To run the program:
kb-auto-switch-hyprland
Alternatively, you can still build from source:
git clone https://github.com/yourusername/hypr-layout-switcher.git
cd hypr-layout-switcher
cargo build --release
./target/release/hypr-layout-switcher
By default, the program:
Logging is controlled via the RUST_LOG
environment variable:
RUST_LOG=info ./kb-auto-switch-hyprland # default info level
RUST_LOG=trace ./kb-auto-switch-hyprland # debug everything, including PID-to-layout mappings
trace
— verbose output for debugginginfo
— main actions and active layoutswarn
— warnings[INFO] Automatic keyboard switch initialization...
[INFO] Active layouts:
LAYOUT: us; ID: 0
LAYOUT: ru; ID: 1
[INFO] Automatic keyboard switch initialization... Done.
[TRACE] [Window] New PID: 12345
[TRACE] [Layout] Switching to saved layout for PID 12345: ru
kb_layout = "us,fr";
, kb_options = "grp:alt_space_toggle";
hyprctl
and JSON parsing via serde
. Ensure hyprctl
works correctly on your system.This project is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0).