This commit is contained in:
Stephan Raabe 2024-05-29 11:42:22 +02:00
parent 69e2e118b2
commit 17cad59b89
4 changed files with 17 additions and 6 deletions

View File

@ -26,20 +26,27 @@ if [ "$setkeyboard" == "0" ] ;then
# Default layout and variants # Default layout and variants
keyboard_layout="us" keyboard_layout="us"
keyboard_variant=""
_setupKeyboardLayout() { _setupKeyboardLayout() {
echo
keyboard_layout=$(localectl list-x11-keymap-layouts | gum filter --height 15 --placeholder "Find your keyboard layout...") keyboard_layout=$(localectl list-x11-keymap-layouts | gum filter --height 15 --placeholder "Find your keyboard layout...")
echo
echo ":: Keyboard layout changed to $keyboard_layout" echo ":: Keyboard layout changed to $keyboard_layout"
echo _setupKeyboardVariant
}
_setupKeyboardVariant() {
if gum confirm "Do you want to set a variant of the keyboard?" ; then
keyboard_variant=$(localectl list-x11-keymap-variants | gum filter --height 15 --placeholder "Find your keyboard layout...")
echo ":: Keyboard variant changed to $keyboard_variant"
fi
_confirmKeyboard _confirmKeyboard
} }
_confirmKeyboard() { _confirmKeyboard() {
echo
echo "Current selected keyboard setup:" echo "Current selected keyboard setup:"
echo "Keyboard layout: $keyboard_layout" echo "Keyboard layout: $keyboard_layout"
echo "Keyboard variant: $keyboard_variant"
echo echo
if gum confirm "Do you want proceed with this keyboard setup?" --affirmative "Proceed" --negative "Change" ;then if gum confirm "Do you want proceed with this keyboard setup?" --affirmative "Proceed" --negative "Change" ;then
return 0 return 0
@ -67,6 +74,10 @@ if [ "$setkeyboard" == "0" ] ;then
REPLACE="$keyboard_layout" REPLACE="$keyboard_layout"
sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/hypr/conf/keyboard.conf sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/hypr/conf/keyboard.conf
SEARCH="KEYBOARD_VARIANT"
REPLACE="$keyboard_variant"
sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/hypr/conf/keyboard.conf
SEARCH="KEYBOARD_LAYOUT" SEARCH="KEYBOARD_LAYOUT"
REPLACE="$keyboard_layout" REPLACE="$keyboard_layout"
sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/qtile/autostart.sh sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/qtile/autostart.sh

View File

@ -4,7 +4,7 @@
# ----------------------------------------------------- # -----------------------------------------------------
input { input {
kb_layout = KEYBOARD_LAYOUT kb_layout = KEYBOARD_LAYOUT
kb_variant = kb_variant = KEYBOARD_VARIANT
kb_model = kb_model =
kb_options = kb_options =
numlock_by_default = true numlock_by_default = true

View File

@ -4,7 +4,7 @@
# ----------------------------------------------------- # -----------------------------------------------------
input { input {
kb_layout = KEYBOARD_LAYOUT kb_layout = KEYBOARD_LAYOUT
kb_variant = kb_variant = KEYBOARD_VARIANT
kb_model = kb_model =
kb_options = kb_options =
numlock_by_default = true numlock_by_default = true