Add timer
script for desktop machines
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.
This commit is contained in:
parent
b30909b32a
commit
b36ca8086e
5 changed files with 62 additions and 12 deletions
20
lib/shared/scripts/timer.nix
Normal file
20
lib/shared/scripts/timer.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
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
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue