From cc97ff19b09317a76ab4e359d9677211a6b694b3 Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Sat, 16 Feb 2013 01:40:16 +0100 Subject: [PATCH 1/4] display logo surrounded by spaces on OSX --- usr/lib/byobu/logo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/lib/byobu/logo b/usr/lib/byobu/logo index 20e9d362..987ff3c1 100755 --- a/usr/lib/byobu/logo +++ b/usr/lib/byobu/logo @@ -104,7 +104,7 @@ __logo() { # The Apple option character #logo=" ⌘ " # The Apple logo -- only visible from Mac terminals - logo="" + logo="  " else logo=" X " fi From 1a23a7325ce0ea7fcd49de7c5253a8d802ddf8c0 Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Sat, 16 Feb 2013 01:40:56 +0100 Subject: [PATCH 2/4] fix time_binary printing "\n" and killing other output --- usr/lib/byobu/time_binary | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr/lib/byobu/time_binary b/usr/lib/byobu/time_binary index e039637e..2bef8052 100755 --- a/usr/lib/byobu/time_binary +++ b/usr/lib/byobu/time_binary @@ -76,7 +76,7 @@ EOT suppress_seconds=n clock_type=binary format=std -ending="\n" +ending="" uppercase=n leading_zeros=n @@ -169,5 +169,6 @@ else display_time="${hh}${sep}${hm}${hs}${ending}" fi +color k w printf "%s" "$display_time" -exit 0 +color -- From b2b49983d885af1ffcc5b57d07adbde15ba0ceb4 Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Sat, 16 Feb 2013 01:41:23 +0100 Subject: [PATCH 3/4] make updates_available aware of homebrew --- usr/lib/byobu/updates_available | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/usr/lib/byobu/updates_available b/usr/lib/byobu/updates_available index d8721bd7..0cd19807 100755 --- a/usr/lib/byobu/updates_available +++ b/usr/lib/byobu/updates_available @@ -67,6 +67,13 @@ ___update_cache() { elif $BYOBU_TEST pacman >/dev/null; then # If pacman (Archlinux) exists, use it LC_ALL=C flock -xn "$flock" pacman -Sup | grep -vc "^\(::\| \)" > $mycache & + elif $BYOBU_TEST brew >/dev/null; then + # If homebrew (Mac OSX) exists, use it, also background if flock exists + if $BYOBU_TEST flock; then + flock -xn "$flock" brew outdated | wc -l > $mycache & + else + brew outdated | wc -l > $mycache & + fi fi } @@ -90,6 +97,19 @@ ___update_needed() { [ "$db" -nt "$mycache" ] && return 0 done return 1 + elif $BYOBU_TEST brew >/dev/null; then + # Mac OSX + # check if any new versions have been installed since + # we last cached. this may not recognize formulae + # installed with HEAD + for f in $(brew --prefix)/Cellar/*; do + [ "$f" -nt "$mycache" ] && return 0 + done + + # nothing new has been installed, so check wether the + # formulae database was updated + [ "$(brew --prefix)/Library/Formula" -nt "$mycache" ] + return $? fi return 1 } From 097a768ee3fee298676de0d99d15dc002acd4b7d Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Sat, 16 Feb 2013 01:41:44 +0100 Subject: [PATCH 4/4] add an option to time to hide seconds --- usr/lib/byobu/time | 10 ++++++++-- usr/share/byobu/status/statusrc | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/usr/lib/byobu/time b/usr/lib/byobu/time index e35c98de..d527c5f5 100755 --- a/usr/lib/byobu/time +++ b/usr/lib/byobu/time @@ -24,12 +24,18 @@ __time_detail() { } __time() { + local secs=1 + [ -n "$TIME_SECONDS" ] && secs=$TIME_SECONDS case "$BYOBU_BACKEND" in screen) - printf "\0050c:\005s" + format="\0050c" + [ "$secs" != "0" ] && format="$format:\005s" + printf $format ;; tmux|*) - date +"%H:%M:%S" + format="%H:%M" + [ "$secs" != "0" ] && format="$format:%S" + date +$format ;; esac } diff --git a/usr/share/byobu/status/statusrc b/usr/share/byobu/status/statusrc index d9d20dcc..048598a8 100644 --- a/usr/share/byobu/status/statusrc +++ b/usr/share/byobu/status/statusrc @@ -72,3 +72,7 @@ # to instead count number of distinct users logged onto the system # Default: 0 #USERS_DISTINCT=0 + +# Set this to zero to hide seconds int the time display +# Default 1 +#TIME_SECONDS=0