This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
args=("$@") | |
n=${args[0]} | |
btdu_location=${args[1]} | |
base_path=${args[2]} | |
duration=${args[3]:-5s} | |
tmp_path=${args[4]:-.} | |
tmp_name=${args[5]:-TEMP} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function show_nyt_dailies -a nyt_s | |
function display_time -a time_s | |
set -f seconds (math "$time_s % 60") | |
set -f minutes (math "floor($time_s / 60) % 60") | |
set -f hours (math "floor($time_s / 3600) % 24") | |
set -f days (math "floor($time_s / 86400)") | |
if test "$days" -gt 0 | |
printf "%d:%02d:%02d:%02d" $days $hours $minutes $seconds | |
else if test "$hours" -gt 0 | |
printf "%02d:%02d:%02d" $hours $minutes $seconds |