VSCode init
This commit is contained in:
@@ -242,6 +242,7 @@ abbr fd1 "fd --changed-within 1d"
|
||||
abbr ens "enable-site"
|
||||
abbr ev "evince-silent"
|
||||
abbr ff "fzf-cd"
|
||||
abbr fnpr "fn-progress"
|
||||
# abbr fbg "find-bg"
|
||||
# abbr fr "fzf-ranger"
|
||||
abbr fv "fzf-vim"
|
||||
|
||||
39
dot_config/fish/functions/fn-progress.fish
Executable file
39
dot_config/fish/functions/fn-progress.fish
Executable file
@@ -0,0 +1,39 @@
|
||||
function fn-progress
|
||||
# --- Season Dates (Fortnite Chapter 7 Season 1) ---
|
||||
set SEASON_START "2025-11-29 00:00:00"
|
||||
set SEASON_END "2026-03-04 00:00:00"
|
||||
|
||||
# --- Calculate Unix Timestamps ---
|
||||
set START_SECONDS (date -d "$SEASON_START" +%s)
|
||||
set END_SECONDS (date -d "$SEASON_END" +%s)
|
||||
set CURRENT_SECONDS (date +%s)
|
||||
set CURRENT_DATE_TIME (date)
|
||||
|
||||
# --- Check if the season is over or hasn't started ---
|
||||
if test "$CURRENT_SECONDS" -lt "$START_SECONDS"
|
||||
echo "🎯 Fortnite C7S1 hasn't started yet! (Starts on $SEASON_START)"
|
||||
return
|
||||
end
|
||||
|
||||
if test "$CURRENT_SECONDS" -ge "$END_SECONDS"
|
||||
echo "🎉 Fortnite C7S1 has ended! (Ended on $SEASON_END)"
|
||||
return
|
||||
end
|
||||
|
||||
# --- Calculate Progress ---
|
||||
set TOTAL_DURATION (math "$END_SECONDS - $START_SECONDS")
|
||||
set TIME_PASSED (math "$CURRENT_SECONDS - $START_SECONDS")
|
||||
|
||||
# --- Calculate the ceiling percentage (The Critical Change) ---
|
||||
# Setting scale=0 forces bc to output only the integer part (truncation),
|
||||
# and adding 0.9999 before truncation implements the ceiling logic.
|
||||
set PROGRESS_PERCENT (echo "scale=0; (($TIME_PASSED * 100) / $TOTAL_DURATION) + 0.9999" | bc)
|
||||
|
||||
# --- Output Result ---
|
||||
echo "📅 Current Date/Time: $CURRENT_DATE_TIME"
|
||||
echo "🚀 Season Start: $SEASON_START"
|
||||
echo "🛑 Season End: $SEASON_END"
|
||||
echo "---"
|
||||
echo "✅ Fortnite C7S1 is **$PROGRESS_PERCENT%** complete!"
|
||||
echo "---"
|
||||
end
|
||||
12
dot_config/fish/functions/test_output.txt
Normal file
12
dot_config/fish/functions/test_output.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
📅 Current Date/Time: Sat Dec 6 12:55:57 EST 2025
|
||||
🚀 Season Start: 2025-11-29 00:00:00
|
||||
🛑 Season End: 2026-03-04 00:00:00
|
||||
---
|
||||
✅ Fortnite C7S1 is **7.93%** complete!
|
||||
---
|
||||
]4;0;#0B0E12\]4;1;#671D22\]4;2;#722327\]4;3;#19453B\]4;4;#1B594F\]4;5;#51554A\]4;6;#99322C\]4;7;#82bcb1\]4;8;#5b837b\]4;9;#671D22\]4;10;#722327\]4;11;#19453B\]4;12;#1B594F\]4;13;#51554A\]4;14;#99322C\]4;15;#82bcb1\]10;#82bcb1\]11;#0B0E12\]12;#82bcb1\]13;#82bcb1\]17;#82bcb1\]19;#0B0E12\]4;232;#0B0E12\]4;256;#82bcb1\]708;#0B0E12\📅 Current Date/Time: Sat Dec 6 12:55:57 EST 2025
|
||||
🚀 Season Start: 2025-11-29 00:00:00
|
||||
🛑 Season End: 2026-03-04 00:00:00
|
||||
---
|
||||
✅ Fortnite C7S1 is **7.93%** complete!
|
||||
---
|
||||
Reference in New Issue
Block a user