From 9723cde54bd82958e4e7c97c8d8ae408a4f06c1b Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Fri, 31 May 2019 01:34:46 +0200 Subject: machines/shiki: move the notify-send invocation out --- machines/profpatsch/shiki.nix | 8 +++++++- pkgs/profpatsch/display-infos/default.nix | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/machines/profpatsch/shiki.nix b/machines/profpatsch/shiki.nix index 77a97303..6bc08b6a 100644 --- a/machines/profpatsch/shiki.nix +++ b/machines/profpatsch/shiki.nix @@ -209,8 +209,14 @@ in { youtube-dl # download videos zathura # pdf viewer ]; - userScripts = with pkgs.vuizvui.profpatsch; [ + userScripts = with pkgs.vuizvui.profpatsch; + let + di-notify = pkgs.writers.writeBashBin "display-infos-notify" '' + ${pkgs.libnotify}/bin/notify-send "$(${display-infos}/bin/display-infos)" + ''; + in [ display-infos # show time & battery + di-notify # same, but pipe to libnotify show-qr-code # display a QR code backlight # adjust laptop backlight ]; diff --git a/pkgs/profpatsch/display-infos/default.nix b/pkgs/profpatsch/display-infos/default.nix index 97a13944..b626e844 100644 --- a/pkgs/profpatsch/display-infos/default.nix +++ b/pkgs/profpatsch/display-infos/default.nix @@ -57,7 +57,7 @@ let date = date, sftdate = sftdate ) - sub.run(["@notify-send@", notify]) + print(notify) ''; in @@ -66,7 +66,6 @@ in } '' substitute ${script} script \ --replace "@python3@" "${getBin python3}/bin/python3" \ - --replace "@notify-send@" "${getBin libnotify}/bin/notify-send" \ --replace "@bc@" "${getBin bc}/bin/bc" \ --replace "@sfttime@" "${getBin sfttime}/bin/sfttime" install -D script $out/bin/display-infos -- cgit 1.4.1