mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
modernize byobu-export; work-in-progress; partial fix commit
This commit is contained in:
parent
c426f124cc
commit
c6008837e2
2 changed files with 11 additions and 28 deletions
37
byobu-export
37
byobu-export
|
@ -72,20 +72,6 @@ header() {
|
|||
hr
|
||||
}
|
||||
|
||||
sources() {
|
||||
# insert the common profile, replace the status exe path
|
||||
echo
|
||||
cat $SHARE/profiles/common | sed "s:$PKG-:\$HOME/.$PKG/$PKG-:"
|
||||
hr
|
||||
echo
|
||||
# insert the keybindings
|
||||
cat $SHARE/keybindings/f-keys
|
||||
hr
|
||||
echo
|
||||
hr
|
||||
}
|
||||
|
||||
|
||||
# Handle command line parameters
|
||||
file=
|
||||
while [ $# -gt 1 ]; do
|
||||
|
@ -130,33 +116,30 @@ else
|
|||
fi
|
||||
|
||||
# Create workspace
|
||||
PROFILE="$DIR/.screenrc"
|
||||
PROFILE="$DIR/.byobu/profile"
|
||||
STATUS="$DIR/.$PKG/status"
|
||||
mkdir -p "$DIR/.$PKG/bin"
|
||||
touch "$DIR/.$PKG/profile"
|
||||
dpkg-query --show --showformat '${Package} ${Version}\n' $PKG > "$DIR/.$PKG/version" 2>/dev/null || true
|
||||
echo "http://launchpad.net/$PKG" >> "$DIR/.$PKG/version"
|
||||
header > "$PROFILE"
|
||||
printf "FOREGROUND=k\nBACKGROUND=W\n" > "$DIR/.$PKG/color"
|
||||
|
||||
# Copy necessary scripts
|
||||
cat /usr/share/byobu/profiles/common >> "$PROFILE"
|
||||
cp -a /usr/share/byobu/keybindings/*-keys "$DIR/.$PKG"
|
||||
cp -a /usr/lib/$PKG/* "$DIR/.$PKG/bin"
|
||||
cp -a /usr/bin/$PKG-status "$DIR/.$PKG"
|
||||
cp -a /usr/bin/$PKG-janitor "$DIR/.$PKG"
|
||||
cp -a /usr/bin/$PKG-config "$DIR/.$PKG"
|
||||
|
||||
# Generate the monolithic profile
|
||||
header > "$PROFILE"
|
||||
sources >> "$PROFILE"
|
||||
cat /etc/$PKG/statusrc > "$STATUS"
|
||||
echo "source \$HOME/.$PKG/profile" > "$DIR/.screenrc"
|
||||
|
||||
# Some gardening
|
||||
# Drop additional "source" calls
|
||||
sed -i "s:^source .*::" "$PROFILE"
|
||||
# Use .screenrc instead
|
||||
sed -i "s:.$PKG/profile\":\.screenrc\":" "$PROFILE"
|
||||
# Drop the F9->Menu key
|
||||
sed -i "s:^bindkey -k k9 screen -t help:#bindkey -k k9 screen -t help:" "$PROFILE"
|
||||
# Use the local byobu-config
|
||||
sed -i "s:$PKG-config:\$HOME/.$PKG/$PKG-config:" "$PROFILE"
|
||||
sed -i "s:$PKG-config:\$HOME/.$PKG/$PKG-config:" "$DIR/.$PKG/"*-keys
|
||||
sed -i "s:$PKG-status:\$HOME/.$PKG/$PKG-status:" "$PROFILE"
|
||||
sed -i "s:$PKG-janitor:\$HOME/.$PKG/$PKG-janitor:" "$PROFILE"
|
||||
cd "$DIR/.$PKG"; ln -s f-keys keybindings; cd -
|
||||
|
||||
# tar up the results
|
||||
tar --owner=root --group=root -zcf "$file" -C "$DIR" . || error "Could not create archive"
|
||||
|
|
|
@ -100,7 +100,7 @@ fi
|
|||
# The status scripts used to have hyphens in their name, but now use
|
||||
# underscores such that we can source the file as a shell snippet;
|
||||
# fix existing status configuration.
|
||||
sed -i "s/-/_/g" "$HOME/.$PKG/status"
|
||||
sed -i "s/\(.*\)-\(.*\)=/\1_\2=/g" "$HOME/.$PKG/status"
|
||||
sed -i "s/^disk.*=/disk=/" "$HOME/.$PKG/status"
|
||||
sed -i "s/^network.*=/network=/" "$HOME/.$PKG/status"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue