# Emulate an MS-DOS prompt in your Linux shell.
# Laszlo Szathmary (jabba.laci@gmail.com), 2011
# Project home page:
# https://ubuntuincident.wordpress.com/2011/02/08/emulate-the-ms-dos-prompt/
#
#
# Modified by Soldier of Fortran
#
# Add to you ~/.bashrc file with: 'source ~/.themes/95/bashrc'

function msdos_pwd
{
    local dir="`pwd`"

    echo $dir | tr '/' '\\'
}

function drive_letter() {
    defaultletter="i"
    declare -A driveletters=(["1"]="A" ["2"]="B" ["3"]="C" ["4"]="D" ["5"]="E" ["6"]="F" ["7"]="G" ["8"]="H" ["9"]="I" ["10"]="J" ["11"]="K" ["12"]="L" ["13"]="M" ["14"]="N" ["15"]="O" ["16"]="P" ["17"]="Q" ["18"]="R" ["19"]="S" ["20"]="T" ["21"]="U" ["22"]="V" ["23"]="W" ["24"]="X" ["25"]="Y" ["26"]="Z")
    devs=$(df -x tmpfs -x devtmpfs -x efivarfs --output=source | tail -n+2)
    thisdev=$(df --output=source .|tail -n+2)
    if [ -z $thisdev ]; then
        echo "$defaultletter"
        return
    fi
    drivenum=$(echo "$devs" | grep -Fn "$thisdev" - | cut -d: -f1)
    if [[ -n $drivenum && -n "${driveletters[$drivenum]}" ]] ; then
         echo "${driveletters[$drivenum]}"
    else echo "$defaultletter"
    fi
}

export PS1='$(drive_letter):`msdos_pwd`> '

echo 
echo
echo "Microsoft(R) Windows 95"
echo "   (C)Copyright Microsoft Corp 1981-1996."
echo

