-
-
Notifications
You must be signed in to change notification settings - Fork 721
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
Keyboard layout module #659
Conversation
👋 @Alexays Is there any way to access the travis status ? I am doing changes on the Dockerfiles, but can't have any feedback on it. |
https://travis-ci.org/github/Alexays/Waybar/jobs/673431112 |
Should I drop the commit affecting the dockerfiles ? |
|
||
The *layout* module displays the current keyboard layout of Sway | ||
|
||
# CONFIGURATION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about the different fields here, I picked them from waybar-disk(5). Are they herited from ALabel ?
I can't update docker image based on a PR, could you do another PR with only docker file changs? |
|
|
std::tuple<std::string, std::string> | ||
>; | ||
|
||
static inline const fs::path xbk_file_ = "/usr/share/X11/xkb/rules/evdev.xml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be xkb_file_
?
Also, kind of hardcoded, isn't it? May this file be at some different path? Like under another prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path is defined and standart by https://linux.die.net/man/7/xkeyboard-config . I fairly assume there will be an issue only with nixos. Are you using nixos, and if so, have you some suggestions for a workaround ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get the path to the /usr/share/X11/xkb
dir with pkg-config xkeyboard-config --variable xkb_base
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is it intentional or typo xkb_file_
-> xbk_file_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typo is not intended. I will fix it, thanks for the feedback.
I suppose it is possible for meson.build to generate a macro which contains the path XKB_BASE
. I don't know how to use meson.build properly, I'll explore a bit, I'll keep you informed.
|
@BlueGone would it be possible to add CSS classes to distinguish layouts and variants? For example, I would definitely want to use different colors for different layouts. I guess the simplest way would be to add CSS classes |
Update list of modules in README Add layout class to sway modules update default config and style
Hum, nice idea. I'll take a look at it, get back to you as soon as I see it if I can. |
@BlueGone, to unbreak FreeBSD on CI apply the following: diff --git a/.travis.yml b/.travis.yml
index 3085d7b..962065c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,7 +34,7 @@ jobs:
install:
- sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
- sudo pkg install -y date gtk-layer-shell gtkmm30 jsoncpp libdbusmenu
- libfmt libmpdclient libudev-devd meson pulseaudio scdoc spdlog
+ libfmt libinput libmpdclient libudev-devd meson pugixml pulseaudio scdoc spdlog
script:
- meson build -Dman-pages=enabled
- ninja -C build |
@@ -83,6 +83,7 @@ dbusmenu_gtk = dependency('dbusmenu-gtk3-0.4', required: get_option('dbusmenu-gt | |||
giounix = dependency('gio-unix-2.0', required: get_option('dbusmenu-gtk')) | |||
jsoncpp = dependency('jsoncpp') | |||
pugixml = dependency('pugixml') | |||
libinput = dependency('libinput') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I don't see libinput references in the code (builds fine without). See also 74db69d.
Would it be possible to add support for showing the keyboard modes (num lock, scroll lock, caps lock, etc.) in this module? |
Based on PR #556.
Fixes #66.
This PR add a
sway/layout
module. The module display the currently selected keyboard layout.With the format string
{long} / {short} / {variant}
, we can expect outputs like:English (US) / en / us
English (Dvorak) / en / dvorak
French / fr / fr