Desktop notifications, and controlling your productivity with events - nimaaskarian/goje GitHub Wiki

As an event-based application, goje can run a command on each of its events. one of these events is on-end which means some mode has just ended. we have a on-start mode as well. we also have the pause event which runs after any pause/unpause.

you can use cli/config options exec-end, exec-start or exec-pause to supply goje with scripts/apps to be run on these events.

goje will pass the timer of that event as a json string as the first argument to that command.

as an example, save the bashscript below on a file, and pass its path to exec-start; and see the magic happening

mode=$(echo "$1" | jq ".Mode" --raw-output)

case "$mode" in 
  # pomodoro
  0)
    mpv ~/foo/bar/notification-sound.mp3
    # kill all telegram in background when on pomodoro, so it wouldn't distract you
    while true; do pkill -f telegram-desktop; sleep 0.5; done &
    notify-send 'Goje' 'Pomodoro started! start working'
  ;;
  # short break
  1)
    mpv ~/foo/bar/some-other-notification-sound.mp3
    notify-send 'Goje' 'Short break time!'
  ;;

  # long break
  2)
    mpv ~/foo/bar/some-other-notification-sound.mp3
    notify-send 'Goje' 'Long break time!\nGood job :D'
  ;;
esac