From fc800c836a531b11bc0099e414fd6fbe8fe53aae Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 8 Apr 2023 13:34:49 +0200 Subject: fix: non-SLE suse did not apply anywhere --- .bash/prompt.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bash/prompt.bash b/.bash/prompt.bash index 056d215..75ca24a 100644 --- a/.bash/prompt.bash +++ b/.bash/prompt.bash @@ -29,7 +29,7 @@ case "$MYUID" in # the colour of Geeko: #*suse|aix) FGC2="fgcolor 22";FGC3="fgcolor 41";; *sles*) FGC2="fgcolor 22";FGC3="fgcolor 83";; - *suse) FGC2="fgcolor 30";FGC3="fgcolor 83";; + *suse*) FGC2="fgcolor 30";FGC3="fgcolor 83";; aix) FGC2="fgcolor 238";FGC3="fgcolor 83";; *centos*) FGC2="fgcolor 25";FGC3="fgcolor 208";; *solaris) FGC2="fgcolor 31";FGC3="fgcolor 124";; @@ -48,7 +48,7 @@ case "$MYUID" in fedora) FGC1="fgcolor 88";FGC3="fgcolor 203";; #*suse|aix) FGC1="fgcolor 22";FGC3="fgcolor 41";; *sles*) FGC1="fgcolor 22";FGC3="fgcolor 83";; - *suse) FGC1="fgcolor 30";FGC3="fgcolor 83";; + *suse*) FGC1="fgcolor 30";FGC3="fgcolor 83";; aix) FGC1="fgcolor 238";FGC3="fgcolor 83";; *centos*) FGC1="fgcolor 25";FGC3="fgcolor 208";; *solaris) FGC1="fgcolor 31";FGC3="fgcolor 124";; -- cgit v1.2.3 From 10aabab8912182302ae549e83f9cae6a245c4e4d Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 8 Apr 2023 13:35:34 +0200 Subject: + termux --- .bash/prompt.bash | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.bash/prompt.bash b/.bash/prompt.bash index 75ca24a..9908c56 100644 --- a/.bash/prompt.bash +++ b/.bash/prompt.bash @@ -38,6 +38,11 @@ case "$MYUID" in rocky) FGC2="fgcolor 22";FGC3="fgcolor 41";; *) FGC2="fgcolor 240";FGC3="fgcolor 244";; esac + if [ -n "$TERMUX_APK_RELEASE" ]; then + if [ "$TERMUX_APK_RELEASE" == "F_DROID" ]; then + FGC2="fgcolor 27";FGC3="fgcolor 35" + fi + fi ;; *) FGC2="fgcolor 253" @@ -57,6 +62,11 @@ case "$MYUID" in rocky) FGC1="fgcolor 22";FGC3="fgcolor 41";; *) FGC1="fgcolor 240";FGC3="fgcolor 244";; esac + if [ -n "$TERMUX_APK_RELEASE" ]; then + if [ "$TERMUX_APK_RELEASE" == "F_DROID" ]; then + FGC1="fgcolor 27";FGC3="fgcolor 35" + fi + fi ;; esac # HYPERVISOR LAYER 8 SOFTWARE -- cgit v1.2.3 From e27c0a03d5c5163bfd9df624368d458041c87521 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 6 May 2023 09:57:49 +0200 Subject: Superseding flake8-colors - considering that deprecated From flake8 5.0.0 on, flake8 natively supports `--color` [^1], rendering the installation of flake8-colors obsolete. (Kudos so far for the nice work, nonetheless.) Debian 12 (frozen and one month before release at the point of this update) moved flake8 from 3.8.4 to 5.0.4, so I'm moving along. (Also, no need for venv magic anymore.) [^1] [flake8 changelog for 5.0.0](https://flake8.pycqa.org/en/latest/release-notes/5.0.0.html) --- .flake8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index d236572..32eea63 100644 --- a/.flake8 +++ b/.flake8 @@ -9,4 +9,6 @@ max-line-length = 100 # Do test for docstrings. Laziness sucks. doctests = True # use only if flake8-colors is installed: -format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}:\\t${red_bold}%(code)s${reset} %(text)s +# format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}:\\t${red_bold}%(code)s${reset} %(text)s +# Superseding flake8-colors: +format = %(cyan)s%(path)s%(reset)s:%(yellow)s%(bold)s%(row)d%(reset)s:%(green)s%(bold)s%(col)d%(reset)s: %(red)s%(bold)s%(code)s%(reset)s %(text)s -- cgit v1.2.3 From 6c6b1f1c7ae29bc5cda8982a99eb21836ab14d98 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 6 May 2023 10:44:53 +0200 Subject: New colours for Debian > 12 and derivatives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Distinguish Debian >= 12 – Debian 12 introduces emerald theming - Corporate work includes refined Ubuntu settings. Adjusting to match Ubuntu >= 22 --- .bash/prompt.bash | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.bash/prompt.bash b/.bash/prompt.bash index 9908c56..314aa1b 100644 --- a/.bash/prompt.bash +++ b/.bash/prompt.bash @@ -17,11 +17,19 @@ bgcolor () { # stupid old asterisk (*). Well, here hetting "no digits" practically won't hurt. MYUID="$(id|sed 's/.*uid=\([0-9]*\).*/\1/g')";export MYUID # ...because "empty" will hit the "any" condition in the end :) +OSMAJVER="$(grep '^VERSION_ID' /etc/os-release|awk -F= '{print $NF}'|sed 's/"//g'|awk -F\. '{print $1}')" case "$MYUID" in 0) FGC1="fgcolor 88" case "$OSNAME" in - debian) FGC3="fgcolor 38";FGC2="fgtcolor 155 15 64";; + debian) + # Debian 12 = emerald + if [ "$OSMAJVER" -ge 12 ];then + FGC3="fgcolor 36";FGC2="fgtcolor 155 15 64" + else + FGC3="fgcolor 38";FGC2="fgcolor 155 15 64" + fi + ;; arch) FGC2="fgcolor 24";FGC3="fgcolor 240";; redhat) FGC1="fgcolor 23";FGC2="fgcolor 88";FGC3="fgcolor 203";; fedora) FGC1="fgcolor 160";FGC2="fgcolor 88";FGC3="fgcolor 203";; @@ -33,7 +41,17 @@ case "$MYUID" in aix) FGC2="fgcolor 238";FGC3="fgcolor 83";; *centos*) FGC2="fgcolor 25";FGC3="fgcolor 208";; *solaris) FGC2="fgcolor 31";FGC3="fgcolor 124";; - ubuntu) FGC2="fgcolor 130";FGC3="fgcolor 215";; + ubuntu) + if [ "$OSMAJVER" -ge 22 ];then + if printf "%b" "$TERM"|grep -P 'xterm|256' > /dev/null;then + FGC2="fgcolor 89";FGC3="fgcolor 208" + else + FGC2="fgcolor 53";FGC3="fgcolor 184" + fi + else + FGC2="fgcolor 130";FGC3="fgcolor 215" + fi + ;; rasp*) FGC2="fgcolor 253";FGC3="fgcolor 126";; rocky) FGC2="fgcolor 22";FGC3="fgcolor 41";; *) FGC2="fgcolor 240";FGC3="fgcolor 244";; @@ -47,7 +65,13 @@ case "$MYUID" in *) FGC2="fgcolor 253" case "$OSNAME" in - debian) FGC1="fgtcolor 155 15 64";FGC3="fgcolor 38";; + debian) + if [ "$OSMAJVER" -ge 12 ];then + FGC1="fgtcolor 155 15 64";FGC3="fgcolor 36" + else + FGC1="fgtcolor 155 15 64";FGC3="fgcolor 38" + fi + ;; arch) FGC1="fgcolor 24";FGC3="fgcolor 239";; redhat) FGC1="fgcolor 23";FGC3="fgcolor 88";; fedora) FGC1="fgcolor 88";FGC3="fgcolor 203";; @@ -57,7 +81,17 @@ case "$MYUID" in aix) FGC1="fgcolor 238";FGC3="fgcolor 83";; *centos*) FGC1="fgcolor 25";FGC3="fgcolor 208";; *solaris) FGC1="fgcolor 31";FGC3="fgcolor 124";; - ubuntu) FGC1="fgcolor 130";FGC3="fgcolor 215";; + ubuntu) + if [ "$OSMAJVER" -ge 22 ];then + if printf "%b" "$TERM"|grep -P 'xterm|256' > /dev/null;then + FGC1="fgcolor 89";FGC3="fgcolor 208" + else + FGC1="fgcolor 53";FGC3="fgcolor 184" + fi + else + FGC1="fgcolor 130";FGC3="fgcolor 215" + fi + ;; rasp*) FGC1="fgcolor 53";FGC3="fgcolor 126";; rocky) FGC1="fgcolor 22";FGC3="fgcolor 41";; *) FGC1="fgcolor 240";FGC3="fgcolor 244";; -- cgit v1.2.3 From 1fcad4f954973302e62b8dd99147e8209e1a75ff Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 6 May 2023 10:48:41 +0200 Subject: fix: root colouring for Debian < 12 --- .bash/prompt.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bash/prompt.bash b/.bash/prompt.bash index 314aa1b..a3b22c5 100644 --- a/.bash/prompt.bash +++ b/.bash/prompt.bash @@ -27,7 +27,7 @@ case "$MYUID" in if [ "$OSMAJVER" -ge 12 ];then FGC3="fgcolor 36";FGC2="fgtcolor 155 15 64" else - FGC3="fgcolor 38";FGC2="fgcolor 155 15 64" + FGC3="fgcolor 38";FGC2="fgtcolor 155 15 64" fi ;; arch) FGC2="fgcolor 24";FGC3="fgcolor 240";; -- cgit v1.2.3