From ae8973ddfadcb10e1511d9363ac9610321dd4dcf Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 8 Nov 2024 07:52:32 +0200 Subject: fix(bash): Proper low-color support for PS_* variables --- .bashrc | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index fbe76ca..cb4cf95 100644 --- a/.bashrc +++ b/.bashrc @@ -35,25 +35,27 @@ colors_res } - PS_FG=223 PS_BG=0 - PS_USER_BG=66 - [ -n "$IN_NIX_SHELL" ] && PS_USER_BG=67 + hc_mode && PS_FG=223 || PS_FG=7 + hc_mode && PS_USER_BG=66 || PS_USER_BG=4 + [ -n "$IN_NIX_SHELL" ] && { + hc_mode && PS_USER_BG=67 || PS_USER_BG=6; + } # Colors for reporting changes - PS_ERR=160 - PS_WARN=172 - PS_INFO=97 - PS_DBG=52 - - hc_mode && PS_TRIANGLE='' || PS_TRIANGLE='/' - hc_mode && PS_TRIANGLE_BOT='' || PS_TRIANGLE='\' - hc_mode && PS_LEFT_SEMI='' || PS_LEFT_SEMI='(' - hc_mode && PS_LEFT_SLAB='█' || PS_LEFT_SLAB='/ ' - hc_mode && PS_RIGHT_SLAB='█' || PS_RIGHT_SLAB=' /' - hc_mode && PS_RIGHT_SEMI='' || PS_RIGHT_SEMI=')' - hc_mode && PS_PREC='' || PS_PREC='>' - hc_mode && PS_PREC_GIT='' || PS_PREC_GIT='{}' + hc_mode && PS_ERR=160 || PS_ERR=1 + hc_mode && PS_WARN=172 || PS_WARN=3 + hc_mode && PS_INFO=97 || PS_INFO=5 + hc_mode && PS_DBG=52 || PS_DBG=1 + + hc_mode && PS_TRIANGLE='' || PS_TRIANGLE='|' + hc_mode && PS_TRIANGLE_BOT='' || PS_TRIANGLE='|' + hc_mode && PS_LEFT_SEMI='' || PS_LEFT_SEMI='(' + hc_mode && PS_LEFT_SLAB='█' || PS_LEFT_SLAB='| ' + hc_mode && PS_RIGHT_SLAB='█' || PS_RIGHT_SLAB=' |' + hc_mode && PS_RIGHT_SEMI='' || PS_RIGHT_SEMI=')' + hc_mode && PS_PREC='' || PS_PREC='>' + hc_mode && PS_PREC_GIT='' || PS_PREC_GIT='{}' ___dirchanged="" -- cgit v1.2.3