Oliver Davies
b36ca8086e
Based on https://github.com/sdaschner/dotfiles/blob/master/bin/timer and https://github.com/sdaschner/dotfiles/blob/master/bin/_timer. Seen in https://youtu.be/8CZIv3MJvic?si=PiVPM_vwuUKI7ak3&t=1460.
21 lines
366 B
Nix
21 lines
366 B
Nix
{
|
|
name = "timer";
|
|
|
|
runtimeInputs = [ ];
|
|
|
|
text = ''
|
|
if [[ "$1" == "" ]]; then
|
|
echo "Usage: ''${0##*/} <mins> [message]"
|
|
exit 1
|
|
fi
|
|
|
|
mins=$1
|
|
message=$2
|
|
|
|
nohup _timer "$mins" "$message" &> /dev/null &
|
|
|
|
echo "timer started for $mins min"
|
|
echo "timer started for $mins min, message: '$message'" | systemd-cat -t timer
|
|
'';
|
|
}
|