change kbd layout using setxkbmap

This commit is contained in:
Miroslav Šedivý
2020-06-15 23:14:23 +02:00
parent 70e8b215cb
commit 4a7800c93f
6 changed files with 27 additions and 2 deletions

View File

@ -165,3 +165,10 @@ short XGetScreenRate() {
XRRScreenConfiguration *conf = XRRGetScreenInfo(display, RootWindow(display, 0));
return XRRConfigCurrentRate(conf);
}
void SetKeyboard(char *layout) {
// TOOD: refactor, use native API.
char cmd[12] = "setxkbmap ";
strcat(cmd, layout);
system(cmd);
}