-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
[feature request] keyboard_layout and variants #1668
Comments
|
Hey, Thanks for that, I did not realize the format string was so customizable! I guess I shoulda read the docs more. For [1] I was able to achieve exactly what I wanted using [?if=variant [?color=#00ff1e&show {variant}] | {layout}] Then later I could define color_us = "#0038ff". I haven't been able to figure out how to define a var that will specify the color of the variant (if we want it to be different color from the lang, if not then it all works), so that's why need to add ?color specifier. Just curious, are there other useful command you can put after & besides show, color and if? |
I think this does same thing -- Simplifying... To print different colors...
Your example might looks like this: Simplifying it to...
You can look at #752. We got #1584 that ought to replace the current formatter with f-string formatter. |
@lasers hey thanks! that actually works fine for me. I am not sure why I didn't try that, but it also works if you want to set a variant for another language (for instance russian with phonetic). I'm closing this issue then since it can do it all without needing any code changes. Thanks again! |
I really enjoy using keyboard_layout module, especially since I often switch between us and dvorak variants in the middle of typing. I have some some feature that I hacked together in my personal script, and would love to see included in the main branch.
When displaying variant, allow for boolean configuration parameter where if xkblayout-state returns the variant as empty (nothing), then display the variant as the same as the layout. This allows quickly to switch between the main language and variant (us and dvorak in my case) while having only one format identifier. The way it is currently, it would switch between empty string and "dvorak" if I have format = "{variant}" set.
Currently, there is no way to direct the module to set a variant using the layout user-defined array. The only way is to set it externally. Would be nice to have something like layout = [us, (us, dvorak), ru], so that if an element is a tuple, to figure out that the second is the variant of the lang in the first. That might require setxkbmap to use the -variant flag in addition to -layout.
For 1, it shouldn't be an issue to implement and shouldn't affect the main functionality of the module, if the feature is useful I'll make a pull request. For 2, it would be more complex and would need some feedback.
I also found out that you can set dvorak directly using setxkbmap -layout dvorak (as described in the example at the beginning of the module), however that leads to inconsistencies between what setxkbmap and xkblayout-state displays. It looks like there are some weird rules in linux when treating "dvorak" variant. setxkbmap -layout us -variant dvorak or setxkbmap -layout us,dvorak fixes that though.
The text was updated successfully, but these errors were encountered: