Skip to content

Commit

Permalink
gcalcli: fix notifications on linux
Browse files Browse the repository at this point in the history
Couple of things:

 - fix the path to notify-send
 - add a standard icon to the notification
 - rename the notification from "gcalcli" to "Calendar"

Lastly, there are no tests, so do not try to run them.
  • Loading branch information
Peter Hoeg authored and peterhoeg committed Mar 30, 2017
1 parent 53a2baa commit f67ec45
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions pkgs/applications/misc/gcalcli/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{ fetchFromGitHub, lib, pythonPackages }:
{ stdenv, lib, fetchFromGitHub, pythonPackages
, libnotify ? null }:

pythonPackages.buildPythonApplication rec {
version = "3.4.0";
name = "gcalcli-${version}";

src = fetchFromGitHub {
owner = "insanum";
repo = "gcalcli";
rev = "v${version}";
owner = "insanum";
repo = "gcalcli";
rev = "v${version}";
sha256 = "171awccgnmfv4j7m2my9387sjy60g18kzgvscl6pzdid9fn9rrm8";
};

Expand All @@ -20,12 +21,23 @@ pythonPackages.buildPythonApplication rec {
parsedatetime
six
vobject
] ++ lib.optional (!pythonPackages.isPy3k) futures;
]
++ lib.optional (!pythonPackages.isPy3k) futures;

# there are no tests as of 3.4.0
doCheck = false;

postInstall = lib.optionalString stdenv.isLinux ''
substituteInPlace $out/bin/gcalcli \
--replace "command = 'notify-send -u critical -a gcalcli %s'" \
"command = '${libnotify}/bin/notify-send -i view-calendar-upcoming-events -u critical -a Calendar %s'"
'';

meta = with lib; {
homepage = https://github.com/insanum/gcalcli;
description = "CLI for Google Calendar";
license = licenses.mit;
maintainers = [ maintainers.nocoolnametom ];
maintainers = with maintainers; [ nocoolnametom ];
inherit version;
};
}

0 comments on commit f67ec45

Please sign in to comment.