From 7923386f5973f5adb2bb953a32749632fdf102ff Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Mon, 14 Aug 2023 10:14:16 -0300 Subject: [PATCH] tly improvements --- home/misterio/features/cli/default.nix | 2 ++ home/misterio/features/desktop/hyprland/default.nix | 5 +++-- pkgs/tly/default.nix | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/home/misterio/features/cli/default.nix b/home/misterio/features/cli/default.nix index 0da66a6c..676c735d 100644 --- a/home/misterio/features/cli/default.nix +++ b/home/misterio/features/cli/default.nix @@ -38,5 +38,7 @@ nix-inspect # See which pkgs are in your PATH ltex-ls # Spell checking LSP + + tly # Tally counter ]; } diff --git a/home/misterio/features/desktop/hyprland/default.nix b/home/misterio/features/desktop/hyprland/default.nix index eaa6080d..98f4f9d9 100644 --- a/home/misterio/features/desktop/hyprland/default.nix +++ b/home/misterio/features/desktop/hyprland/default.nix @@ -122,8 +122,9 @@ "SUPER,Print,exec,${grimblast} --notify copy window" "ALT,Print,exec,${grimblast} --notify copy area" # Tally counter - "SUPER,z,exec,${tly} add && ${gtk-play} -i dialog-information" # Add new entry - "SUPERCONTROL,z,exec,${tly} undo && ${gtk-play} -i dialog-warning" # Undo last entry + "SUPER,z,exec,${notify-send} -t 1000 $(${tly} time) && ${tly} add && ${gtk-play} -i dialog-information" # Add new entry + "SUPERCONTROL,z,exec,${notify-send} -t 1000 $(${tly} time) && ${tly} undo && ${gtk-play} -i dialog-warning" # Undo last entry + "SUPERCONTROLSHIFT,z,exec,${tly} reset && ${gtk-play} -i complete" # Reset "SUPERSHIFT,z,exec,${notify-send} -t 1000 $(${tly} time)" # Show current time ] ++ diff --git a/pkgs/tly/default.nix b/pkgs/tly/default.nix index 67c02ded..ac9eb696 100644 --- a/pkgs/tly/default.nix +++ b/pkgs/tly/default.nix @@ -1,8 +1,9 @@ # Tally counter, also used as stopwatch # tly [list-name] -{ lib, writeShellApplication }: (writeShellApplication { +{ lib, writeShellApplication, coreutils, gnugrep, bc }: (writeShellApplication { name = "tly"; + runtimeInputs = [ coreutils gnugrep bc ]; text = builtins.readFile ./tly.sh; }) // { meta = with lib; {