git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bash/prompt.bash56
-rw-r--r--.flake85
2 files changed, 53 insertions, 8 deletions
diff --git a/.bash/prompt.bash b/.bash/prompt.bash
index 056d215..a3b22c5 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="fgtcolor 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";;
@@ -29,34 +37,70 @@ 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";;
- 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";;
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"
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";;
#*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";;
- 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";;
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
diff --git a/.flake8 b/.flake8
index 383ed7b..d0281bb 100644
--- a/.flake8
+++ b/.flake8
@@ -9,8 +9,9 @@ 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
#per-file-ignores =
# # imported but unused
# __init__.py: F401