From 613dd4be034799ae6b647e790254d57b77c11678 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 21 Apr 2013 11:09:27 -0500 Subject: [PATCH] * usr/bin/byobu-janitor, usr/share/byobu/keybindings/Makefile.am, usr/share/byobu/keybindings/tmux-screen-keys.conf, usr/share/byobu/profiles/tmux, usr/share/byobu/profiles/tmuxrc: - fix a number of warnings/errors when launching Byobu on Mac OS X - ship a copy of screen-keys.conf, snapshot from tmux + unfortunately, this gets installed (or doesn't) in various different places by version of Linux/UNIX - touch a couple of byobu/tmux configuration files that should exist + otherwise, tmux 1.8 shows errors on launch - deprecate a couple of tmux configuration options that have gone away with tmux 1.7+ + note that this might (?) annoy users of byobu from source or PPAs running the backports in PPAs or building from source --- debian/changelog | 13 +++ usr/bin/byobu-janitor | 2 + usr/share/byobu/keybindings/Makefile.am | 2 +- .../byobu/keybindings/tmux-screen-keys.conf | 103 ++++++++++++++++++ usr/share/byobu/profiles/tmux | 14 ++- usr/share/byobu/profiles/tmuxrc | 2 +- 6 files changed, 128 insertions(+), 8 deletions(-) create mode 100644 usr/share/byobu/keybindings/tmux-screen-keys.conf diff --git a/debian/changelog b/debian/changelog index b4554bf7..1a858007 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,19 @@ byobu (5.37) unreleased; urgency=low * usr/lib/byobu/distro: - must escape whitespace + * usr/bin/byobu-janitor, usr/share/byobu/keybindings/Makefile.am, + usr/share/byobu/keybindings/tmux-screen-keys.conf, + usr/share/byobu/profiles/tmux, usr/share/byobu/profiles/tmuxrc: + - fix a number of warnings/errors when launching Byobu on Mac OS X + - ship a copy of screen-keys.conf, snapshot from tmux + + unfortunately, this gets installed (or doesn't) in various different + places by version of Linux/UNIX + - touch a couple of byobu/tmux configuration files that should exist + + otherwise, tmux 1.8 shows errors on launch + - deprecate a couple of tmux configuration options that have gone + away with tmux 1.7+ + + note that this might (?) annoy users of byobu from source or PPAs + running the backports in PPAs or building from source -- Dustin Kirkland Tue, 09 Apr 2013 12:10:29 -0500 diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 79121c72..331d3df8 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -67,9 +67,11 @@ MC=0 # Seed the configuration # Setup initial local user configuration [ -r "$BYOBU_CONFIG_DIR/color" ] || printf "BACKGROUND=k\nFOREGROUND=w\nMONOCHROME=$MC" > "$BYOBU_CONFIG_DIR/color" +[ -r "$BYOBU_CONFIG_DIR/color.tmux" ] || printf "BYOBU_DARK=grey\nBYOBU_LIGHT=white\nBYOBU_ACCENT=magenta\nBYOBU_HIGHLIGHT=red\nMONOCHROME=$MC" > "$BYOBU_CONFIG_DIR/color.tmux" [ -r "$BYOBU_CONFIG_DIR/profile" ] || echo "source \$BYOBU_PREFIX/share/$PKG/profiles/common" > "$BYOBU_CONFIG_DIR/profile" [ -r "$BYOBU_CONFIG_DIR/profile.tmux" ] || echo "source \$BYOBU_PREFIX/share/$PKG/profiles/tmux" > "$BYOBU_CONFIG_DIR/profile.tmux" [ -r "$BYOBU_CONFIG_DIR/keybindings" ] || echo "source \$BYOBU_PREFIX/share/$PKG/keybindings/common" > "$BYOBU_CONFIG_DIR/keybindings" +[ -r "$BYOBU_CONFIG_DIR/keybindings.tmux" ] || touch "$BYOBU_CONFIG_DIR/keybindings.tmux" [ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows" [ -r "$BYOBU_CONFIG_DIR/backend" ] || echo "BYOBU_BACKEND=$BYOBU_BACKEND" > "$BYOBU_CONFIG_DIR/backend" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" diff --git a/usr/share/byobu/keybindings/Makefile.am b/usr/share/byobu/keybindings/Makefile.am index 444d77f1..fcd65eee 100644 --- a/usr/share/byobu/keybindings/Makefile.am +++ b/usr/share/byobu/keybindings/Makefile.am @@ -1,2 +1,2 @@ keybindingsdir = $(datadir)/@PACKAGE@/keybindings -keybindings_DATA = common f-keys f-keys.screen f-keys.screen.disable f-keys.tmux f-keys.tmux.disable none +keybindings_DATA = common f-keys f-keys.screen f-keys.screen.disable f-keys.tmux f-keys.tmux.disable none tmux-screen-keys.conf diff --git a/usr/share/byobu/keybindings/tmux-screen-keys.conf b/usr/share/byobu/keybindings/tmux-screen-keys.conf new file mode 100644 index 00000000..b9d55cef --- /dev/null +++ b/usr/share/byobu/keybindings/tmux-screen-keys.conf @@ -0,0 +1,103 @@ +# tmux-screen-keys.conf +# +# By Nicholas Marriott. Public domain. +# Updated by Dustin Kirkland. +# +# This configuration file binds many of the common GNU screen key bindings to +# appropriate tmux key bindings. Note that for some key bindings there is no +# tmux analogue and also that this set omits binding some commands available in +# tmux but not in screen. +# +# Note this is only a selection of key bindings and they are in addition to the +# normal tmux key bindings. This is intended as an example not as to be used +# as-is. + +# Set the prefix to ^A. +unbind C-b +set -g prefix ^A +bind a send-prefix + +# Bind appropriate commands similar to screen. +# lockscreen ^X x +unbind ^X +bind ^X lock-server +unbind x +bind x lock-server + +# screen ^C c +unbind ^C +bind ^C new-window +unbind c +bind c new-window + +# detach ^D d +unbind ^D +bind ^D detach + +# displays * +unbind * +bind * list-clients + +# next ^@ ^N sp n +unbind ^@ +bind ^@ next-window +unbind ^N +bind ^N next-window +unbind " " +bind " " next-window +unbind n +bind n next-window + +# title A +unbind A +bind A command-prompt "rename-window %%" + +# other ^A +unbind ^A +bind ^A last-window + +# prev ^H ^P p ^? +unbind ^H +bind ^H previous-window +unbind ^P +bind ^P previous-window +unbind p +bind p previous-window +unbind BSpace +bind BSpace previous-window + +# windows ^W w +unbind ^W +bind ^W list-windows +unbind w +bind w list-windows + +# quit \ +unbind '\' +bind '\' confirm-before "kill-server" + +# kill K k +unbind K +bind K confirm-before "kill-window" +unbind k +bind k confirm-before "kill-window" + +# redisplay ^L l +unbind ^L +bind ^L refresh-client +unbind l +bind l refresh-client + +# split -v | +unbind | +bind | split-window + +# :kB: focus up +unbind Tab +bind Tab select-pane -t:.+ +unbind BTab +bind BTab select-pane -t:.- + +# " windowlist -b +unbind '"' +bind '"' choose-window diff --git a/usr/share/byobu/profiles/tmux b/usr/share/byobu/profiles/tmux index 11e2c4fd..4b91c913 100644 --- a/usr/share/byobu/profiles/tmux +++ b/usr/share/byobu/profiles/tmux @@ -26,12 +26,14 @@ new-window -d byobu-janitor set -s escape-time 0 # Change to Screen's ctrl-a escape sequence -source /usr/share/doc/tmux/examples/screen-keys.conf +source /usr/share/byobu/keybindings/tmux-screen-keys.conf # On Archlinux, this file is not under the same directory source /usr/share/tmux/screen-keys.conf -# Add F12 to the prefix list -set -g prefix ^A,F12 +# Add ^A, F12 to the prefix list +set -g prefix ^A +# Note, prefix2 only available in tmux 1.6+ +set -g prefix2 F12 # Byobu's Keybindings source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.tmux @@ -57,9 +59,9 @@ set-window-option -g window-status-fg $BYOBU_LIGHT set-window-option -g window-status-current-attr reverse set-window-option -g window-status-current-bg $BYOBU_DARK set-window-option -g window-status-current-fg $BYOBU_LIGHT -set-window-option -g window-status-alert-bg $BYOBU_DARK -set-window-option -g window-status-alert-fg $BYOBU_LIGHT -set-window-option -g window-status-alert-attr bold +#set-window-option -g window-status-alert-bg $BYOBU_DARK +#set-window-option -g window-status-alert-fg $BYOBU_LIGHT +#set-window-option -g window-status-alert-attr bold set-window-option -g window-status-activity-bg $BYOBU_DARK set-window-option -g window-status-activity-fg $BYOBU_LIGHT set-window-option -g window-status-activity-attr bold diff --git a/usr/share/byobu/profiles/tmuxrc b/usr/share/byobu/profiles/tmuxrc index a4acfca8..c655c6f5 100644 --- a/usr/share/byobu/profiles/tmuxrc +++ b/usr/share/byobu/profiles/tmuxrc @@ -25,4 +25,4 @@ source-file $HOME/.byobu/color.tmux source-file $BYOBU_CONFIG_DIR/profile.tmux source-file $BYOBU_CONFIG_DIR/keybindings.tmux -source-file $HOME/.byoburc.tmux +source-file $BYOBU_CONFIG_DIR/.tmux.conf