We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1a2da7 commit 01d6562Copy full SHA for 01d6562
1 file changed
dot_config/fish/functions/fish_greeting.fish
@@ -129,6 +129,28 @@ function fish_greeting
129
"tv fuzzy finder TUI (television)" \
130
"tv --preview fuzzy find with preview"
131
132
+ # Only show tips once every 6 hours
133
+ set -l stamp_file ~/.cache/fish_greeting_stamp
134
+ set -l interval 21600 # 6 hours in seconds
135
+ set -l now (date +%s)
136
+ set -l show false
137
+
138
+ if not test -f $stamp_file
139
+ set show true
140
+ else
141
+ set -l last (cat $stamp_file)
142
+ if test (math $now - $last) -ge $interval
143
144
+ end
145
146
147
+ if test $show = false
148
+ return
149
150
151
+ mkdir -p ~/.cache
152
+ echo $now > $stamp_file
153
154
set -l count (count $tips)
155
set -l idx1 (random 1 $count)
156
set -l idx2 (random 1 $count)
0 commit comments