-
Notifications
You must be signed in to change notification settings - Fork 3
/
blink.fish
30 lines (27 loc) · 860 Bytes
/
blink.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function blink --description 'Flash the keyboard [1] times with a [0.15]s delay'
# return 0
# set pre (/Users/squash/Documents/Code/mac-keyboard-brightness/kbrightness)
# set times 1
# set duration 0.15
# switch (count $argv)
# case '1'
# set times "$argv[1]"
# case '2'
# set times "$argv[1]"
# set duration "$argv[2]"
# case 0
# true
# case '*'
# echo "Usage:"
# echo " blink [times] [duration]"
# return 1
# end
# for i in (seq "$times")
# /Users/squash/Documents/Code/mac-keyboard-brightness/kbrightness 1
# sleep "$duration"
# /Users/squash/Documents/Code/mac-keyboard-brightness/kbrightness 0
# sleep "$duration"
# end
# /Users/squash/Documents/Code/mac-keyboard-brightness/kbrightness "$pre"
true
end