Comments (10)
Unfortunately, it is a strictly X11 app right now. Try to find another tool for Wayland.
from xkb-switch.
@FrolovRuslan1 I would be happy to accept the PR. Have some questions:
- What do you think, can we write an abstraction which would run the existing code on X, and the wayland code you have prototyped if we are on wayland? I think we can depart from making this class a C-structure with function pointers pointing to either X11 or Wayland implementations depending on the build configuration flag? (I am ok with moving towards pure-C implementation)
- What changes do we need in the CMake?
from xkb-switch.
Originally I had no Wayland devices to think about it's support, but now I have a Pinephone which uses Wayland, so at least I can compile and run examples.
I think that it is not a good idea to integrate Wayland support to the originally-X11-only XkbSwitch.cpp
files, but we may think about writing a separate tool with the same command-line interface.
Do you have any good examples of working with keyboard using this protocol?
from xkb-switch.
@grwlf I use sway and layout can be changed with swaymsg externally.
It should not be hard to implement it.
from xkb-switch.
Afaik, X applications should run under Wayland's X compatibility layer called XWayland https://wayland.freedesktop.org/docs/html/ch05.html
Has anybody tried it with xkb-switch
?
from xkb-switch.
Afaik, X applications should run under Wayland's X compatibility layer called XWayland https://wayland.freedesktop.org/docs/html/ch05.html Has anybody tried it with
xkb-switch
?
Yes it does run under xwayland but it seems xwayland doesn't sync the keyboard layouts with wayland.. It's like its own separate thing, I can set my layouts with setxkbmap and switch them/query them with xkb-switch but they don't affect the real keyboard layout in wayland. I have no idea where to open an issue about that..
from xkb-switch.
Afaik, X applications should run under Wayland's X compatibility layer called XWayland https://wayland.freedesktop.org/docs/html/ch05.html Has anybody tried it with
xkb-switch
?
Hello again. I can help develop xkb-switch
under Wayland. Wayland support libxkbcommon and Wayland API libwayland. Here is my test code where I can get list of layouts. BUT how I found out here libxkbcommon
doesnt have tools to switch layouts.
I have ru and us layouts.
Here tests on Debian:
In Plasma Wayland:
1.
-> % xkb-switch --list
us
-> % ./wxkb_switch
It prints keyboard layout only via xkbcommon
num: 1
English (US)
It prints keyboard layout via xkbcommon and wayland
num: 2
English (US)
Russian
In Plasma X11:
1.
-> % xkb-switch --list
us
ru
-> % ./wxkb_switch
It prints keyboard layout only via xkbcommon
num: 1
English (US)
Failed to connect to Wayland display
from xkb-switch.
@FrolovRuslan1 I would be happy to accept the PR. Have some questions:
1. What do you think, can we write an abstraction which would run the existing code on X, and the wayland code you have prototyped if we are on wayland? I think we can depart from making [this class](https://github.com/grwlf/xkb-switch/blob/master/src/XKeyboard.hpp) a C-structure with function pointers pointing to either X11 or Wayland implementations depending on the build configuration flag? (I am ok with moving towards pure-C implementation) 2. What changes do we need in the CMake?
I checked XKeyboard.hpp
and yes, we can write an abstraction for Wayland. I think we can create Class automatically depends on environment variables. Or we can split the project on two. One for the X11 and one for Wayland because if we will be make project based on dependence of build configuration flag or runtime variable then the project growing up to unreadable size, moreover, I do not think that a new X11 analogue will appear under Linux in the near future.
P.S. I tested setxkbmap
it is working but it crash DE switching. If you can please open issue for user help on Wayland and ask like that "Is Wayland have standard methods for switching keyboard layouts because xkbcommon doesnt have and setxkbmap
crash DE switching layout." because for some reason I cant singup and register on Gitlab even through VPN it just doesnt send on google email.
I think if Wayland doesnt have such methods then we can use libxkbcommon
for getting information about keyboard and setting via setxkbmap
or yours implementation.
UPDATE 15.12.2023:
Open issue in Wayland.
from xkb-switch.
Related Issues (20)
- Add option to print layouts in uppercase HOT 2
- no apt packages for Ubuntu 20.04.1 LTS HOT 1
- change compression tool from gz to gzip HOT 8
- Can't change to any layout HOT 4
- Use standard C procedures for handling command-line arguments HOT 10
- Integrate GNU gettext
- Recent releases missing from github? HOT 2
- Manpage error: ignoring bogus filename HOT 2
- Can not change input method of fcitix via command 'xkb-switch -s' HOT 5
- Regolith i3
- Add ability to show current variant and current keyboard layout separately HOT 1
- Error while loading shared libraries HOT 6
- user local xkb configuration not recognized HOT 1
- Can MIT license be used instead of GPL? HOT 6
- ./xkb-switch -l lists only current lauout in use
- Bug when use xkb-switch in xbindkeys HOT 11
- Bug when use xkb-switch and emulates key presses HOT 1
- Problem when installing as user HOT 2
- No way to set variant
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 xkb-switch.