mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-14 10:46:58 -07:00
usr/bin/byobu-select-profile.in, usr/share/man/man1/byobu-select-
profile.1: LP: #1717746
This commit is contained in:
parent
8a4a42d865
commit
b2d5e2a40c
3 changed files with 28 additions and 73 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -32,6 +32,8 @@ byobu (5.127) unreleased; urgency=medium
|
|||
usr/share/byobu/pixmaps/byobu.64.png,
|
||||
usr/share/byobu/pixmaps/byobu.png:
|
||||
- re-render png's, as Chrome started rendering middle color wrong
|
||||
* usr/bin/byobu-select-profile.in, usr/share/man/man1/byobu-select-
|
||||
profile.1: LP: #1717746
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 27 May 2018 18:07:11 -0500
|
||||
|
||||
|
|
|
@ -59,13 +59,14 @@ done
|
|||
|
||||
usage () {
|
||||
cat <<EOT
|
||||
Usage: $0 [(-l|--list)][(-h|--help)]
|
||||
-l,--list list available profiles
|
||||
-b,--background set the background color
|
||||
-f,--foreground set the foreground color
|
||||
-h,--help this help
|
||||
|
||||
Without any parameters, runs interactively.
|
||||
Usage: $0 [OPTION]
|
||||
-l,--list list available profiles
|
||||
-b,--background COLOR set the background color
|
||||
-f,--foreground COLOR set the foreground color
|
||||
-h,--hostnmae set the colors based on a hash of the hostname
|
||||
-i,--ip set the colors based on a hash of the ip
|
||||
-r,--random set the colors randomly
|
||||
--help this help
|
||||
EOT
|
||||
}
|
||||
|
||||
|
@ -83,60 +84,6 @@ listprofiles() {
|
|||
done
|
||||
}
|
||||
|
||||
prompt() {
|
||||
which="$1"
|
||||
count=1
|
||||
selected=-1
|
||||
while /bin/true; do
|
||||
if [ $count -gt 5 ]; then
|
||||
echo `gettext "ERROR: Invalid selection"`
|
||||
exit 1
|
||||
fi
|
||||
count=$(expr $count + 1)
|
||||
echo
|
||||
if [ "$which" = "foreground" ]; then
|
||||
echo `gettext 'Select the foreground color: '`
|
||||
simple="white"
|
||||
else
|
||||
echo `gettext 'Select the background color: '`
|
||||
simple="black"
|
||||
fi
|
||||
i=1
|
||||
for x in $COLORS; do
|
||||
test $i -lt 10 2>/dev/null && printf " " || printf " "
|
||||
echo "$i. $x"
|
||||
i=$(expr $i + 1)
|
||||
[ "$simple" = "$x" ] && simple=$i
|
||||
done
|
||||
echo
|
||||
if [ -z "$selected" -a -n "$simple" ]; then
|
||||
selected="$simple"
|
||||
elif ! test $selected -gt 0 2>/dev/null; then
|
||||
printf "`gettext 'Choose'` 1-$i [$simple]: "
|
||||
selected=`head -n1`
|
||||
elif ! test $selected -le $i 2>/dev/null; then
|
||||
printf "`gettext 'Choose'` 1-$i [$simple]: "
|
||||
selected=`head -n1`
|
||||
else
|
||||
i=1
|
||||
for color in $COLORS; do
|
||||
[ "$i" = "$selected" ] && break
|
||||
i=$(expr $i + 1)
|
||||
done
|
||||
echo `gettext "Selected"` "$which [$color]"
|
||||
case "$BYOBU_BACKEND" in
|
||||
screen)
|
||||
setcolor_screen "$which" "$color"
|
||||
;;
|
||||
tmux|*)
|
||||
setcolor_tmux "$color"
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
getletter() {
|
||||
count=$(echo "$1" | wc -c)
|
||||
if [ "$count" = "2" ]; then
|
||||
|
@ -214,12 +161,7 @@ setcolor_tmux() {
|
|||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
prompt "background"
|
||||
case "$BYOBU_BACKEND" in
|
||||
screen)
|
||||
prompt "foreground"
|
||||
;;
|
||||
esac
|
||||
usage
|
||||
else
|
||||
while true; do
|
||||
case "$1" in
|
||||
|
@ -231,11 +173,6 @@ else
|
|||
setcolor_screen "foreground" "$2"
|
||||
shift 2
|
||||
;;
|
||||
-l|--list)
|
||||
listprofiles
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-h|--hostname)
|
||||
color=$(hostname | $HASH | head -c 6)
|
||||
setcolor_tmux "$color"
|
||||
|
|
|
@ -3,7 +3,23 @@
|
|||
byobu\-select\-profile \- select your Byobu foreground and background colors
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBbyobu\-select\-profile\fP is an application that lists the available Byobu colors and allows you to select the foreground and background color.
|
||||
\fBbyobu\-select\-profile\fP is an application that changes Byobu's status bar foreground and background colors
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
-l,--list list available profiles
|
||||
|
||||
-b,--background COLOR set the background color
|
||||
|
||||
-f,--foreground COLOR set the foreground color
|
||||
|
||||
-h,--hostnmae set the colors based on a hash of the hostname
|
||||
|
||||
-i,--ip set the colors based on a hash of the ip
|
||||
|
||||
-r,--random set the colors randomly
|
||||
|
||||
--help this help
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.PD 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue