Comments (17)
SDDM lets the user change layouts live for a multi-user situation.
from labwc.
Neither of your example cases would be addressed by monitoring DBus for these messages. An installer will set some appropriate configuration to indicate the default locale, while the display manager should be setting environment variables to indicate the locale even before labwc launches.
The DBus message is relevant when a user updates the locale settings whole labwc is running, but monitoring DBus seems outside the scope of labwc. Unless there is a Wayland protocol that can be used for this purpose, I think your best bet would be to adapt the KWin or Sway helpers to monitor the bus, then write locale variables to ~/.config/labwc/environment
and trigger a labwc reconfigure when locale messages are received.
from labwc.
Installers change the locale live in order to allow input to work as you progress through the install process.
from labwc.
Hi @Conan-Kudo
Thanks for bringing this up. I'm interested in exploring this as getting/setting keyboard layout is something we struggle with in a standardized way.
I don't know much about the topic.
Any idea what other clients use org.freedesktop.locale1
?
We've probably got some soul-searching between the core devs because we've been clinging on to Wayland/wlr protocols only for IPC - but that's primarily to avoid custom IPC (which this isn't in my mind).
from labwc.
SDDM is another one, as the keyboard layout switching logic for Wayland is intended to use the locale1 interface too. And SDDM can be used with a variety of compositors, such as the default Weston, KWin (from KDE), Sway, and so on.
Fedora's Initial Setup tool is built on top of Anaconda and will also use this interface. I expect we'll see more of this sort of thing over time.
from labwc.
SDDM could also just set the env vars directly before launching the compositor. I get the point about installers and live environments though.
from labwc.
Here's a downstream request from @jkonecny12 for us to support this with Fedora LXQt (which is currently planned to use labwc for Wayland LXQt): https://pagure.io/fedora-lxqt/SIG/issue/4
from labwc.
I don't think we want to add dbus support to labwc.
I agree with what @ahesford suggested above, this seems to be the best solution to the issue for me as well:
I think your best bet would be to adapt the KWin or Sway helpers to monitor the bus, then write locale variables to
~/.config/labwc/environment
and trigger a labwc reconfigure when locale messages are received.
With labwc >= 0.7.1 that should allow changing the keyboard layout live.
When using labwc 0.7.2 (current master), Instead of using ~/.config/labwc/environment
directly you could also use something like ~/.config/labwc/environment.d/keyboard_layout.env
to not mess with user configs.
from labwc.
Just displaying layouts in use is still hacky though.
from labwc.
And how am I supposed to do these triggers when the layout change is being requested, especially at the display manager level where I don't have anywhere to run anything?
from labwc.
And how am I supposed to do these triggers when the layout change is being requested, especially at the display manager level where I don't have anywhere to run anything?
@Conan-Kudo - Do you have the means and ability to explore doing a script yourself for comment/discussion (like the sway one)? Or are you looking for one of us to write it?
I haven't used SDDM for years and it would take me a little while to get the right setup to experiment, so if you can start it off that would be cool.
I don't know enough about this to answer your question. Do you know what the sequence of events is? Am I right in thinking that SDDM starts the compositor before it sends the dbus message about keyboard-layout? If so, could we run the script from ~/.config/labwc/autostart
and just produce some logging in first instance to see what's going on? So, copy locale1-xkb-config
modify it to print to stdout rather than doing the sway IPC and then re-direct that to some logfile.
Just displaying layouts in use is still hacky though.
@stefonarch Suggest we try to modifier-broadcasting
approach first as that's likely to work and avoids custom IPC.
from labwc.
I'm probably capable of writing a script, what I'm concerned about is figuring out how to make it so the single exec limitation for sddm lets me have a labwc that responds to when the setting changes in locale1. I guess I need some kind of async listener thing wrapping the execution of labwc itself, since labwc can't do it?
from labwc.
I think it should be enough to simply have a dbus client script in ~/.config/labwc/autostart
that on startup fetches the current locale and then listens to changes. On startup and each change event it would then update ~/.config/labwc/environment
(or with the master branch ~/.config/labwc/environment.d/keyboard.env
) and send a SIGHUP to labwc (manually via kill -s SIGHUP $LABWC_PID
or via labwc --reconfigure
)
from labwc.
but that would take down the environment, wouldn't it?
from labwc.
but that would take down the environment, wouldn't it?
No. It just re-loads rc.xml
and environment
. When reading the latter is just does some setenv()
based on the key/value pairs in the file.
...and it updates the keyboard with the value of XKB_DEFAULT_LAYOUT
(which is the variable we need to get the script to set).
There may be some other keyboard related environment variables we want to tweak too, but let's start with layout.
from labwc.
Is it possible to tell labwc to look in a specific directory for configuration instead of $HOME/.config/labwc
? I can't exactly use this location for labwc for the sddm greeter as the greeter loads with a user that lacks a home directory at all.
from labwc.
Is it possible to tell labwc to look in a specific directory for configuration instead of
$HOME/.config/labwc
? I can't exactly use this location for labwc for the sddm greeter as the greeter loads with a user that lacks a home directory at all.
There is a labwc -C
option. sddm uses /var/lib/sddm/
as home dir.
#1860
from labwc.
Related Issues (20)
- Change "FocusOuput" to be more in-line with "MoveToOutput" HOT 1
- `[../src/ssd/ssd.c:239] view width is smaller than its minimal value` when resizing `foot` window to minimal size HOT 1
- desk*.xbm (omnipresent) buttons cannot be styled/colorized HOT 5
- RFC: nomenclature for "Omnipresent" button and its theming HOT 3
- document new ssd buttons HOT 5
- Perhaps in the CI `scdoc` should be added.
- [Feature request] Allow pressing ESC to leave magnifier HOT 2
- [Question] Keeping my monitors off after inactivity HOT 18
- [Request] Add support for ~/Desktop icons HOT 4
- Enriching the <query> API to match that of openbox' HOT 2
- Viewporter protocol and layer-shell surfaces HOT 3
- Firefox Wayland goes crazy if display scale is changed and a window is placed over its top left corner HOT 5
- [Bug] Mouse not instantly captured by a game on movement HOT 1
- Unity Editor and various X11 programs fail to create a window HOT 4
- Colors saturation VGA vs HDMI HOT 3
- xdg_toplevel_set_fullscreen only sends config after a buffer is bound HOT 5
- drm leasing of the display labwc is using - does wp_drm_lease_v1_destroy restore the desktop? HOT 4
- Plan for release `0.8.1`
- [Question] How to use the magnifier
- When the width of the window is less than the length of the title, there will be a noticeable shrinkage process 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.