aboutsummaryrefslogtreecommitdiff
path: root/config/fish/functions/timer.fish
blob: 7d8bb0e6617f626c6edd171e343ffc326d85bd10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function timer
	if test (count $argv) -ne 1
        echo "Usage: timer <minutes to wait>"
        return
    end
	for i in (seq 1 $argv[1])
        sleep 1m
        echo (string replace -r '^0$' ready! (math $argv[1] - $i))m left
    end
    while true
        for i in (seq 1 20)
            xkbbell
            sleep 1
        end
        sleep 1m
    end
end