From a7a529c27394ae0e7450d7b77bfda8eec08c3681 Mon Sep 17 00:00:00 2001 From: Nick Barcet Date: Mon, 15 Dec 2008 18:20:43 +0100 Subject: [PATCH 1/3] Allow local modification of .screenrc (LP: #308216) --- base-screenrc | 5 +++++ debian/changelog | 5 ++++- debian/install | 1 + select-screen-profile | 20 +++++++++++++++----- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 base-screenrc diff --git a/base-screenrc b/base-screenrc new file mode 100644 index 00000000..45439a82 --- /dev/null +++ b/base-screenrc @@ -0,0 +1,5 @@ +# This is a base .screenrc file created by the screen-profiles package +# The following line sources the currently selected profile +source ~/.screenrc-profile + +# Add your personalisation of screen below this line diff --git a/debian/changelog b/debian/changelog index 398c1deb..ae80fcf9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,8 @@ screen-profiles (1.0) jaunty; urgency=low - + [ Dustin Kirklan ] * Initial upload + [ Nicolas Barcet ] + * Allow local modification of .screenrc (LP: #308216) + -- Dustin Kirkland Sun, 14 Dec 2008 13:12:12 -0600 diff --git a/debian/install b/debian/install index e66b48d6..60c64051 100644 --- a/debian/install +++ b/debian/install @@ -5,3 +5,4 @@ bin/updates-available usr/share/screen-profiles/bin profiles/debian.screenrc usr/share/screen-profiles/profiles profiles/ubuntu.screenrc usr/share/screen-profiles/profiles select-screen-profile usr/bin +base-screenrc usr/share/screen-profiles diff --git a/select-screen-profile b/select-screen-profile index 28676b5b..4bc0a7aa 100755 --- a/select-screen-profile +++ b/select-screen-profile @@ -1,10 +1,11 @@ #!/bin/sh -PROFILE_DIR="/usr/share/screen-profiles/profiles" +BASE_DIR="/usr/share/screen-profiles" +PROFILE_DIR="$BASE_DIR/profiles" -if [ -e "$HOME/.screenrc" ]; then - if [ ! -L "$HOME/.screenrc" ]; then - echo `gettext 'Error:'` $HOME/.screenrc `gettext 'exists, but is not a symlink'` +if [ -e "$HOME/.screenrc-profile" ]; then + if [ ! -L "$HOME/.screenrc-profile" ]; then + echo `gettext 'Error:'` $HOME/.screenrc-profile `gettext 'exists, but is not a symlink'` exit 1 fi fi @@ -40,7 +41,16 @@ i=0 for x in $profiles; do i=`expr $i + 1` if [ $i -eq $selected ]; then - rm -f "$HOME/.screenrc" && ln -s "$PROFILE_DIR/$x" "$HOME/.screenrc" + # avoid overriding a user's existing .screenrc + if [ ! -e "$HOME/.screenrc" ]; then + cp "$BASE_DIR/base-screenrc" "$HOME/.screenrc" && \ + chown "$USER" "$HOME/.screenrc" + else + echo "You already have a ~/.screenrc file. Make sure that it contains" + echo "a line with 'source ~/.screenrc-profile' to make use of you new" + echo "profile." + fi + rm -f "$HOME/.screenrc-profile" && ln -s "$PROFILE_DIR/$x" "$HOME/.screenrc-profile" fi done From 8f38707e4b0b4bbe2b8c13e22a991a5f57029124 Mon Sep 17 00:00:00 2001 From: Nick Barcet Date: Mon, 15 Dec 2008 18:42:00 +0100 Subject: [PATCH 2/3] * Add some nice defaults to ubuntu.screenrc * Propose some additions in base-screenrc --- base-screenrc | 20 +++++++++++++++++++- debian/changelog | 2 ++ profiles/ubuntu.screenrc | 9 +++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/base-screenrc b/base-screenrc index 45439a82..fccb206c 100644 --- a/base-screenrc +++ b/base-screenrc @@ -2,4 +2,22 @@ # The following line sources the currently selected profile source ~/.screenrc-profile -# Add your personalisation of screen below this line +# Add your personalisation of screen below this line, some proposal are +# commented out + +# if activity is detected on an affected window switched into the background +# you will receive the activity notification message in the status line +# the window will also be marked with an ‘@’ in the window-status display +#defmonitor on + +# When any activity occurs in a background window that is being monitored +# screen displays a notification in the message line +#activity "activity -> %n%f %t" # window number , flags of the window , window title + +# Start screen +#screen -t motd watch -n 30 cat /etc/motd +#screen -t local 0 + +#Escape as control-W +#escape ^Ww + diff --git a/debian/changelog b/debian/changelog index ae80fcf9..9e9d2990 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,5 +4,7 @@ screen-profiles (1.0) jaunty; urgency=low [ Nicolas Barcet ] * Allow local modification of .screenrc (LP: #308216) + * Add some nice defaults to ubuntu.screenrc + * Propose some additions in base-screenrc -- Dustin Kirkland Sun, 14 Dec 2008 13:12:12 -0600 diff --git a/profiles/ubuntu.screenrc b/profiles/ubuntu.screenrc index 9b12e84a..3974a5c5 100644 --- a/profiles/ubuntu.screenrc +++ b/profiles/ubuntu.screenrc @@ -31,4 +31,13 @@ hardstatus alwayslastline caption always '%{= Wk}%{= Wk}%?%-Lw%?%{= yk}%n %t%{= Wk} %?%+Lw%?%?%= %{= Wk}' hardstatus string '%{= wk} %{+b r}\%{= y}o%{=b Y}/%{+b wk} %100` %{= Wk}|%= |%{+B bW}%102`%{= Wk}|%{+b rW}%101`%{= Wk}|%{+b gW}%103`%{= Wk}|%{= wb}%Y-%m-%d %c:%s%{k}' +# Allow scrolling in xterm +termcapinfo xterm ti@:te@ + # 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 + From dbd45d9fbbd275c0c5b1542512c87317d9f761d1 Mon Sep 17 00:00:00 2001 From: Nick Barcet Date: Mon, 15 Dec 2008 18:49:20 +0100 Subject: [PATCH 3/3] fix changelog formating errors --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9e9d2990..e9029b61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ screen-profiles (1.0) jaunty; urgency=low - [ Dustin Kirklan ] + [ Dustin Kirklan ] * Initial upload - [ Nicolas Barcet ] + [ Nicolas Barcet ] * Allow local modification of .screenrc (LP: #308216) * Add some nice defaults to ubuntu.screenrc * Propose some additions in base-screenrc