mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* usr/lib/byobu/include/mondrian: LP: #894432
- drop dependency on 'rand' command
This commit is contained in:
parent
9108a125ae
commit
d2e34b4af6
2 changed files with 18 additions and 1 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -3,6 +3,8 @@ byobu (4.51) unreleased; urgency=low
|
|||
* usr/bin/byobu-janitor: LP: #894430
|
||||
- whitelist archlinux for status colors
|
||||
- if tmux exists, then don't bother with color disabling
|
||||
* usr/lib/byobu/include/mondrian: LP: #894432
|
||||
- drop dependency on 'rand' command
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 23 Nov 2011 13:41:31 -0600
|
||||
|
||||
|
|
|
@ -47,6 +47,20 @@ get_random_pane() {
|
|||
echo "$r"
|
||||
}
|
||||
|
||||
get_random_numbers() {
|
||||
local max="$1" R=0 B=0 Y=0
|
||||
R=$((RANDOM % max + 1))
|
||||
B=$((RANDOM % max + 1))
|
||||
Y=$((RANDOM % max + 1))
|
||||
while [ "$B" = "$R" ] || [ "$B" = "$Y" ]; do
|
||||
B=$((RANDOM % max + 1))
|
||||
done
|
||||
while [ "$Y" = "$R" ] || [ "$Y" = "$B" ]; do
|
||||
Y=$((RANDOM % max + 1))
|
||||
done
|
||||
_RET="$R $B $Y"
|
||||
}
|
||||
|
||||
red_color=196
|
||||
yellow_color=226
|
||||
blue_color=57
|
||||
|
@ -62,7 +76,8 @@ else
|
|||
fi
|
||||
|
||||
# Choose 1 red, 1 yellow, 1 blue
|
||||
nums=$(rand -N 3 -M $TOTAL_SPLITS -u)
|
||||
get_random_numbers "$TOTAL_SPLITS"
|
||||
nums="$_RET"
|
||||
red=$((RANDOM % TOTAL_SPLITS + 4))
|
||||
while [ $red -ge $TOTAL_SPLITS ]; do
|
||||
red=$((RANDOM % TOTAL_SPLITS + 4))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue