From 5b3d80980f48a28f217dfdf95167e0e7ae542392 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 11 Nov 2024 00:16:13 +0700 Subject: bin: add script timer.sh The timer.sh diplay a message after X duration. --- bin/timer.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/timer.sh diff --git a/bin/timer.sh b/bin/timer.sh new file mode 100755 index 0000000..48698dd --- /dev/null +++ b/bin/timer.sh @@ -0,0 +1,21 @@ +#!/bin/sh +## SPDX-FileCopyrightText: 2022 M. Shulhan +## SPDX-License-Identifier: GPL-3.0-or-later + +## +## Script to display message after X duration. +## +## Usage +## +## $ timer.sh $TIME [$MESSAGE] +## +## The $TIME parameter is any format that is acceptable by sleep, for example +## 60, 1m, 2h. +## The $MESSAGE parameter is optional. +## + +DELAY=$1 +MESSAGE=$2 + +sleep "$DELAY" +notify-send "Time out" "$MESSAGE" -- cgit v1.3