mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* debian/control, usr/bin/byobu-select-profile: LP: #1166416
- hardcode a use of gawk (for hex calculations)
This commit is contained in:
parent
e64cbe88cc
commit
13cd75ab38
3 changed files with 9 additions and 2 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -4,6 +4,8 @@ byobu (5.40) unreleased; urgency=low
|
|||
- use byobu's tmux-screen-keys.conf
|
||||
* debian/postinst: LP: #1174537
|
||||
- drop the env python changes in the postinst
|
||||
* debian/control, usr/bin/byobu-select-profile: LP: #1166416
|
||||
- hardcode a use of gawk (for hex calculations)
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 07 May 2013 22:01:40 -0500
|
||||
|
||||
|
|
3
debian/control
vendored
3
debian/control
vendored
|
@ -17,7 +17,8 @@ Depends:
|
|||
gettext-base,
|
||||
python,
|
||||
python-newt (>= 0.52.2-11),
|
||||
tmux (>= 1.5) | screen
|
||||
tmux (>= 1.5) | screen,
|
||||
gawk
|
||||
Recommends:
|
||||
screen,
|
||||
tmux (>= 1.5),
|
||||
|
|
|
@ -186,8 +186,12 @@ setcolor_screen() {
|
|||
|
||||
get_contrast() {
|
||||
# See section 2.2: http://www.w3.org/TR/AERT
|
||||
local awk="awk"
|
||||
if $BYOBU_TEST gawk >/dev/null 2>&1; then
|
||||
awk="gawk"
|
||||
fi
|
||||
local hex="$(echo "$1" | sed -e "s/\(..\)\(..\)\(..\)/\1 \2 \3/")"
|
||||
local bright=$(echo $hex | awk --non-decimal-data '{printf "%0.0f",(("0x"$1)*299+("0x"$2)*587+("0x"$3)*114)/1000}')
|
||||
local bright=$(echo $hex | $awk --non-decimal-data '{printf "%0.0f",(("0x"$1)*299+("0x"$2)*587+("0x"$3)*114)/1000}')
|
||||
if [ $bright -ge 130 ]; then
|
||||
_RET="black"
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue