mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
* usr/bin/byobu-ctrl-a, usr/bin/byobu-janitor, usr/bin/byobu-quiet,
usr/bin/byobu-silent, usr/bin/byobu-status, usr/lib/byobu/cpu_temp, usr/lib/byobu/custom, usr/lib/byobu/ec2_cost, usr/lib/byobu/logo, usr/lib/byobu/menu, usr/lib/byobu/network, usr/lib/byobu/updates_available, usr/share/byobu/keybindings/f-keys: - comprehensively use $SED for MacOSX compatibility, LP: #812973
This commit is contained in:
parent
ed4a118ca3
commit
2bf22d7fbf
14 changed files with 21 additions and 15 deletions
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -88,6 +88,12 @@ byobu (4.18) unreleased; urgency=low
|
||||||
* usr/bin/byobu-janitor, usr/bin/byobu-launcher-uninstall,
|
* usr/bin/byobu-janitor, usr/bin/byobu-launcher-uninstall,
|
||||||
usr/lib/byobu/.constants, usr/lib/byobu/disk_io:
|
usr/lib/byobu/.constants, usr/lib/byobu/disk_io:
|
||||||
- move the MacOSX support to constants
|
- move the MacOSX support to constants
|
||||||
|
* usr/bin/byobu-ctrl-a, usr/bin/byobu-janitor, usr/bin/byobu-quiet,
|
||||||
|
usr/bin/byobu-silent, usr/bin/byobu-status, usr/lib/byobu/cpu_temp,
|
||||||
|
usr/lib/byobu/custom, usr/lib/byobu/ec2_cost, usr/lib/byobu/logo,
|
||||||
|
usr/lib/byobu/menu, usr/lib/byobu/network,
|
||||||
|
usr/lib/byobu/updates_available, usr/share/byobu/keybindings/f-keys:
|
||||||
|
- comprehensively use $SED for MacOSX compatibility, LP: #812973
|
||||||
|
|
||||||
[ James Spencer ]
|
[ James Spencer ]
|
||||||
* usr/lib/byobu/.constants:
|
* usr/lib/byobu/.constants:
|
||||||
|
|
|
@ -42,13 +42,13 @@ while true; do
|
||||||
echo
|
echo
|
||||||
case "$s" in
|
case "$s" in
|
||||||
1)
|
1)
|
||||||
sed -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
|
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
|
||||||
echo 'bindkey "^A"' >> "$keybindings"
|
echo 'bindkey "^A"' >> "$keybindings"
|
||||||
echo "INFO: ctrl-a will now operate in emacs mode"
|
echo "INFO: ctrl-a will now operate in emacs mode"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
sed -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
|
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
|
||||||
echo 'escape "^Aa"' >> "$keybindings"
|
echo 'escape "^Aa"' >> "$keybindings"
|
||||||
echo 'register x "^A"' >> "$keybindings"
|
echo 'register x "^A"' >> "$keybindings"
|
||||||
echo 'bindkey "^A"' >> "$keybindings"
|
echo 'bindkey "^A"' >> "$keybindings"
|
||||||
|
|
|
@ -100,7 +100,7 @@ if [ ! -r "$BYOBU_CONFIG_DIR/status" ]; then
|
||||||
fi
|
fi
|
||||||
grep -A 999999 BEGIN_CUT_HERE $skel | grep -B 999999 END_CUT_HERE | grep -v CUT > "$BYOBU_CONFIG_DIR/status"
|
grep -A 999999 BEGIN_CUT_HERE $skel | grep -B 999999 END_CUT_HERE | grep -v CUT > "$BYOBU_CONFIG_DIR/status"
|
||||||
# If it looks like we're running in ec2, enable ec2_cost by default
|
# If it looks like we're running in ec2, enable ec2_cost by default
|
||||||
[ -x /usr/sbin/update-grub-legacy-ec2 ] && sed -i "s/ec2_cost=.*/ec2_cost=1/" "$BYOBU_CONFIG_DIR/status"
|
[ -x /usr/sbin/update-grub-legacy-ec2 ] && $SED -i "s/ec2_cost=.*/ec2_cost=1/" "$BYOBU_CONFIG_DIR/status"
|
||||||
fi
|
fi
|
||||||
[ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows"
|
[ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows"
|
||||||
[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc"
|
[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc"
|
||||||
|
|
|
@ -24,7 +24,7 @@ PKG="byobu"
|
||||||
FLAG="$BYOBU_CONFIG_DIR/status.disable"
|
FLAG="$BYOBU_CONFIG_DIR/status.disable"
|
||||||
|
|
||||||
# Clean up environment
|
# Clean up environment
|
||||||
sed -i "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true
|
$SED -i "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true
|
||||||
if [ "$1" = "--undo" ]; then
|
if [ "$1" = "--undo" ]; then
|
||||||
rm -f "$FLAG"
|
rm -f "$FLAG"
|
||||||
else
|
else
|
||||||
|
|
|
@ -24,7 +24,7 @@ PKG="byobu"
|
||||||
FLAG="$BYOBU_CONFIG_DIR/status.disable"
|
FLAG="$BYOBU_CONFIG_DIR/status.disable"
|
||||||
|
|
||||||
# Clean up environment
|
# Clean up environment
|
||||||
sed -i "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true
|
$SED -i "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true
|
||||||
if [ "$1" = "--undo" ]; then
|
if [ "$1" = "--undo" ]; then
|
||||||
rm -f "$FLAG"
|
rm -f "$FLAG"
|
||||||
else
|
else
|
||||||
|
|
|
@ -66,8 +66,8 @@ case "$P" in
|
||||||
menu|notify_osd|time_binary) continue ;;
|
menu|notify_osd|time_binary) continue ;;
|
||||||
esac
|
esac
|
||||||
find_script "$i" && . "${_RET}"
|
find_script "$i" && . "${_RET}"
|
||||||
short=$(eval "__${i}" | sed -e 's/^\s*//' -e 's/\s*$//' -e 's/.{[^}]*}//g')
|
short=$(eval "__${i}" | $SED -e 's/^\s*//' -e 's/\s*$//' -e 's/.{[^}]*}//g')
|
||||||
detail=$(eval "__${i}_detail" 2>/dev/null | sed -e '/^$/d' -e 's/^/\t/g')
|
detail=$(eval "__${i}_detail" 2>/dev/null | $SED -e '/^$/d' -e 's/^/\t/g')
|
||||||
printf "%s\n\t(%s)\n" "$short" "$i"
|
printf "%s\n\t(%s)\n" "$short" "$i"
|
||||||
[ -n "$detail" ] && printf "%s\n" "$detail"
|
[ -n "$detail" ] && printf "%s\n" "$detail"
|
||||||
done
|
done
|
||||||
|
|
|
@ -36,7 +36,7 @@ __cpu_temp() {
|
||||||
[ -s "$i" ] && read t < "$i" && t=$(($t/1000))
|
[ -s "$i" ] && read t < "$i" && t=$(($t/1000))
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
[ -s "$i" ] && t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
|
[ -s "$i" ] && t=$($SED -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ -n "$t" ] && [ "$t" -gt 0 ]; then
|
if [ -n "$t" ] && [ "$t" -gt 0 ]; then
|
||||||
|
|
|
@ -53,7 +53,7 @@ __custom() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
echo -n "$output" | sed ':a;N;$!ba;s/\n//g'
|
echo -n "$output" | $SED ':a;N;$!ba;s/\n//g'
|
||||||
}
|
}
|
||||||
|
|
||||||
# vi: syntax=sh ts=4 noexpandtab
|
# vi: syntax=sh ts=4 noexpandtab
|
||||||
|
|
|
@ -37,7 +37,7 @@ __ec2_cost() {
|
||||||
if metadata_available; then
|
if metadata_available; then
|
||||||
zone=$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone)
|
zone=$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone)
|
||||||
. "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}"
|
. "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}"
|
||||||
type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | sed -e "s/\./_/g")
|
type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | $SED -e "s/\./_/g")
|
||||||
eval rate="\$$type"
|
eval rate="\$$type"
|
||||||
file_to_stat="$BYOBU_RUN_DIR/ec2_cost.instance_type"
|
file_to_stat="$BYOBU_RUN_DIR/ec2_cost.instance_type"
|
||||||
[ -f "$file_to_stat" ] || wget -q -O "$file_to_stat" http://169.254.169.254/latest/meta-data/instance-type
|
[ -f "$file_to_stat" ] || wget -q -O "$file_to_stat" http://169.254.169.254/latest/meta-data/instance-type
|
||||||
|
|
|
@ -50,7 +50,7 @@ __logo() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
get_distro
|
get_distro
|
||||||
local distro="$(echo "$_RET" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"
|
local distro="$(echo "$_RET" | $SED 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
*ubuntu*)
|
*ubuntu*)
|
||||||
if $MARKUP; then
|
if $MARKUP; then
|
||||||
|
|
|
@ -27,7 +27,7 @@ __menu() {
|
||||||
local bindings esc key text
|
local bindings esc key text
|
||||||
[ -r "$BYOBU_CONFIG_DIR/keybindings" ] && bindings="$BYOBU_CONFIG_DIR/keybindings" || bindings="$HOME/.screenrc"
|
[ -r "$BYOBU_CONFIG_DIR/keybindings" ] && bindings="$BYOBU_CONFIG_DIR/keybindings" || bindings="$HOME/.screenrc"
|
||||||
if grep -qs "^source.*screen-escape-keys$" $bindings 2>/dev/null || [ "$1" = "--disable-f-keys" ]; then
|
if grep -qs "^source.*screen-escape-keys$" $bindings 2>/dev/null || [ "$1" = "--disable-f-keys" ]; then
|
||||||
esc=`grep "^escape" $bindings | sed "s/^.*\(.\)$/\1/"`
|
esc=`grep "^escape" $bindings | $SED "s/^.*\(.\)$/\1/"`
|
||||||
[ -n "$esc" ] && key="^$esc-@" || key="^a-@"
|
[ -n "$esc" ] && key="^$esc-@" || key="^a-@"
|
||||||
elif grep -qs "^source.*none$" $bindings 2>/dev/null; then
|
elif grep -qs "^source.*none$" $bindings 2>/dev/null; then
|
||||||
key="byobu-config"
|
key="byobu-config"
|
||||||
|
|
|
@ -32,7 +32,7 @@ get_interface() {
|
||||||
|
|
||||||
__network_detail() {
|
__network_detail() {
|
||||||
get_interface; local interface="$_RET"
|
get_interface; local interface="$_RET"
|
||||||
LC_ALL=C /sbin/ifconfig "$interface" | sed 's/\s*$//'
|
LC_ALL=C /sbin/ifconfig "$interface" | $SED 's/\s*$//'
|
||||||
}
|
}
|
||||||
|
|
||||||
__network() {
|
__network() {
|
||||||
|
|
|
@ -98,7 +98,7 @@ __updates_available_detail() {
|
||||||
__updates_available() {
|
__updates_available() {
|
||||||
local mycache="$BYOBU_RUN_DIR/updates-available"
|
local mycache="$BYOBU_RUN_DIR/updates-available"
|
||||||
# If mycache is present, use it
|
# If mycache is present, use it
|
||||||
[ -r $mycache ] && ___print_updates `sed -n '/[^0-9]/s/ .*$//p' $mycache`
|
[ -r $mycache ] && ___print_updates `$SED -n '/[^0-9]/s/ .*$//p' $mycache`
|
||||||
# If we really need to do so (mycache doesn't exist, or the package database has changed),
|
# If we really need to do so (mycache doesn't exist, or the package database has changed),
|
||||||
# background an update now
|
# background an update now
|
||||||
___update_needed "$mycache" && ___update_cache "$mycache"
|
___update_needed "$mycache" && ___update_cache "$mycache"
|
||||||
|
|
|
@ -44,7 +44,7 @@ bind $ $BYOBU_BACKEND -t status 0 byobu-status-detail # F12 $ | show detailed st
|
||||||
bind @ $BYOBU_BACKEND -t config 0 byobu-config # F12 @ | Configuration
|
bind @ $BYOBU_BACKEND -t config 0 byobu-config # F12 @ | Configuration
|
||||||
bind R process r # F12 R | Reload profile
|
bind R process r # F12 R | Reload profile
|
||||||
register s "[g G$>^h" # Goes with F12 ~ definition
|
register s "[g G$>^h" # Goes with F12 ~ definition
|
||||||
bind ~ eval 'process x' 'process s' 'exec sed -i -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window
|
bind ~ eval 'process x' 'process s' 'exec $SED -i -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window
|
||||||
|
|
||||||
# Hotkeys for splits (gnome-terminal)
|
# Hotkeys for splits (gnome-terminal)
|
||||||
bindkey "^[O1;2Q" eval 'split' 'focus down' 'next' 'focus up' 'layout save byobu' 'layout autosave' # shift-F2 | horizontal split
|
bindkey "^[O1;2Q" eval 'split' 'focus down' 'next' 'focus up' 'layout save byobu' 'layout autosave' # shift-F2 | horizontal split
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue