MaxVerevkin / wl-gammarelay-rs

A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering
GNU General Public License v3.0
119 stars 2 forks source link

Can't compile using `cargo install wl-gammarelay-rs` #1

Closed egrist closed 2 years ago

egrist commented 2 years ago

Output of rustup check: stable-x86_64-unknown-linux-gnu - Up to date : 1.58.1 (db9d1b20b 2022-01-20) rustup - Up to date : 1.24.3

error[E0005]: refutable pattern in local binding: `_` not covered
 --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wl-gammarelay-rs-0.2.0/src/dbus_client.rs:6:9
  |
6 |     let zbus::Address::Unix(addr) = zbus::Address::session()?;
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
  |
  = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
  = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
  = note: the matched value is of type `zbus::Address`
help: you might want to use `if let` to ignore the variant that isn't matched
  |
6 |     if let zbus::Address::Unix(addr) = zbus::Address::session()? { /* */ }
  |

error[E0005]: refutable pattern in local binding: `_` not covered
  --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wl-gammarelay-rs-0.2.0/src/dbus_server.rs:14:9
   |
14 |     let zbus::Address::Unix(addr) = zbus::Address::session()?;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
   = note: the matched value is of type `zbus::Address`
help: you might want to use `if let` to ignore the variant that isn't matched
   |
14 |     if let zbus::Address::Unix(addr) = zbus::Address::session()? { /* */ }
   |

For more information about this error, try `rustc --explain E0005`.
error: failed to compile `wl-gammarelay-rs v0.2.0`, intermediate artifacts can be found at `/tmp/cargo-installhvl4E7`

Caused by:
  could not compile `wl-gammarelay-rs` due to 2 previous errors
MaxVerevkin commented 2 years ago

Thanks for the report. It seems like zbus 2.1 is incompatible with zbus 2.0 even though the version change was "minor". And, apparently, cargo install ignores Cargo.lock.

MaxVerevkin commented 2 years ago

This should be fixed now.

egrist commented 2 years ago

@MaxVerevkin Thanks for the quick update, now it compiled and installed, but another issue appeared where I can't run it: wl-gammarelay-rs run New output: 5 Cannot initialize output 5: no gamma control manager

Nor skipping that part and just try to set brightness busctl --user set-property rs.wl-gammarelay / rs.wl.gammarelay Brightness d 2: Failed to set property Brightness on interface rs.wl.gammarelay: The name is not activatable

I'm on Fedora 35, GNOME 41.3 with NVIDIA drivers, maybe that has something to do with it.

MaxVerevkin commented 2 years ago

I'm on Fedora 35, GNOME 41.3 with NVIDIA drivers, maybe that has something to do with it.

This tool uses wlr-gamma-control-unstable-v1 protocol, which Gnome (apparently) doesn't implement. I don't think I can do anything in this situation 😔.

egrist commented 2 years ago

Ah I understand, didn't know GNOME didn't have it implemented, looking forward to testing it when it does. Thanks again.

MaxVerevkin commented 2 years ago

Unfortunately, beased on https://gitlab.gnome.org/GNOME/mutter/-/issues/1635 they will never implement a way for third party apps to control the gaama table.