~tardypad/dotfiles

ref: 7dd5e02494e2821ff6b4fd5758a590ef03b5403b dotfiles/packages/i3blocks/scripts/pomodoro -rwxr-xr-x 497 bytes
7dd5e024 — Damien Tardy-Panis add mako package config 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/env zsh

SESSION_STATUS=$( pomodoro status )

# only display something if a session was started
[[ -n "${SESSION_STATUS}" ]] || exit 0

SESSION_MINUTES_LEFT=$(
  echo "${SESSION_STATUS}" \
    | cut --fields 1 --delimiter ' '
)

if [[ "${SESSION_MINUTES_LEFT}" -lt 5 ]]; then
  SESSION_ICON=''
elif [[ "${SESSION_MINUTES_LEFT}" -lt 20 ]]; then
  SESSION_ICON=''
else
  SESSION_ICON=''
fi

echo "<span foreground='#{color/notice/hex}'>${SESSION_ICON} ${SESSION_STATUS}</span>"