
theme:widget:add colorpath

___x_cmd_theme_widget_colorpath(){
    local p="$1"
    case "$p" in
        /)
            theme:style_  "%${XTW_colorpath_style_root:-red}%"     "${p}"
            ;;
        */*)
            local t=""
            theme:style_  "%${XTW_colorpath_style_tail:-magenta}%"     "${p##*/}";     t="$x_"
            theme:style_  "%${XTW_colorpath_style_trunk:-cyan}%"       "${p%/*}";      p="${x_}"
            theme:style_  "%${XTW_colorpath_style_sep:-dim}%"          "${XTW_colorpath_sep:-/}";
            x_="${p}${x_}${t}"
            ;;
        *)
            theme:style_  "%${XTW_colorpath_style_rootfolder:-yellow}%" "${p}" ;;
    esac
    X_colorpath="$x_"
}
