Skip to content
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

Closed
wants to merge 10 commits into from
Closed

Keyboard layout module #659

wants to merge 10 commits into from

Conversation

BlueGone
Copy link
Contributor

@BlueGone BlueGone commented Apr 10, 2020

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

meson.build Show resolved Hide resolved
@BlueGone
Copy link
Contributor Author

👋 @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.

@Alexays
Copy link
Owner

Alexays commented Apr 10, 2020

https://travis-ci.org/github/Alexays/Waybar/jobs/673431112
I need to update images on Docker hub 😄
I'll take care of it.

@BlueGone
Copy link
Contributor Author

BlueGone commented Apr 10, 2020

Should I drop the commit affecting the dockerfiles ?


The *layout* module displays the current keyboard layout of Sway

# CONFIGURATION
Copy link
Contributor Author

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 ?

@Alexays
Copy link
Owner

Alexays commented Apr 10, 2020

Should I drop the commit affecting the docker images ?

I can't update docker image based on a PR, could you do another PR with only docker file changs?
And once merged, pipeline should be ok.

@BlueGone
Copy link
Contributor Author

Should I drop the commit affecting the docker images ?

I can't update docker image based on a PR, could you do another PR with only docker file changs?
And once merged, pipeline should be ok.

#661

@BlueGone BlueGone changed the title WIP: Keyboard layout module Keyboard layout module Apr 10, 2020
@Alexays
Copy link
Owner

Alexays commented Apr 11, 2020

#661
https://travis-ci.org/github/Alexays/Waybar
It's obviously not the right packages for alpine and fedora, maybe the devel one?

@Alexays Alexays mentioned this pull request Apr 11, 2020
std::tuple<std::string, std::string>
>;

static inline const fs::path xbk_file_ = "/usr/share/X11/xkb/rules/evdev.xml";

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?

Copy link
Contributor Author

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 ?

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.

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_?

Copy link
Contributor Author

@BlueGone BlueGone May 22, 2020

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
Copy link
Contributor Author

https://travis-ci.org/github/Alexays/Waybar
It's obviously not the right packages for alpine and fedora, maybe the devel one?

#665

@maximbaz
Copy link
Contributor

@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 short-<value> and variant-<value>, such as short-en and variant-dvorak.

@BlueGone
Copy link
Contributor Author

BlueGone commented May 22, 2020

@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 short-<value> and variant-<value>, such as short-en and variant-dvorak.

Hum, nice idea. I'll take a look at it, get back to you as soon as I see it if I can.

@jbeich
Copy link
Contributor

jbeich commented May 26, 2020

@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')
Copy link
Contributor

@jbeich jbeich May 26, 2020

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.

@Alexays Alexays mentioned this pull request May 26, 2020
@Fjorge0
Copy link

Fjorge0 commented Oct 10, 2020

Would it be possible to add support for showing the keyboard modes (num lock, scroll lock, caps lock, etc.) in this module?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: keyboard layout
7 participants