From e52a161f02ab5ce1281aeb4966313a8f6bc2e6fe Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 6 Aug 2020 10:41:04 +0300 Subject: [PATCH] red status line for root, blue for everyone else --- shfm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/shfm b/shfm index e2da4b1..95a0fae 100755 --- a/shfm +++ b/shfm @@ -145,7 +145,7 @@ list_print() { for file do case $i in - "$y2") esc SGR 34 7 + "$y2") esc SGR 0 7 esac case $((i - end)) in @@ -169,7 +169,12 @@ redraw() { status_line() { esc DECSC esc CUP "$LINES" - esc SGR 31 7 + + case $USER in + root) esc SGR 31 7 ;; + *) esc SGR 34 7 ;; + esac + printf '%-*s' "$COLUMNS" "$1" esc SGR esc DECRC @@ -199,7 +204,7 @@ line_print() { offset=$1 case $offset in - "$y") esc SGR 34 7 + "$y") esc SGR 0 7 esac shift "$offset"