From 10a63f585d3acd46e630235f59a882402d68e04f Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 24 May 2021 22:09:58 +0200 Subject: [PATCH] mako: Remove notification inhibitor Upstream wants to implement modes, which collide with the patch that I used. --- pkgs/default.nix | 11 ----------- users/simon/modules/sway.nix | 36 ------------------------------------ 2 files changed, 47 deletions(-) diff --git a/pkgs/default.nix b/pkgs/default.nix index 4637d4b..f14a652 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -29,17 +29,6 @@ in ]; }); - # TODO: Remove patch once mako > 1.4.1 is released and in nixpkgs - mako = prev.mako.overrideAttrs (o: o // { - patches = [ - # Adds makoctl set - (prev.fetchpatch { - url = "https://github.com/emersion/mako/commit/782ef66b04d5d927fe19254be175e0b5ddff343f.patch"; - sha256 = "1qjaxhf11fyysmi9l8vwrz2vag3lcbllx8y8v2fgg3p52a7cwdjs"; - }) - ]; - }); - # TODO: Remove when pavucontrol > 4.0 is released pavucontrol = prev.pavucontrol.overrideAttrs (o: o // { patches = [ diff --git a/users/simon/modules/sway.nix b/users/simon/modules/sway.nix index fea88a2..37b7e41 100644 --- a/users/simon/modules/sway.nix +++ b/users/simon/modules/sway.nix @@ -387,37 +387,6 @@ lib.mkIf nixosConfig.sbruder.gui.enable { deactivated = " "; }; }; - "custom/notification_inhibitor" = { - exec = pkgs.writeShellScript "notification-inhibitor-watch-state" '' - set -euo pipefail - (echo; ${pkgs.inotify-tools}/bin/inotifywait -m -e close_write ${lib.escapeShellArg makoInhibitStateFile} 2>/dev/null) \ - | (while read line; do - if [ "$(${pkgs.coreutils}/bin/cat ${lib.escapeShellArg makoInhibitStateFile})" = "1" ]; then - echo '{"alt": "active", "class": "active"}' - else - echo '{"alt": "inactive", "class": "inactive"}' - fi - done) - ''; - return-type = "json"; - format = "{icon}"; - format-icons = { - active = "${lrm}ﮖ "; - inactive = "${lrm}ﮗ "; - }; - tooltip = false; - on-click = pkgs.writeShellScript "toggle-notification-inhibit" '' - set -e - current_state="$(${pkgs.coreutils}/bin/cat ${lib.escapeShellArg makoInhibitStateFile})" - if [ "$current_state" = "0" ]; then - ${pkgs.mako}/bin/makoctl set invisible=true - echo 1 > ${lib.escapeShellArg makoInhibitStateFile} - else - ${pkgs.mako}/bin/makoctl set invisible=false - echo 0 > ${lib.escapeShellArg makoInhibitStateFile} - fi - ''; - }; backlight = { format = "{percent}% {icon}"; format-icons = [ " " " " " " " " " " " " " " ]; @@ -574,11 +543,6 @@ lib.mkIf nixosConfig.sbruder.gui.enable { Install.WantedBy = [ "sway-session.target" ]; Service = { - ExecStartPre = toString (pkgs.writeShellScript "reset-mako-inhibit-state" '' - set -e - ${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname ${lib.escapeShellArg makoInhibitStateFile})" - echo 0 > ${lib.escapeShellArg makoInhibitStateFile} - ''); ExecStart = "${pkgs.mako}/bin/mako"; Restart = "on-failure"; };