Skip to content
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

[Bug]: Unable to switch layouts #422

Closed
AlexBarsky opened this issue Sep 5, 2024 · 2 comments
Closed

[Bug]: Unable to switch layouts #422

AlexBarsky opened this issue Sep 5, 2024 · 2 comments
Labels

Comments

@AlexBarsky
Copy link

Bug Report

Description

Right after the installation I could not change the layout. Although I did get the notification about successfully changed layout and no errors were popping up.

Output of SwitchKeyboardLayout.sh script

$ ~/.config/hypr/scripts/SwitchKeyboardLayout.sh
Starting script...
Current layout: ru
Reading keyboard layout settings from /home/barsky/.config/hypr/UserConfigs/UserSettings.conf...
Available layouts:  us ru
Number of layouts: 2
Current layout index: 1
Next layout:  us
Switching layout for asus-wireless-radio-control to  us...
invalid arg 2
...
Switching layout for at-translated-set-2-keyboard to  us...
invalid arg 2
Switched the layout for at-translated-set-2-keyboard.
Layout change notification sent.

Explanation

As you can see in the output there are no critical errors, but there is some issue and that is invalid arg 2. After a brief exploring in Hyprland Docs I discovered this:

hyprctl switchxkblayout [DEVICE] [CMD]

where CMD is either next for next, prev for previous, or ID for a specific one (in the above case, us: 0, pl: 1, de: 2). You can find the DEVICE using hyprctl devices command.

DEVICE can also be current or all, self-explanatory. Current is the main keyboard from devices.

But in the script there is this:
hyprctl switchxkblayout "$name" "$new_layout"

where $new_layout is symbols, like us, en, ru, etc.

Solution

Just change hyprctl switchxkblayout "$name" "$new_layout" (64 line) to hyprctl switchxkblayout "$name" next or use layout index instead of 'next'.
Im not sure that I didnt somehow messed up the installation or post-installation stage, but that`s what I got out of the box and how I fixed it.

@JaKooLit JaKooLit added the solution A fix label Sep 7, 2024
@JaKooLit JaKooLit reopened this Sep 9, 2024
@JaKooLit
Copy link
Owner

JaKooLit commented Sep 9, 2024

Thanks for this.. Im not sure how this is actually cause you close in an instant ha ha

hyprctl switchxkblayout "$name" next

does this actually works?

Im sorry I am asking since I dont have multiple keyboard layout

however, I just tried adding another keyboard layout and notification is ok but not sure if it is working properly

@AlexBarsky
Copy link
Author

AlexBarsky commented Sep 28, 2024

Thanks for this.. Im not sure how this is actually cause you close in an instant ha ha

hyprctl switchxkblayout "$name" next

does this actually works?

Im sorry I am asking since I dont have multiple keyboard layout

however, I just tried adding another keyboard layout and notification is ok but not sure if it is working properly

According do Hyprland Docs its working, and Im currently using it. And notifications were working fine. Thats why I showed only the script output.

P. S. I closed the issue immediately because I solved it, and was just trying to help some who could encounter with similar problem.

P. S. Sorry for late.

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

No branches or pull requests

2 participants