From 435de2adfc0b12313fb42bb2644a03561d7bc19c Mon Sep 17 00:00:00 2001 From: jowj Date: Sat, 20 Apr 2019 22:38:52 -0500 Subject: [PATCH] Fix multiple prompt issues: - fixed pwsh admin prompt colors - update .bashrc prompt to match pwsh styling - add dumb ascii art to .bashrc --- .bashrc | 32 +++++++++++++++----------------- .powershellCore.ps1 | 6 +++--- powershell/AsciiArt.psm1 | 3 ++- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.bashrc b/.bashrc index e6f8b28..3d58717 100644 --- a/.bashrc +++ b/.bashrc @@ -1,16 +1,12 @@ #!/bin/bash -# glob filenames case-insensitively -shopt -s nocaseglob +shopt -s nocaseglob # glob filenames case-insensitively +shopt -s histappend # append history to history file, don't overwrite. +shopt -s checkwinsize # fix line wrap issues -# append history to history file, don't overwrite. -shopt -s histappend -# fix line wrap issues -shopt -s checkwinsize +set completion-ignore-case on # ignore case when tab-completing -# ignore case when tab-completing -set completion-ignore-case on # find paths inside agares export AGARES=${AGARES:-"$HOME/.agares"} @@ -50,12 +46,6 @@ export HISTFILESIZE=5000 export HISTCONTROL="ignorespace" export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " - - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" @@ -68,15 +58,23 @@ fi if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi -export PS1="\t:\[$(tput sgr0)\]\[\033[38;5;93m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;6m\][\w]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]✨ >> " +# this looks like garbage but its just color initation and termination +export PS1="\t \e[34mǰ \e[91m☭\e[0m " export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced + +echo "" +echo " /'-./\_ | $HOSTNAME" +echo " : ||,> |" +echo " \.-'|| | $0" +echo -e "\e[31m || BURIED\e[0m |" +echo -e "\e[31m || HATCHET\e[0m | $OSTYPE" +echo -e "\e[31m ||\e[0m |" +echo "" diff --git a/.powershellCore.ps1 b/.powershellCore.ps1 index 33582b9..0401e9e 100644 --- a/.powershellCore.ps1 +++ b/.powershellCore.ps1 @@ -67,13 +67,13 @@ function Set-UserPrompt { Write-Host $(get-date -format HH:mm:ss) -nonewline -foregroundcolor White Write-Host " ǰ " -nonewline -foregroundcolor Blue - Write-Host "$DoublePrompt" -nonewline -foregroundcolor Green + $SoyAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if ($SoyAdmin) { - Write-Host " $($SpecialCharacters.HammerSickle) " -NoNewLine -ForegroundColor Red -BackgroundColor Yellow + Write-Host " $HammerSickle " -NoNewLine -ForegroundColor Red -BackgroundColor Yellow } else { - Write-Host $SpecialCharacters.DoublePrompt -NoNewLine -ForegroundColor White + Write-Host " $DoublePrompt " -NoNewLine -ForegroundColor Green } # Always return a string or PS will echo the standard "PS>" prompt and it will append to yours return " " diff --git a/powershell/AsciiArt.psm1 b/powershell/AsciiArt.psm1 index 70164c8..9e34f55 100644 --- a/powershell/AsciiArt.psm1 +++ b/powershell/AsciiArt.psm1 @@ -23,6 +23,7 @@ catch { $osv = /usr/bin/uname -a } + ## Exported functions function Show-AsciiHatchet { @@ -64,7 +65,7 @@ function Show-AsciiBWWindowsLogo { function Show-AsciiCurvyWindowsLogo { newline - whw -f red ' ,-~ ~-,' ; whw -f green ' ,_~ ~-, ' ; newline + whw -f red ' ,-~ ~-,' ; whw -f green ' ,_~ ~-, ' ; whw $env:COMPUTERNAME ; newline whw -f red ' / /' ; whw -f green ' / / ' ; newline whw -f red ' /,- -,/' ; whw -f green ' /,- -,/ ' ; whw $psv ; newline whw -f blue ' ,-~ ~-,' ; whw -f yellow ' ,_~ ~-, ' ; newline