Reverse all the prompts!
in a file called ~/.reverseit.py: | |
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
from sys import stdin, stdout | |
pchars = u"abcdefghijklmnopqrstuvwxyz,.?!'()[]{}" | |
fchars = u"ɐqɔpǝɟƃɥıɾʞlɯuodbɹsʇnʌʍxʎz'˙¿¡,)(][}{" | |
flipper = dict(zip(pchars, fchars)) | |
def flip(s): | |
charList = [ flipper.get(x, x) for x in s.lower() ] | |
charList.reverse() | |
return "".join(charList).strip('\n') | |
stdout.write(flip(stdin.read()).encode('utf8')) | |
in le bashrc: | |
function exitstatus { | |
EXITSTATUS="$?" | |
BOLD="\[\033[1m\]" | |
GREEN="\[\033[1;32m\]" | |
RED="\[\033[1;31m\]" | |
OFF="\[\033[m\]" | |
if [ "$EXITSTATUS" -eq "0" ] | |
then | |
PS1="${GREEN}\u@\h:\w${OFF}$(__git_ps1)$(check_virt_env)\$ " | |
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}";echo -ne "\007" | |
else | |
TMP="${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}" | |
RPS1=`echo $TMP | python ~/.reverseit.py` | |
PS1="(╯°□°)╯ ${RED}$RPS1${OFF}$(__git_ps1)\$ " | |
fi | |
PS2="${BOLD}>${OFF} " | |
} | |
PROMPT_COMMAND=exitstatus |
This comment has been minimized.
This comment has been minimized.
heh typo, should read: PS1="(╯°□°)╯ ${RED}$RPS1${OFF}$(__git_ps1)$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Result: