sergei-mironov / xkb-switch

Switch your X keyboard layouts from the command line
MIT License
345 stars 37 forks source link

Add option to print layouts in uppercase #49

Closed fpaskali closed 4 years ago

fpaskali commented 4 years ago

It would be nice if there is an option to print the layouts in uppercase, as it looks better on some panels and status bars.

I made a modification of longwait function which transforms the string characters to uppercase.

if(m_lwait_u) {
  while(true) {
    xkb.wait_event();
    xkb.build_layout(syms);
    syms_collected = true;
    string su = syms.at(xkb.get_group());
    transform(su.begin(), su.end(), su.begin(), ::toupper); 
    cout << su << endl;
  }
}
sergei-mironov commented 4 years ago

Hi. I think this issue should be solved outside xkb-switch to keep things more unix-way. Did you consider

$ xkb-switch | tr [:lower:] [:upper:]

?

fpaskali commented 4 years ago

I didn't. But it works perfect. Thanks