Skip to content

Commit

Permalink
fix timer string logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinkirkland committed Jan 23, 2024
1 parent a38bfe0 commit 237d811
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
4 changes: 3 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ byobu (6.10) unreleased; urgency=medium

* debian/compat, debian/control:
- bump compat, fix vcs lintian warning, fix debhelper warnings
* usr/share/byobu/profiles/bashrc:
- fix timer string logic

-- Dustin Kirkland <[email protected]> Mon, 22 Jan 2024 10:29:06 -0600
-- Dustin Kirkland <[email protected]> Tue, 23 Jan 2024 09:03:16 -0600

byobu (6.9-0ubuntu1) noble; urgency=medium

Expand Down
18 changes: 3 additions & 15 deletions usr/share/byobu/profiles/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,9 @@ byobu_prompt_runtime() {
nanoseconds=$(printf "%.6d" ${nanoseconds})
microseconds=${nanoseconds:0:3}
# Shorten our string as much as possible
if [ "$days" = "0" ]; then
days=
if [ "$hours" = "0" ]; then
hours=
if [ "$minutes" = "0" ]; then
minutes=
else
minutes="${minutes}m "
fi
else
hours="${hours}h "
fi
else
days="${days}d "
fi
[ "$days" = "0" ] && days= || days="${days}d "
[ "$hours" = "0" ] && hours= || hours="${hours}h "
[ "$minutes" = "0" ] && minutes= || minutes="${minutes}m "
str="${days}${hours}${minutes}${seconds}.${microseconds}s"
printf "[%s]" "$str" 1>&2
}
Expand Down

0 comments on commit 237d811

Please sign in to comment.