Skip to content

Conversation

parmort
Copy link
Contributor

@parmort parmort commented Aug 8, 2020

Closes #316

Adds %variant% variable to label-layout option in the xkeyboard module. As
suggested, I took the group name and grabbed the string inside the parens.

@codecov
Copy link

codecov bot commented Aug 8, 2020

Codecov Report

Merging #2163 (c853e58) into master (c07cc09) will increase coverage by 2.13%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2163      +/-   ##
=========================================
+ Coverage    5.76%   7.89%   +2.13%     
=========================================
  Files         139     142       +3     
  Lines        9987   10217     +230     
=========================================
+ Hits          576     807     +231     
+ Misses       9411    9410       -1     
Flag Coverage Δ
unittests 7.89% <0.00%> (+2.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/x11/extensions/xkb.hpp 0.00% <0.00%> (ø)
src/modules/xkeyboard.cpp 0.00% <0.00%> (ø)
src/x11/extensions/xkb.cpp 0.00% <0.00%> (ø)
src/events/signal_emitter.cpp 0.00% <0.00%> (-100.00%) ⬇️
include/events/signal_emitter.hpp 0.00% <0.00%> (-5.56%) ⬇️
include/events/signal.hpp 0.00% <0.00%> (ø)
src/components/builder.cpp 0.00% <0.00%> (ø)
src/components/renderer.cpp 0.00% <0.00%> (ø)
include/components/types.hpp 0.00% <0.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c07cc09...c853e58. Read the comment docs.

Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing and thanks @kronn for reviewing :)

I did some more digging into this and there really doesn't seem to be a direct way to get the variant with xcb. There is a way using Xlib and one using values.symbolsName but neither is that straightforward and there also isn't really much documentation about the data format for these two approaches.

I think this way is works well enough.

Can you also add this to the CHANGELOG.md (https://github.com/polybar/polybar/blob/master/CONTRIBUTING.md#changelog)

@parmort
Copy link
Contributor Author

parmort commented Dec 19, 2020

Once (or if) this is merged, I will update the wiki with the new tag.

@patrick96
Copy link
Member

Code looks good now. Please also add your changes to the changelog: https://github.com/polybar/polybar/blob/master/CONTRIBUTING.md#changelog

You may need to rebase first because when you started this branch the changelog didn't exist yet.

@parmort parmort force-pushed the xkb-variant branch 2 times, most recently from fc2af7c to c853e58 Compare December 19, 2020 16:42
Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you very much 🎉

@patrick96 patrick96 merged commit 0d2838f into polybar:master Dec 19, 2020
@parmort parmort deleted the xkb-variant branch January 2, 2021 21:39
@Huy-Ngo
Copy link

Huy-Ngo commented Mar 9, 2021

I'm not sure why I still haven't benefit from this PR (I'm using polybar v 3.5.5 which was released after this PR).

In my config for xkeyboard, I have:

label-layout = %layout% %variant%

However, %variant% is not replaced with the variant I'm using (intl). Should I file an issue about this?

The XKB module showing %variant% instead of being replaced as expected

@parmort
Copy link
Contributor Author

parmort commented Mar 9, 2021

It's not released. I assume it will be released in 3.6; 3.5.5 is a patch release. If you want it, you'll have to build from master. The changelog is a good document to see what has and hasn't been released.

@Huy-Ngo
Copy link

Huy-Ngo commented Mar 9, 2021

Ah thanks, I assumed wrongly.

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.

Can you add keyboard layout variant?
4 participants