greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.85k stars 470 forks source link

keyboard_layout block: Add support for keyboard layout variant to xkbmap driver #1904

Closed cortices closed 1 year ago

cortices commented 1 year ago

I've done my best to make an idiomatic addition to parse keyboard layout variants in the xkbmap driver for the keyboard_layout block. This means all 4 drivers have support for variants and layouts. I've been testing with it myself between two "us" layouts with different variants.

cortices commented 1 year ago

I tried to run rustfmt and it just hung for an hour so I need to work out what’s up with that so I can fix.

bim9262 commented 1 year ago

I'm guessing you didn't tell it what file to run on and it was reading from stdin. Try rustfmt --edition=2021 src/blocks/keyboard_layout.rs

ammgws commented 1 year ago

Can merge once you fix this:

error: redundant field names in struct initialization
   --> src/blocks/keyboard_layout.rs:193:13
    |
193 |             layout: layout,
    |             ^^^^^^^^^^^^^^ help: replace it with: `layout`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `-D clippy::redundant-field-names` implied by `-D warnings`

error: redundant field names in struct initialization
   --> src/blocks/keyboard_layout.rs:194:13
    |
194 |             variant: variant,
    |             ^^^^^^^^^^^^^^^^ help: replace it with: `variant`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

error: could not compile `i3status-rs` due to 2 previous errors
cortices commented 1 year ago

Thanks, sorry my PC was in pieces for upgrades this week.