Comments (13)
Tested - works for me. Many thanks!
from labwc.
Take a look at the example file:
Line 14 in 6cf19d1
Any option can be used among the ones listed here:
localectl list-x11-keymap-options | grep grp:
from labwc.
Ah - while that does indeed handle the on-the-fly switching between a predefined set of keymaps, it doesn't solve the actual problem I am having! If the user wants to change keyboard to one not previously defined - say switching from a US to UK keyboard layout because they have plugged in a new keyboard, or as part of an initial setup wizard where the user sets their keyboard layout before setting their password for the first time - it needs to be possible for the keyboard layout to be changed to any other layout on the fly.
from labwc.
We do read the environment file on reconfigure and also apply it to the environment so spawing new applications after that point will include the changes.
However, we do currently not re-create the xkb layout (nor the xcursor theme). I think there is an issue for that somewhere. It should be possible to implement, although it might become a bit finicky if combined with layoutScope=window
as we only store the "group" modifier index per window. Thus if the new keyboard layout now suddenly changes their meaning (or even the count) things might get a bit quirky.
from labwc.
We do read the environment file on reconfigure and also apply it to the environment so spawing new applications after that point will include the changes.
Just tried that - it doesn't seem to work.
So if I have XKB_DEFAULT_LAYOUT=gb in ~/.config/labwc/environment and hence a GB keyboard layout, if I change that line to XKB_DEFAULT_LAYOUT=us, save the file and then run labwc --reconfigure in a terminal, I still get the GB keyboard layout on newly-opened applications thereafter.
It also doesn't seem to update the environment. If I do the above, close the terminal and re-open it and look at the value of XKB_DEFAULT_LAYOUT, it is unchanged.
from labwc.
if I change that line to
XKB_DEFAULT_LAYOUT=us
, save the file and then runlabwc --reconfigure
in a terminal, I still get the GB keyboard layout on newly-opened applications thereafter.
Right, because as said above we do not recreate the xkb state on reconfigure. env | grep -i layout
should show the updated env var in a new terminal though. But that obviously doesn't help regarding the issue.
from labwc.
Right, because as said above we do not recreate the xkb state on reconfigure.
env | grep -i layout
should show the updated env var in a new terminal though. But that obviously doesn't help regarding the issue.
See my edited comment above - if I do exactly that, the environment variable hasn't updated for me in the new terminal.
from labwc.
Right, because as said above we do not recreate the xkb state on reconfigure.
env | grep -i layout
should show the updated env var in a new terminal though. But that obviously doesn't help regarding the issue.See my edited comment above - if I do exactly that, the environment variable hasn't updated for me in the new terminal.
Just tested again with foot
in a nested labwc session and for me that works. E.g. in ~/.config/labwc/environment
: XKB_DEFAULT_LAYOUT=de,us
-> XKB_DEFAULT_LAYOUT=de,nl
-> labwc --reconfigure
-> env | grep -i layout
in the old terminal: de,us
> spawning a new terminal: de,nl
. Maybe in your case the terminal emulator uses some kind of master process that keeps its environment and uses it when spawning new instances?
from labwc.
We ought to support this. It's one of the few things that currently requires a compositor re-start to take effect.
Might be as simple as called keyboard_init()
(minus the wlr_keyboard_group_create()
) on reconfigure.
I'm not sure how we best handle view->keyboard_layout
if indeed XKB_DEFAULT_LAYOUT
has changed. Maybe we just set them all to 0
?
from labwc.
Right, because as said above we do not recreate the xkb state on reconfigure.
env | grep -i layout
should show the updated env var in a new terminal though. But that obviously doesn't help regarding the issue.See my edited comment above - if I do exactly that, the environment variable hasn't updated for me in the new terminal.
Just tested again with
foot
in a nested labwc session and for me that works. E.g. in~/.config/labwc/environment
:XKB_DEFAULT_LAYOUT=de,us
->XKB_DEFAULT_LAYOUT=de,nl
->labwc --reconfigure
->env | grep -i layout
in the old terminal:de,us
> spawning a new terminal:de,nl
. Maybe in your case the terminal emulator uses some kind of master process that keeps its environment and uses it when spawning new instances?
OK, found what I was doing wrong! I wasn't thinking and was launching the new instance of the terminal from the taskbar, which is running as a different process from labwc itself, so has a different environment. If I launch the terminal from a labwc keyboard shortcut, the environment has updated as expected.
from labwc.
Might be as simple as called
keyboard_init()
(minus thewlr_keyboard_group_create()
) on reconfigure.
Just tried that and it doesn't seem to work, but I could have been doing it wrong!
All I did was to add keyboard_init(g_server->seat)
to the end of the reload_config_and_theme function in server.c, and to modify keyboard_init to have an "inited" flag so that wlr_keyboard_group_create was only ever called once.
Edit - digging about, I can see that the keymap generated in keyboard_init has changed to reflect the updated environment variable, so it looks as if using wlr_keyboard_set_keymap is having no effect for some reason.
from labwc.
A bit more fiddling suggests that should have been keyboard_init (&(g_server->seat))
, but it still seems to make no difference; I can now see the environment variable changing in the terminal, but the terminal is still using the original keymap.
from labwc.
I've got this working - see above PR.
from labwc.
Related Issues (20)
- Inhibit idle question HOT 2
- Debian Packaging - Fixing Terminal Recommends HOT 5
- Add user-configurable blocklist for the security-context implementation
- Touchscreen bindings? HOT 4
- tilde symbol in pipemenus might be causing issues with commands? HOT 1
- Set the LANG in $HOME/.config/labwc/environment , It don't take effect on the menu of windows title. HOT 21
- firefox --kiosk: starts but does not show a window at all HOT 10
- Conditional actions example HOT 1
- Flickering with magnifier and gammastep HOT 11
- Plan for release `0.7.3`
- Dual graphic card HOT 2
- gamma control of output 43 failed when launching wlsunset HOT 2
- DnD between wayland and xwayland not working
- [Question] max_render_time adjustment setting? HOT 6
- Labwc allegedly slow to send fractional scale to applications HOT 4
- Assertion failed at `wlr_libinput_get_device_handle()` in nested session HOT 2
- Very odd Thonny behaviour when unmaximising a window HOT 3
- XDG configure state gets out of sync when clients timeout HOT 5
- Modal dialogs appear behind toplevel window if set by layer-shell-qt HOT 14
- Theme title bars not having all the Openbox features HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labwc.