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

Can you add keyboard layout variant? #316

Closed
ChoiZ opened this issue Jan 10, 2017 · 10 comments · Fixed by #2163
Closed

Can you add keyboard layout variant? #316

ChoiZ opened this issue Jan 10, 2017 · 10 comments · Fixed by #2163

Comments

@ChoiZ
Copy link

ChoiZ commented Jan 10, 2017

When I write in French I use Bépo layout (like dvorak for french language)

$ setxkbmap -query
rules: evdev
model: pc105
layout: fr
variant: bepo

How can I display "fr (bepo)" in my polybar?

I can see there's 3 variables in the module/xkeyboard.cpp:
%name%
%layout%
%number%

Is it possible to add the variant variable?

Regards

@jaagr
Copy link
Member

jaagr commented Jan 10, 2017

Hi,

Isn't it visible when using the %name% token?

label-layout = %name%

@ChoiZ
Copy link
Author

ChoiZ commented Jan 11, 2017

Nope :(

@jaagr
Copy link
Member

jaagr commented Jan 11, 2017

Mine says French (Bepo, ergonomic, Dvorak way) when I run setxkbmap fr bepo... a bit long but you can create your own keyboard def and change it to whatever you like. See man setxkbmap and man xkbcomp

@jaagr
Copy link
Member

jaagr commented Jan 11, 2017

I like how it says ergonomic... for someone who never used dvorak it sure is painful (took a while to get back ;P)

@ChoiZ
Copy link
Author

ChoiZ commented Jan 11, 2017

Ok when I run setxkbmap fr bepo I've got the same thing French (Bepo, ergonomic, Dvorak way).

Is it easy to get only "bepo" value, but how can assign this value thanks to setxkbmap -query |grep variant|cut -d ' ' -f 5 to the variable %variant% in you xkeyboard.cpp ?

@jaagr
Copy link
Member

jaagr commented Jan 12, 2017

The xkb extension doesn't expose a way to specifically get the variant used from what I can see.

@NBonaparte
Copy link
Member

One solution to this is to parse whatever is in the parentheses and set that to a %variant% token.

@acarril
Copy link

acarril commented Oct 8, 2019

One solution to this is to parse whatever is in the parentheses and set that to a %variant% token.

How would you do this? I'm sorry, but I don't know much about Polybar module config.

@patrick96
Copy link
Member

@acarril This was a comment about how this could be implemented. This is not a feature in polybar yet.

@acarril
Copy link

acarril commented Oct 9, 2019

Oh ok, thanks!

parmort added a commit to parmort/polybar that referenced this issue Aug 8, 2020
parmort added a commit to parmort/polybar that referenced this issue Dec 19, 2020
patrick96 pushed a commit that referenced this issue Dec 19, 2020
* Add variant support to xkeyboard layout label

Solves #316

* Run style checks, I guess?

* Add comment

* Return nothing if there is no variant

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

Successfully merging a pull request may close this issue.

5 participants