From 5ee3089853fd70191767c6ba13c096f398e46ada Mon Sep 17 00:00:00 2001 From: Nick Barcet Date: Thu, 18 Dec 2008 00:16:51 +0100 Subject: [PATCH] * Key binding framework basis * Added some sensible key bindings * First pot and translation to french --- debian/changelog | 3 +++ doc/help.txt | 45 +++++++++++++++++++----------------------- po/fr.po | 33 +++++++++++++++++++++++++++++++ po/screen-profiles.pot | 33 +++++++++++++++++++++++++++++++ profiles/common | 10 ---------- profiles/ubuntu.key | 24 ++++++++++++++++++++++ select-screen-profile | 20 +++++++++++++++++++ 7 files changed, 133 insertions(+), 35 deletions(-) create mode 100644 po/fr.po create mode 100644 po/screen-profiles.pot create mode 100644 profiles/ubuntu.key diff --git a/debian/changelog b/debian/changelog index 91b569a1..0bd5df0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,5 +10,8 @@ screen-profiles (1.0) UNRELEASED; urgency=low [ Nicolas Barcet ] * Allow local modification of .screenrc (LP: #308216) * Add some nice defaults to ubuntu.screenrc + * Key binding framework basis + * Added some sensible key bindings + * First pot and translation to french -- Dustin Kirkland Tue, 16 Dec 2008 15:31:47 -0600 diff --git a/doc/help.txt b/doc/help.txt index aa90f28a..08b4d0bf 100644 --- a/doc/help.txt +++ b/doc/help.txt @@ -1,29 +1,24 @@ - Screen key bindings, page 1 of 1. - Command key: ^A Literal ^A: a + ******************************************** + ** Welcome to the screen powered terminal ** + ******************************************** +The main benefits of the screen program is that your session can have +multiple windows and keep context between multiple logins. You will also +notice the task bar at the bottom that informs you of various system +status, update waiting to be applied and which window you are currently +running on. - break ^B b license , removebuf = - clear C lockscreen ^X x reset Z - colon : log H screen ^C c - copy ^[ [ login L select ' - detach ^D d meta a silence _ - digraph ^V monitor M split S - displays * next ^@ ^N sp n suspend ^Z z - dumptermcap . number N time ^T t - fit F only Q title A - flow ^F f other ^A vbell ^G - focus ^I pow_break B version v - hardcopy h pow_detach D width W - help ? prev ^H ^P p ^? windows ^W w - history { } quit \ wrap ^R r - info i readbuf < writebuf > - kill K k redisplay ^L l xoff ^S s - lastmsg ^M m remove X xon ^Q q +A complete help on the screen program can be obtained using the 'man screen' +command. Note that our implementation remaps the escape prefix to ctrl-G +instead of the standard ctrl-A. - paste . ^] windowlist " select - - - select 0 0 select 1 1 select 2 2 - select 3 3 select 4 4 select 5 5 - select 6 6 select 7 7 select 8 8 - select 9 9 login on I login off O - paste . ] split -v | focus up :kB: +Some usefull mappings (where C- means ctrl): +------------------------------------------------------------------- +shift-tab Goto next window | F1 Basic help (this) +C-pgup Goto previous window | F2 Advanced help +C-pgdown Goto next window | F4 Create new window +C-shift-del Detach and logout | F6 Close current window +------------------------------------------------------------------- +Note that these bindings have been tested for xterm type terminal such as +gnome-terminal, but may need some adjustments elsewhere. diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 00000000..135bf6ad --- /dev/null +++ b/po/fr.po @@ -0,0 +1,33 @@ +# GNU Screen Profiles +# Copyright (C) 2008 Dustin Kirkland +# This file is distributed under the same license as the GNU Screen Profiles package. +# Nicolas Barcet , 2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-12-17 23:42+0100\n" +"PO-Revision-Date: 2008-12-17 23:42+0100\n" +"Last-Translator: Nicolas Barcet \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: select-screen-profile:9 select-screen-profile:16 +msgid "Error:" +msgstr "Erreur:" + +#: select-screen-profile:9 select-screen-profile:16 +msgid "exists, but is not a symlink" +msgstr "existe, mais n'est pas un lien symbolique" + +#: select-screen-profile:30 +msgid "recommended" +msgstr "recommandé" + +#: select-screen-profile:41 select-screen-profile:43 +msgid "Choose" +msgstr "Choisir" diff --git a/po/screen-profiles.pot b/po/screen-profiles.pot new file mode 100644 index 00000000..75e751a0 --- /dev/null +++ b/po/screen-profiles.pot @@ -0,0 +1,33 @@ +# GNU Screen Profiles +# Copyright (C) 2008 Dustin Kirkland +# This file is distributed under the same license as the GNU Screen Profiles package. +# Nicolas Barcet , 2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-12-17 23:42+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: select-screen-profile.sh:9 select-screen-profile.sh:16 +msgid "Error:" +msgstr "" + +#: select-screen-profile.sh:9 select-screen-profile.sh:16 +msgid "exists, but is not a symlink" +msgstr "" + +#: select-screen-profile.sh:30 +msgid "recommended" +msgstr "" + +#: select-screen-profile.sh:41 select-screen-profile.sh:43 +msgid "Choose" +msgstr "" diff --git a/profiles/common b/profiles/common index 92a79410..50c18f7d 100644 --- a/profiles/common +++ b/profiles/common @@ -34,13 +34,3 @@ hardstatus alwayslastline termcapinfo xterm ti@:te@ defscrollback 10000 -# Keybindings -# Map shift-tab to go to next window -bindkey "\033[Z" next -# Ctrl+PgUp and Ctrl+PgDn to change windows -bindkey ^[[5;5~ prev -bindkey ^[[6;5~ next -# Prompt for window title on "ctrl-a c" -register n "^a^c ^aA" -bind c process n - diff --git a/profiles/ubuntu.key b/profiles/ubuntu.key new file mode 100644 index 00000000..31ea6088 --- /dev/null +++ b/profiles/ubuntu.key @@ -0,0 +1,24 @@ +# This file defines Key bindings +# bindkey commands should be followed by a comment that will be used in the +# help file (one day). The command should be formated as: +# | explanation + +escape ^Gg + +# Maps for next and previous windows +bindkey "\033[Z" next # Shift-tab | next window +bindkey ^[[6;5~ prev # Ctrl-pgup | previous window +bindkey ^[[5;5~ next # Ctrl-pgdn | next window + +# Maps to create and remove windows +register n "^g^c ^gA" +bindkey -k k4 process n # F4 | create new window +bindkey -k k6 kill # F6 | close window + +# Maps for help +bindkey -k k1 less /usr/share/doc/screen-profiles/help.txt # F1 | Basic help +bindkey -k k2 help # F2 | Advanced help + +# power detach +register x "^g^d D" +bindkey ^[[3;6~ process x # shift-ctrl-del | Detach and logout diff --git a/select-screen-profile b/select-screen-profile index 4c89fea8..f0295854 100755 --- a/select-screen-profile +++ b/select-screen-profile @@ -10,6 +10,13 @@ if [ -e "$HOME/.screenrc-profile" ]; then exit 1 fi fi +# Ensure that ~/.screenrc-key is a symbolic link +if [ -e "$HOME/.screenrc-key" ]; then + >---if [ ! -L "$HOME/.screenrc-key" ]; then + >--->---echo `gettext 'Error:'` $HOME/.screenrc-key `gettext 'exists, but is not a symlink'` + >--->---exit 1 + >---fi +fi # Prompt the user to choose among the available profiles echo @@ -46,6 +53,7 @@ for x in $profiles; do if [ ! -e "$HOME/.screenrc" ]; then # If the user doesn't have a .screenrc, seed one echo "source ~/.screenrc-profile" > "$HOME/.screenrc" + echo "source ~/.screenrc-key" >> "$HOME/.screenrc" else # If the user does have a .screenrc, see if it has the # source line @@ -57,9 +65,21 @@ for x in $profiles; do cat "$HOME/.screenrc" >> "$tmp" mv -f "$tmp" "$HOME/.screenrc" fi +>--->--->---# If the user does have a .screenrc, see if it has the second +>--->--->---# source line +>--->--->---if ! grep -qs "source $HOME/.screenrc-key" "$HOME/.screenrc"; then +>--->--->--->---# And if it's missing the source line, add it +>--->--->--->---# to the top +>--->--->--->---tmp=`mktemp "$HOME/.screenrc.XXXXXX"` +>--->--->--->---echo "source $HOME/.screenrc-key" > "$tmp" +>--->--->--->---cat "$HOME/.screenrc" >> "$tmp" +>--->--->--->---mv -f "$tmp" "$HOME/.screenrc" +>--->--->---fi fi rm -f "$HOME/.screenrc-profile" + rm -f "$HOME/.screenrc-key" ln -s "$PROFILE_DIR/$x" "$HOME/.screenrc-profile" + ln -s "$PROFILE_DIR/ubuntu.key" "$HOME/.screenrc-key" fi done