Disable keyboard with a bind #4283
-
Hey, I search but didn't find a way to disable the whole keyboard with a bind. I found this https://wiki.hyprland.org/Configuring/Uncommon-tips--tricks/ that allow us to disable binds, but not the whole keyboard. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
This worked pretty well, but since #4656 was merged this script does not work anymore. Maybe someone can help to get the script working again. |
Beta Was this translation helpful? Give feedback.
-
Here my current script for laptop keyboard toggle (inspired by this reddit post): #!/usr/bin/env bash
export STATUS_FILE="$XDG_RUNTIME_DIR/keyboard.status"
enable_keyboard() {
printf "true" >"$STATUS_FILE"
notify-send -u normal "Enabling Keyboard"
hyprctl keyword '$LAPTOP_KB_ENABLED' "true" -r
}
disable_keyboard() {
printf "false" >"$STATUS_FILE"
notify-send -u normal "Disabling Keyboard"
hyprctl keyword '$LAPTOP_KB_ENABLED' "false" -r
}
if ! [ -f "$STATUS_FILE" ]; then
enable_keyboard
else
if [ $(cat "$STATUS_FILE") = "true" ]; then
disable_keyboard
elif [ $(cat "$STATUS_FILE") = "false" ]; then
enable_keyboard
fi
fi add the following to your hyprland config (the device name maybe depends on your machine):
|
Beta Was this translation helpful? Give feedback.
-
I am currently using 0.35.0-2, and I can disable the touchpad via where synps/2-synaptics-touchpad is the name of my device using hyprctl devices |
Beta Was this translation helpful? Give feedback.
-
I'm getting the exact same error, config option does not exist. Using hyprland-git 0.38.0.r77.a06272ae-1 |
Beta Was this translation helpful? Give feedback.
Here my current script for laptop keyboard toggle (inspired by this reddit post):
add the following to your h…