* bin/updates-available, keybindings/common, profiles/common, screen,

screen-profiles, select-screen-profile, select-screen-profile.1: updated
    to collapse ~/.screenrc-* into ~/.screen-profiles/*, LP: #335275
  * screen: added a hack to move ~/.screenrc-* into ~/.screen-profiles/*;
    this hack should be removed after Jaunty GA (only affects upgrading
    Alpha users)
This commit is contained in:
Dustin Kirkland 2009-02-27 09:57:00 -06:00
commit 7579dd65c4
8 changed files with 54 additions and 32 deletions

View file

@ -39,7 +39,7 @@ print_updates() {
}
cache=/var/run/updates-available
mycache=$HOME/.screenrc-updates-available
mycache=$HOME/.screen-profiles/updates-available
now=`date +%s`
cache_timestamp=`stat -c "%Y" $cache 2>/dev/null || echo 0`
mycache_timestamp=`stat -c "%Y" $mycache 2>/dev/null || echo 0`

12
debian/changelog vendored
View file

@ -1,8 +1,16 @@
screen-profiles (1.29) UNRELEASED; urgency=low
*
* bin/ec2-cost: add --force, and --detail mode for stand-alone runs; test for
existence of /etc/ec2-version for Amazon instance (LP: #335274), allow
local use to turn ec2-cost on
* bin/updates-available, keybindings/common, profiles/common, screen,
screen-profiles, select-screen-profile, select-screen-profile.1: updated
to collapse ~/.screenrc-* into ~/.screen-profiles/*, LP: #335275
* screen: added a hack to move ~/.screenrc-* into ~/.screen-profiles/*;
this hack should be removed after Jaunty GA (only affects upgrading
Alpha users)
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 26 Feb 2009 22:50:28 -0600
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 27 Feb 2009 09:54:38 -0600
screen-profiles (1.28-0ubuntu1) jaunty; urgency=low

View file

@ -46,5 +46,5 @@ bindkey -k k9 screen -t help 0 screen-profiles # F9 | Configuration
bindkey -k F2 lockscreen # F12 | Lock this terminal
# Hot-reload profile
register r "^a:source ~/.screenrc-profile"
register r "^a:source ~/.screen-profiles/profile"
bind ~ process r

View file

@ -44,10 +44,10 @@ termcapinfo xterm* ti@:te@
defscrollback 10000
# The selected keybinding set, plus any additional user-defined/overriding
# keybindings should be placed in each user's ~/.screenrc-keybindings
source ~/.screenrc-keybindings
# keybindings should be placed in each user's ~/.screen-profiles/keybindings
source ~/.screen-profiles/keybindings
# Default windows
# Windows list should be placed in each user's ~/.screenrc-windows,
# Windows list should be placed in each user's ~/.screen-profiles/windows,
# to be configurable
source ~/.screenrc-windows
source ~/.screen-profiles/windows

36
screen
View file

@ -17,32 +17,46 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# If ~/.screenrc exists but ~/.screenrc-profile does not, this shows that the
# user has an existing custom screen configuration, and thus we will not
# bother them with a select-screen-profile prompt
if [ -r "$HOME/.screenrc" -a ! -e "$HOME/.screenrc-profile" ]; then
# Create the screen-profiles directory, if it doesn't already exist
[ -d "$HOME/.screen-profiles" ] || mkdir -p "$HOME/.screen-profiles"
##########################################################################
# The following hack should be removed after Jaunty goes GA
# (should only affect upgrading Alpha users)
# See LP: #335275
# Collapse ~/.screenrc-* into ~/.screen-profiles/*
for i in ec2-cost keybindings profile updates-available windows; do
mv -f "$HOME/.screenrc-$i" "$HOME/.screen-profiles/" 2>/dev/null
done
##########################################################################
# If ~/.screenrc exists but ~/.screen-profiles/profile does not,
# this shows that the user has an existing custom screen configuration,
# and thus we will not bother them with a select-screen-profile prompt.
if [ -r "$HOME/.screenrc" -a ! -e "$HOME/.screen-profiles/profile" ]; then
exec /usr/bin/screen.real -c "$HOME/.screenrc" "$@"
exit $?
fi
# Otherwise, let's ensure that the user has selected a screen profile
[ -r "$HOME/.screenrc-profile" ] || /usr/bin/select-screen-profile
# Next, let's ensure that the user has selected a screen profile
[ -r "$HOME/.screen-profiles/profile" ] || /usr/bin/select-screen-profile
# Ensure that their keybindings are seeded
[ -s "$HOME/.screenrc-keybindings" ] || echo "source /usr/share/screen-profiles/keybindings/common" > "$HOME/.screenrc-keybindings"
[ -s "$HOME/.screen-profiles/keybindings" ] || echo "source /usr/share/screen-profiles/keybindings/common" > "$HOME/.screen-profiles/keybindings"
# Ensure that their default windows are seeded
[ -r "$HOME/.screenrc-windows" ] || cp "/usr/share/screen-profiles/windows/common" "$HOME/.screenrc-windows"
[ -r "$HOME/.screen-profiles/windows" ] || cp "/usr/share/screen-profiles/windows/common" "$HOME/.screen-profiles/windows"
# Ensure that the user's .screenrc at least exists
[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc"
##########################################################################
# The following hacks should be removed when Jaunty goes Beta
# The following hacks should be removed when Jaunty goes GA
# (should only affect upgrading Alpha users)
# Prevent recursion; .screenrc should no longer source .screenrc-profile
sed -i '/^source .*\.screenrc-profile$/d' $HOME/.screenrc
sed -i '/^source .*\.screen.*-.*profile$/d' $HOME/.screenrc
# .screenrc-windows should no longer reference screen-profiles-helper
sed -i 's/screen-profiles-helper/screen-profiles/' $HOME/.screenrc-windows
sed -i 's/screen-profiles-helper/screen-profiles/' $HOME/.screen-profiles/windows
##########################################################################
# Now let's execute screen!

View file

@ -170,7 +170,7 @@ def keybindings(screen, size):
return 100
def switch_keybindings(set):
commands.getoutput("sed -i -e 's:^source .*$:source "+SHARE+"/keybindings/"+set+":' "+HOME+"/.screenrc-keybindings")
commands.getoutput("sed -i -e 's:^source .*$:source "+SHARE+"/keybindings/"+set+":' "+HOME+"/.screen-profiles/keybindings")
def newwindow(screen, size):
title=Entry(8, text="bash", returnExit=1)
@ -222,7 +222,7 @@ def newwindow(screen, size):
return 100
def appendwindow(win):
f=open(HOME+'/.screenrc-windows', 'a')
f=open(HOME+'/.screen-profiles/windows', 'a')
try:
f.write(win+"\n")
@ -233,7 +233,7 @@ def appendwindow(win):
f.close()
def readwindows():
f=open(HOME+'/.screenrc-windows', 'r')
f=open(HOME+'/.screen-profiles/windows', 'r')
try:
li=[]
for line in f.readlines():
@ -256,7 +256,7 @@ def readwindows():
f.close()
def writewindows(winlist):
f=open(HOME+'/.screenrc-windows', 'w')
f=open(HOME+'/.screen-profiles/windows', 'w')
try:
for win in winlist:
if win[0] == -1:
@ -302,7 +302,7 @@ def defaultwindows(screen, size):
return 100
def welcomeOn():
path=HOME+'/.screenrc-windows'
path=HOME+'/.screen-profiles/windows'
line = commands.getoutput("grep '^"+WELCOME+"' "+path)
if line == "":
return 1
@ -325,10 +325,10 @@ def togglewelcome(screen, size, welcome):
return rc
def togglewelcomeon():
commands.getoutput("sed -i -e 's/^#"+WELCOME+"/"+WELCOME+"/' "+HOME+'/.screenrc-windows')
commands.getoutput("sed -i -e 's/^#"+WELCOME+"/"+WELCOME+"/' "+HOME+'/.screen-profiles/windows')
def togglewelcomeoff():
commands.getoutput("sed -i -e 's/^"+WELCOME+"/#"+WELCOME+"/' "+HOME+'/.screenrc-windows')
commands.getoutput("sed -i -e 's/^"+WELCOME+"/#"+WELCOME+"/' "+HOME+'/.screen-profiles/windows')
def install(screen, size, isInstalled):
if not isInstalled:
@ -366,7 +366,7 @@ def appendtofile(p, s):
def getesckey():
path=HOME+'/.screenrc-keybindings'
path=HOME+'/.screen-profiles/keybindings'
if not os.path.exists(path):
return DEF_ESC
line = commands.getoutput("grep ^escape "+path)
@ -375,7 +375,7 @@ def getesckey():
return line[line.find('^')+1]
def setesckey(key):
path = HOME+'/.screenrc-keybindings'
path = HOME+'/.screen-profiles/keybindings'
if key != "":
u = key[0].upper()
l = key[0].lower()

View file

@ -52,7 +52,7 @@ assert_symlink() {
}
# If these files exist, they must be a symlink
assert_symlink "$HOME/.screenrc-profile"
assert_symlink "$HOME/.screen-profiles/profile"
listprofiles() {
# Display list of profiles, one per line
@ -118,8 +118,8 @@ setprofile() {
for x in $profiles; do
i=`expr $i + 1`
if [ "$i" = "$selected" -o "$x" = "$selected" ]; then
rm -f "$HOME/.screenrc-profile"
ln -s "$PROFILE_DIR/$x" "$HOME/.screenrc-profile"
rm -f "$HOME/.screen-profiles/profile"
ln -s "$PROFILE_DIR/$x" "$HOME/.screen-profiles/profile"
found=1
echo
if [ "$TERM" = "screen" ]; then

View file

@ -5,7 +5,7 @@ select\-screen\-profile \- Screen Profile Selector
.SH DESCRIPTION
\fBselect\-screen\-profile\fP is an application that lists the available screen profiles on a system and prompts the user to select one.
The selected profile will be symbolically linked into the current user's ~/.screenrc file, if that file does not yet exist, or is currently a symbolic link.
The selected profile will be symbolically linked into the current user's ~/.screen-profiles/profile, if that file does not yet exist, or is currently a symbolic link.
.SH "SEE ALSO"
.PD 0