summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-05 21:09:17 +0300
committerPaul Buetow <paul@buetow.org>2025-06-05 21:09:17 +0300
commit04d0da322acd38515bd02d9c50ebf28e0275fc8f (patch)
treec0f20aad6a0ac03d4b339094a824e0a75db30054
parente67d89c78da15a7e80d9dbc63facd0e1739b8806 (diff)
parentddc6878409bfe2442accf1f691a9fe1577d7cfa2 (diff)
Merge branch 'master' of codeberg.org:snonux/rexfiles
-rw-r--r--dotfiles/fish/conf.d/supersync.fish24
1 files changed, 11 insertions, 13 deletions
diff --git a/dotfiles/fish/conf.d/supersync.fish b/dotfiles/fish/conf.d/supersync.fish
index e3e7d34..be32f3e 100644
--- a/dotfiles/fish/conf.d/supersync.fish
+++ b/dotfiles/fish/conf.d/supersync.fish
@@ -1,17 +1,5 @@
set -x SUPERSYNC_STAMP_FILE ~/.supersync.last
-function supersync::is_it_time_to_sync
- set -l max_age 86400
- set -l now (date +%s)
- if test -f $SUPERSYNC_STAMP_FILE
- set -l diff (math $now - (cat $SUPERSYNC_STAMP_FILE))
- if test $diff -lt $max_age
- return 0
- end
- end
- echo 'It is time to run sync!!!'
-end
-
# Only sync the HabitsAndQuotes when it's asked for via function parameter
function supersync::worktime
set -l worktime_dir ~/git/worktime
@@ -90,4 +78,14 @@ function supersync
mv $SUPERSYNC_STAMP_FILE.tmp $SUPERSYNC_STAMP_FILE
end
-alias ss supersync
+function supersync::is_it_time_to_sync
+ set -l max_age 86400
+ set -l now (date +%s)
+ if test -f $SUPERSYNC_STAMP_FILE
+ set -l diff (math $now - (cat $SUPERSYNC_STAMP_FILE))
+ if test $diff -lt $max_age
+ return 0
+ end
+ end
+ read -P "It's time to run supersync! Run it? (y/n) " answer; and test "$answer" = y; and supersync
+end