payload: {"action":"created","issue":{"url":"https://api.github.com/repos/ultrabug/py3status/issues/1668","repository_url":"https://api.github.com/repos/ultrabug/py3status","labels_url":"https://api.github.com/repos/ultrabug/py3status/issues/1668/labels{/name}","comments_url":"https://api.github.com/repos/ultrabug/py3status/issues/1668/comments","events_url":"https://api.github.com/repos/ultrabug/py3status/issues/1668/events","html_url":"https://github.com/ultrabug/py3status/issues/1668","id":402069309,"node_id":"MDU6SXNzdWU0MDIwNjkzMDk=","number":1668,"title":"[feature request] keyboard_layout and variants","user":{"login":"ecks","id":49222,"node_id":"MDQ6VXNlcjQ5MjIy","avatar_url":"https://avatars3.githubusercontent.com/u/49222?v=4","gravatar_id":"","url":"https://api.github.com/users/ecks","html_url":"https://github.com/ecks","followers_url":"https://api.github.com/users/ecks/followers","following_url":"https://api.github.com/users/ecks/following{/other_user}","gists_url":"https://api.github.com/users/ecks/gists{/gist_id}","starred_url":"https://api.github.com/users/ecks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecks/subscriptions","organizations_url":"https://api.github.com/users/ecks/orgs","repos_url":"https://api.github.com/users/ecks/repos","events_url":"https://api.github.com/users/ecks/events{/privacy}","received_events_url":"https://api.github.com/users/ecks/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-01-23T04:44:30Z","updated_at":"2019-02-07T05:16:37Z","closed_at":"2019-02-07T05:16:37Z","author_association":"CONTRIBUTOR","body":"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.\r\n\r\n1. 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.\r\n\r\n2. 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*. \r\n\r\nFor 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.\r\n\r\nI 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."},"comment":{"url":"https://api.github.com/repos/ultrabug/py3status/issues/comments/461291320","html_url":"https://github.com/ultrabug/py3status/issues/1668#issuecomment-461291320","issue_url":"https://api.github.com/repos/ultrabug/py3status/issues/1668","id":461291320,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2MTI5MTMyMA==","user":{"login":"ecks","id":49222,"node_id":"MDQ6VXNlcjQ5MjIy","avatar_url":"https://avatars3.githubusercontent.com/u/49222?v=4","gravatar_id":"","url":"https://api.github.com/users/ecks","html_url":"https://github.com/ecks","followers_url":"https://api.github.com/users/ecks/followers","following_url":"https://api.github.com/users/ecks/following{/other_user}","gists_url":"https://api.github.com/users/ecks/gists{/gist_id}","starred_url":"https://api.github.com/users/ecks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecks/subscriptions","organizations_url":"https://api.github.com/users/ecks/orgs","repos_url":"https://api.github.com/users/ecks/repos","events_url":"https://api.github.com/users/ecks/events{/privacy}","received_events_url":"https://api.github.com/users/ecks/received_events","type":"User","site_admin":false},"created_at":"2019-02-07T05:16:37Z","updated_at":"2019-02-07T05:16:37Z","author_association":"CONTRIBUTOR","body":"@lasers hey thanks! that actually works fine for me.\r\n\r\nI 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).\r\n\r\nI'm closing this issue then since it can do it all without needing any code changes. Thanks again!"}}
other: {"actor":{"display_login":"ecks"}}