diff --git a/debian/changelog b/debian/changelog index 6291c2a0..02d538c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,12 @@ byobu (5.59) unreleased; urgency=low - allow disable of utf8 prompt via BYOBU_CHARMAP variable * usr/lib/byobu/logo: - support Unicode logo for CentOS + * usr/bin/byobu-status, usr/lib/byobu/include/constants, + usr/lib/byobu/include/icons, usr/lib/byobu/include/Makefile.am, + usr/lib/byobu/include/toggle-utf8, usr/share/byobu/keybindings/f- + keys.tmux, usr/share/byobu/keybindings/f-keys.tmux.disable, + usr/share/doc/byobu/help.tmux.txt: + - add a new keybiding, Alt-F5, to toggle UTF-8 on and off -- Dustin Kirkland Thu, 12 Sep 2013 10:53:27 -0500 diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index fec75172..6efa2362 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -34,6 +34,7 @@ PKG="byobu" for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/status/statusrc" "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc" "$BYOBU_CONFIG_DIR/color" "$BYOBU_CONFIG_DIR/color.tmux"; do [ -r "$i" ] && . "$i" done +. "${BYOBU_PREFIX}/lib/${PKG}/include/icons" case "$BYOBU_BACKEND" in screen) diff --git a/usr/lib/byobu/include/Makefile.am b/usr/lib/byobu/include/Makefile.am index 6e9dcd72..5b3beedb 100644 --- a/usr/lib/byobu/include/Makefile.am +++ b/usr/lib/byobu/include/Makefile.am @@ -1,2 +1,2 @@ inclibdirdir = $(prefix)/lib/@PACKAGE@/include -inclibdir_SCRIPTS = common constants cycle-status dirs mondrian notify_osd shutil ec2instancespricing.py tmux-detach-all-but-current-client +inclibdir_SCRIPTS = common constants cycle-status dirs icons mondrian notify_osd shutil ec2instancespricing.py tmux-detach-all-but-current-client toggle-utf8 diff --git a/usr/lib/byobu/include/constants b/usr/lib/byobu/include/constants index 33b4fadd..87e5bdc5 100755 --- a/usr/lib/byobu/include/constants +++ b/usr/lib/byobu/include/constants @@ -20,59 +20,8 @@ PKG="byobu" -# UTF-8 support in the hardstatus is coming one day in Screen -if [ "$BYOBU_BACKEND" = "tmux" ] && [ "$BYOBU_CHARMAP" = "UTF-8" ]; then - #ICON_C="℃" - #ICON_F="℉" - ICON_C="C" - ICON_F="F" - ICON_RD="◂" - ICON_WR="▸" - ICON_MAIL="⍌" - ICON_UP="▴" - ICON_DN="▾" - ICON_TRASH="♸" - ICON_WIFI= - ICON_REBOOT="⟳" - ICON_UPDATES="!" - ICON_SECURITY="‼" - #ICON_KB="㎅" - #ICON_MB="㎆" - #ICON_GB="㎇" - ICON_KB="K" - ICON_MB="M" - ICON_GB="G" - ICON_TB="T" - #ICON_KHz="㎑" - #ICON_MHz="㎒" - #ICON_GHz="㎓" - ICON_KHz="KHz" - ICON_MHz="MHz" - ICON_GHz="GHz" - #ICON_MBPS="㏔㎰" - ICON_MBPS="Mb" -else - ICON_C="C" - ICON_F="F" - ICON_RD="<" - ICON_WR=">" - ICON_MAIL="[M]" - ICON_UP="^" - ICON_DN="v" - ICON_TRASH="T" - ICON_WIFI= - ICON_REBOOT="(R)" - ICON_UPDATES="!" - ICON_SECURITY="!!" - ICON_KB="KB" - ICON_MB="MB" - ICON_GB="GB" - ICON_TB="TB" - ICON_KHz="kHz" - ICON_MHz="MHz" - ICON_GHz="GHz" - ICON_MBPS="Mbps" -fi +. "${BYOBU_PREFIX}/lib/${PKG}/include/icons" + PCT="%" # Support two different backends (screen/tmux) diff --git a/usr/lib/byobu/include/icons b/usr/lib/byobu/include/icons new file mode 100755 index 00000000..c9dcb106 --- /dev/null +++ b/usr/lib/byobu/include/icons @@ -0,0 +1,75 @@ +#!/bin/sh +# +# icons: some icon characters for status scripts +# +# Copyright (C) 2011-2013 Dustin Kirkland +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PKG="byobu" + +# UTF-8 support in the hardstatus is coming one day in Screen +if [ "$BYOBU_BACKEND" = "tmux" ] && [ "$BYOBU_CHARMAP" = "UTF-8" ]; then + #ICON_C="℃" + #ICON_F="℉" + ICON_C="C" + ICON_F="F" + ICON_RD="◂" + ICON_WR="▸" + ICON_MAIL="⍌" + ICON_UP="▴" + ICON_DN="▾" + ICON_TRASH="♸" + ICON_WIFI= + ICON_REBOOT="⟳" + ICON_UPDATES="!" + ICON_SECURITY="‼" + #ICON_KB="㎅" + #ICON_MB="㎆" + #ICON_GB="㎇" + ICON_KB="K" + ICON_MB="M" + ICON_GB="G" + ICON_TB="T" + #ICON_KHz="㎑" + #ICON_MHz="㎒" + #ICON_GHz="㎓" + ICON_KHz="KHz" + ICON_MHz="MHz" + ICON_GHz="GHz" + #ICON_MBPS="㏔㎰" + ICON_MBPS="Mb" +else + ICON_C="C" + ICON_F="F" + ICON_RD="<" + ICON_WR=">" + ICON_MAIL="[M]" + ICON_UP="^" + ICON_DN="v" + ICON_TRASH="T" + ICON_WIFI= + ICON_REBOOT="(R)" + ICON_UPDATES="!" + ICON_SECURITY="!!" + ICON_KB="KB" + ICON_MB="MB" + ICON_GB="GB" + ICON_TB="TB" + ICON_KHz="kHz" + ICON_MHz="MHz" + ICON_GHz="GHz" + ICON_MBPS="Mbps" +fi diff --git a/usr/lib/byobu/include/toggle-utf8 b/usr/lib/byobu/include/toggle-utf8 new file mode 100755 index 00000000..84fcf500 --- /dev/null +++ b/usr/lib/byobu/include/toggle-utf8 @@ -0,0 +1,45 @@ +#!/bin/sh -e +# +# toggle-utf8 +# Copyright (C) 2013 Dustin Kirkland +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PKG="byobu" +[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/include/common" +[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc" + +if [ "$BYOBU_CHARMAP" = "UTF-8" ]; then + if grep -qs "^BYOBU_CHARMAP=" $BYOBU_CONFIG_DIR/statusrc 2>/dev/null; then + sed -i -e "s/^BYOBU_CHARMAP=.*/BYOBU_CHARMAP=x/" $BYOBU_CONFIG_DIR/statusrc + else + echo "BYOBU_CHARMAP=x" >> $BYOBU_CONFIG_DIR/statusrc + fi + export BYOBU_CHARMAP=x +else + if grep -qs "^BYOBU_CHARMAP=" $BYOBU_CONFIG_DIR/statusrc 2>/dev/null; then + sed -i -e "s/^BYOBU_CHARMAP=.*/BYOBU_CHARMAP=UTF-8/" $BYOBU_CONFIG_DIR/statusrc + else + echo "BYOBU_CHARMAP=UTF-8" >> $BYOBU_CONFIG_DIR/statusrc + fi + export BYOBU_CHARMAP=UTF-8 +fi +if [ -n "$TMUX" ]; then + tmux send-keys " export BYOBU_CHARMAP=$BYOBU_CHARMAP ; . ~/.bashrc" \; send-keys Enter +fi + +# vi: syntax=sh ts=4 noexpandtab diff --git a/usr/share/byobu/keybindings/f-keys.tmux b/usr/share/byobu/keybindings/f-keys.tmux index ace04163..cb55eda4 100644 --- a/usr/share/byobu/keybindings/f-keys.tmux +++ b/usr/share/byobu/keybindings/f-keys.tmux @@ -53,7 +53,7 @@ bind-key -n M-S-Down resize-pane -D bind-key -n M-S-Left resize-pane -L bind-key -n M-S-Right resize-pane -R bind-key -n F5 source $BYOBU_PREFIX/share/byobu/profiles/tmuxrc -#bind-key -n F5 source "$BYOBU_PREFIX/share/byobu/profiles/tmuxrc" \; run-shell "$BYOBU_PREFIX/lib/byobu/include/tmux-detach-all-but-current-client" +bind-key -n M-F5 run-shell '$BYOBU_PREFIX/lib/byobu/include/toggle-utf8' \; source $BYOBU_PREFIX/share/byobu/profiles/tmuxrc bind-key -n S-F5 new-window -k "$BYOBU_PREFIX/lib/byobu/include/cycle-status" \; source $BYOBU_PREFIX/share/byobu/profiles/tmuxrc bind-key -n C-F5 send-keys ". $BYOBU_PREFIX/bin/byobu-reconnect-sockets" \; send-keys Enter bind-key -n C-S-F5 new-window -d "byobu-select-profile -r" diff --git a/usr/share/byobu/keybindings/f-keys.tmux.disable b/usr/share/byobu/keybindings/f-keys.tmux.disable index 5920fb3f..f71b0463 100644 --- a/usr/share/byobu/keybindings/f-keys.tmux.disable +++ b/usr/share/byobu/keybindings/f-keys.tmux.disable @@ -54,6 +54,7 @@ unbind-key -n S-M-Down unbind-key -n S-M-Left unbind-key -n S-M-Right unbind-key -n F5 +unbind-key -n M-F5 unbind-key -n S-F5 unbind-key -n C-F5 unbind-key -n C-S-F5 diff --git a/usr/share/doc/byobu/help.tmux.txt b/usr/share/doc/byobu/help.tmux.txt index 0a8b2aa6..483e1a38 100644 --- a/usr/share/doc/byobu/help.tmux.txt +++ b/usr/share/doc/byobu/help.tmux.txt @@ -17,6 +17,7 @@ and some convenient keybindings: Ctrl-Shift-F3/F4 Move a window Shift-Alt-Left/Right/Up/Down Resize a split F5 Reload profile, refresh status + Alt-F5 Toggle UTF-8 support, refresh status Shift-F5 Toggle through status lines Ctrl-F5 Reconnect ssh/gpg/dbus sockets Ctrl-Shift-F5 Change status bar's color randomly