Skip to content

Fixed one layout with multiple variant bug hyprland/language Fixes #3676 #4068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Rimsoo
Copy link

@Rimsoo Rimsoo commented Apr 22, 2025

Hypr onfig:

kb_layout = us, us
kb_variant = basic, intl

Using find_last_of eg:
ev = "activelayout>>kb-name-,English (US, intl., with dead keys)"
So layout name will be = " with dead keys)" -> unknown layout !

Using find_first_of fixed it.

@Rimsoo Rimsoo changed the title Fixed one layout with multiple variant bug Fixed one layout with multiple variant bug hyprland/language Apr 22, 2025
@guttermonk
Copy link

Tested and working great for me. I would recommend also updating the wiki with the following info and example.

The "format-{shortDescription}-{variant}" is working fine on my side with the following config:

Hyprland config:

input {
    kb_layout = us,us
    kb_variant = colemak_dh,
    kb_options = grp:win_space_toggle
    numlock_by_default = true
    follow_mouse = 1
}

Waybar config:

  "hyprland/language": {
    "format-en": "󰼭 us",
    "format-en-colemak_dh": " dh",
    "on-click": "hyprctl switchxkblayout current next",
  },

@Rimsoo Rimsoo changed the title Fixed one layout with multiple variant bug hyprland/language Fixed one layout with multiple variant bug hyprland/language Fixes #3676 Apr 23, 2025
@Rimsoo Rimsoo closed this Apr 23, 2025
@Rimsoo Rimsoo reopened this Apr 23, 2025
Copy link
Author

@Rimsoo Rimsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #3676

@Alexays
Copy link
Owner

Alexays commented Apr 24, 2025

The opposite has happened here #3224

@Rimsoo
Copy link
Author

Rimsoo commented Apr 24, 2025

Indeed, however, it does not take into account the case of multiple variants. I will rework it for better detection in both cases: commas in the keyboard name and/or multiple variants

Copy link
Author

@Rimsoo Rimsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract the layout using the parenthesis first THEN the comma,
Since there is no nested parenthesis in a kb layout/variant according to this file:
cat /usr/share/X11/xkb/rules/xorg.xml | grep -E "\(.*\("

@Rimsoo
Copy link
Author

Rimsoo commented May 12, 2025

Any info on whether this will/can be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants