![]() Registered Member ![]()
|
Hello. Why after command "setxkbmap us" I can't switch to another layout by global hotkeys (Ctrl+Alt) until new settings in "Keyboard - System Settings Module" hasn't been applied (for example, change any setting, then press Apply, then revert changes and press Apply again) or session hasn't been restarted?
Any ideas how to avoid that? Thanks! |
![]() Manager ![]()
|
Instead of using the command line keyboard layout switching, why don't you just install the layouts in the system settings and use the Systray button to switch?
Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ... |
![]() Registered Member ![]()
|
Hello. Yes, all layouts are already setted up in system settings. But sometimes I need to switch from currently selected layout to US automatically. For example, before launching some programs with guaranted US layout. So is it possible? Maybe there is another way, without calling setxkbmap (for examples through dbus or something else)? |
![]() Manager ![]()
|
You can do that with the Systray Button very easily, only one click needed, unless you have more than two keyboard layouts. I personally have 4, so I am never more than 3 clicks away from the US layout. nd it is definitely easier than switching to the konsole and type text.
In the System Settings -> Hardware -> Input Devices -> Keyboard -> Layouts folder, click on "Show Layout Indicator" Below in the Layouts, assign a label to each of the layouts Do not use the "Flag" or "label on flag" option, as the current monochrome systray doesn't show this correctly, especially not in Latte Dock.
Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ... |
![]() Registered Member ![]()
|
Thank you for answer, Yes, I do it, of course. But I always should keep in mind it (current layout and what application I want to run). For example, if I try to run a heavy application such as UnrealEngine with non-US layout, then all hotkeys will not work, even if you will switch layout to US (while UE is running). So, I should close UE, switch layout manually, and run UE. It is steal a lot of time and and a bit annoying. Same with a lot of games, etc. I want to protect yourself from such trifles and automate that process for needed applications (and it is the part of "linux way", no? I should be able to automate all that I need). |
![]() Manager ![]()
|
Sounds like something you would need a script for, then. Not my expertise, sorry, but also not Plasma or KDE-specific.
To some extent you can edit the start menu command as well, of course, but if you want to switch back once the application ends this needs to be set in a script.
Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ... |
![]() Registered Member ![]()
|
I do not need to switch back at the end, it doesn't matter. I just need to switch current layout to US by command line. Well, as I understand right - it is not possible in KDE Plasma. |
![]() Registered Member ![]()
|
Finally I produced a simple command to resolve the topic:
Note: however, it will work only if "US" is a first layout in system settings. --- UPD: For second example it doen't metter, which layout is firs. However, finally it forcibly sets "US" as first:
--- Thank you for discussion ![]() |
![]() Manager ![]()
|
Just for completion' sake: Plasma is a GUI, so is most of the software made by the KDE Community, command line is common to all Linux and Unix-like systems, independent of the Graphical User Interface.
Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ... |
![]() Registered Member ![]()
|
In "global" sense you are right. But actually in case of my question, sorry, but no. As I told, I like KDE/ Plasma because it is very flexible and can be managed by dbus. My previous solution (actually just a workaround) through setxkbmap is a bit ugly and I was looking more elegant way to switch. Well, now I've found solution especially for KDE/Plasma through qdbus (thanks to qdbusviewer):
|
![]() Registered Member ![]()
|
to toggle layouts i used
|
![]() Registered Member ![]()
|
Rednull has a point. Some commands aren't linux globally persé. I had a hard time figuring out a simple mv command to work in a script for example. Turns out it had to be kdemv5 specific.
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered users: bancha, Bing [Bot], Google [Bot], Sogou [Bot]