Some keyboard settings cause problems when trying to log in

Some tester needed :slight_smile:

Check yours, mine is de, de. Backup your .config/hypr/hyprland.conf file.

localectl
System Locale: LANG=en_GB.UTF-8
VC Keymap: uk
X11 Layout: gb

Run the script

#!/bin/bash
# .local/bin/garuda-locale.sh

localectl > /tmp/garuda-locale.txt

cat /tmp/garuda-locale.txt | grep Keymap > /tmp/keymap.txt

cat /tmp/garuda-locale.txt | grep Layout > /tmp/layout.txt

locale=$(cat /tmp/keymap.txt | awk '{ print $3 }')

variant=$(cat /tmp/layout.txt | awk '{ print $3 }')

sed -i "/kb_layout =/c\kb_layout = $locale" .config/hypr/hyprland.conf

sed -i "/kb_variant =/c\kb_variant = $variant" .config/hypr/hyprland.conf

and check if .config/hypr/hyprland.conf use the correct values and login works fine.
Use live ISO if not :smiley:

@bryambalan missing your MR :slight_smile: , but I can’t test it and IDK which check failed in Gitlab.
@korobert maybe you can test this script :slight_smile: ?

Hyprland just wouldn’t like ‘us’ in kb_variant, get a big red bar on top with a warning

localectl
System Locale: LANG=en_CA.UTF-8
VC Keymap: us
X11 Layout: us
1 Like

Good to know, thank you. :slight_smile:

Sure. I just tried it now but still not good.
After the script

localectl output:

 localectl
System Locale: LANG=en_GB.UTF-8
    VC Keymap: uk
   X11 Layout: gb

and hyprland.conf

input {
kb_layout = uk
kb_variant = gb
    kb_model =
    kb_options =
    kb_rules =
    numlock_by_default= true
    follow_mouse = 1

So after scritp i got an extra line in the hyprland.conf

kb_variant = gb

this was not there before.

But this line

kb_layout = uk

is still “uk”

This sould be “gb” in my case for working good.

1 Like
Invaild keyboard layout passed. ( rules: , model: , variant: , options: , layoyt: uk )
Hyprland may not work correctly

Ok, setting the kb_variant break the config.


New test.

#!/bin/bash
# .local/bin/garuda-locale.sh

localectl > /tmp/garuda-locale.txt

cat /tmp/garuda-locale.txt | grep Keymap > /tmp/keymap.txt

cat /tmp/garuda-locale.txt | grep Layout > /tmp/layout.txt

locale=$(cat /tmp/keymap.txt | awk '{ print $3 }')

variant=$(cat /tmp/layout.txt | awk '{ print $3 }')

sed -i "/kb_layout =/c\kb_layout = $layout" .config/hypr/hyprland.conf

if [ "$variant" != "$layout" ]

then

sed -i "/kb_layout =/c\kb_layout = $variant" .config/hypr/hyprland.conf

fi
2 Likes

I tried this script. It is working fine for me.

localectl doesnt change:

╰─λ localectl
System Locale: LANG=en_GB.UTF-8
    VC Keymap: uk
   X11 Layout: gb

and in hyprland.conf is still okay form me.

input {
kb_layout = gb
    kb_model =
    kb_options =
    kb_rules =
    numlock_by_default= true
    follow_mouse = 1

no error, no red bar. :+1:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.