K
K
kode_krendel2017-03-03 21:18:11
linux
kode_krendel, 2017-03-03 21:18:11

Timer/alarm for Ubuntu?

We need a simple task - a timer for 1 hour. Conveniently, in two clicks.
Surprisingly, Google is empty. Found only alarm-clock-applet which I don't like.
What other options are there?
Found a few more options. Complete shit - either does not allow the call to be selected, then it does not fold to tray, then a bunch of incomprehensible dependencies, then loading by 40%. What kind of idiocy is this?)) I'm shocked.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2017-03-04
@kode_krendel

you can make it even simpler, write a small function, for convenient use, for example:
it will work in 10 seconds
it will work in 20 minutes
it will work in an hour and run the file at the specified path
the function itself:

alarm(){
  _t="$1"
  _src="$2"
  _alarm(){
    sleep $_t && notify-send -u critical "Прошло $_t" && echo -en "\a"
    if [ "$_src" ];	then mpv "$_src"; fi
  }
  _alarm &!
  echo "ok: напомню через $_t"
  sleep 2
  exit 0
}

update : added exit 0 at the end because bash sometimes misfires when closing the terminal.
instead of mpv, you can take, for example, vlc or another player.
The function must be placed at the end of the initialization file of the console shell you use, for zsh it will be ~/.zshrc , for bash you can ~/.bashrc or ~/.bashrc_profile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question