From c0bb83e76ce5cd6adc1c1d569d9a2076958b4375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saull=20Brand=C3=A3o?= Date: Tue, 22 Jul 2025 17:08:53 -0300 Subject: [PATCH] Detect and apply keyboard layout configured during Arch installation (#286) * Detect and apply keyboard layout configured during Arch installation * align the identation --- install/detect-keyboard-layout.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 install/detect-keyboard-layout.sh diff --git a/install/detect-keyboard-layout.sh b/install/detect-keyboard-layout.sh new file mode 100755 index 0000000..d80c8af --- /dev/null +++ b/install/detect-keyboard-layout.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +conf="/etc/vconsole.conf" +hyprconf="$HOME/.config/hypr/hyprland.conf" + +layout=$(grep '^XKBLAYOUT=' "$conf" | cut -d= -f2 | tr -d '"') +variant=$(grep '^XKBVARIANT=' "$conf" | cut -d= -f2 | tr -d '"') + +if [[ -n "$layout" ]]; then + sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = $layout" "$hyprconf" +fi + +if [[ -n "$variant" ]]; then + sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = $variant" "$hyprconf" +fi