NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.98k stars 13.34k forks source link

redshift-plasma-applet appears to add filters to the screen but never remove them #83250

Closed werner291 closed 2 years ago

werner291 commented 4 years ago

Describe the bug

The redshift-plasma-applet appears to only add filters to the screen, not removing them when that is necessary. Upon turning on/off and setting changes, the screen becomes progressively darker and redder to the point of being unuseable, need to restart.

To Reproduce Steps to reproduce the behavior:

  1. Add "redshift-plasma-applet" to list of packages in configuration.nix
  2. Add the plasma applet to a panel in kde
  3. Adjust the brightness/temperature by scrolling on the icon, turn the applet on/off by clicking on it.

Expected behavior Screen brightness and temperature are controlled as expected, turning the applet off removes the redshift effect.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Metadata

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module: redshift-plasma-applet
stale[bot] commented 3 years ago

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

aquarial commented 3 years ago

This issue is a total pain. I finally dived into nix enough to fix it. Here's a local fix to apply until my pullrequest is merged:

  # /etc/nixos/configuration.nix

  environment.systemPackages = with pkgs; [
    # all your other packages
    my-redshift-applet
  ];

  nixpkgs.config.packageOverrides = pkgs: rec {
    my-redshift-applet = pkgs.stdenv.lib.overrideDerivation pkgs.redshift-plasma-applet ( oldAttrs: {
        patchPhase = ''
            substituteInPlace package/contents/ui/main.qml \
              --replace "redshiftCommand: 'redshift'" \
                        "redshiftCommand: '${pkgs.redshift}/bin/redshift'" \
              --replace "redshiftOneTimeCommand: 'redshift -O " \
                        "redshiftOneTimeCommand: '${pkgs.redshift}/bin/redshift -P -O " \
              --replace "redshift -x" \
                        "${pkgs.redshift}/bin/redshift -x"

            substituteInPlace package/contents/ui/config/ConfigAdvanced.qml \
              --replace "'redshift -V'" \
                        "'${pkgs.redshift}/bin/redshift -V'"
        '';
    });

patchPhase modified from https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/misc/redshift-plasma-applet/default.nix#L16

aquarial commented 3 years ago

I closed the PR because there's an upstream fix to the -P flag. I'll open another that updates the source, and adds the missing --replace

aquarial commented 3 years ago

Re-opened with same old source and inlined patch because I couldn't get the upstream to work. It seems like they broke 'toggling applet off'!

What a drag.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

timokau commented 2 years ago

Should be fixed by @aquarial's PR #101471.