mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
Detect and apply keyboard layout configured during Arch installation (#286)
* Detect and apply keyboard layout configured during Arch installation * align the identation
This commit is contained in:
15
install/detect-keyboard-layout.sh
Executable file
15
install/detect-keyboard-layout.sh
Executable file
@ -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
|
Reference in New Issue
Block a user