Revert last two commits
This commit is contained in:
parent
8d33b4051f
commit
ec1705835c
1 changed files with 27 additions and 25 deletions
52
neofetch
52
neofetch
|
@ -1739,35 +1739,37 @@ getfont () {
|
||||||
# Terminal Emulator {{{
|
# Terminal Emulator {{{
|
||||||
|
|
||||||
getterm () {
|
getterm () {
|
||||||
|
# Workaround for OS X systems that
|
||||||
|
# don't support the block below.
|
||||||
|
case "$TERM_PROGRAM" in
|
||||||
|
"iTerm.app") term="iTerm2" ;;
|
||||||
|
"Terminal.app") term="Apple Terminal" ;;
|
||||||
|
*) term="${TERM_PROGRAM/\.app}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Check $PPID for terminal emulator.
|
# Check $PPID for terminal emulator.
|
||||||
case "$os" in
|
if [ -z "$term" ]; then
|
||||||
"Mac OS X")
|
case "$os" in
|
||||||
case "$TERM_PROGRAM" in
|
"Windows")
|
||||||
"iTerm.app") term="iTerm2" ;;
|
parent="$(ps -p ${1:-$PPID} | awk '{printf $2}')"
|
||||||
"Terminal.app") term="Apple Terminal" ;;
|
parent=${parent/'PPID'}
|
||||||
*) term="${TERM_PROGRAM/\.app}" ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
"Windows")
|
name="$(ps -p $parent | awk '{printf $8}')"
|
||||||
parent="$(ps -p ${1:-$PPID} | awk '{printf $2}')"
|
name=${name/'COMMAND'}
|
||||||
parent=${parent/'PPID'}
|
name=${name/*\/}
|
||||||
|
;;
|
||||||
|
|
||||||
name="$(ps -p $parent | awk '{printf $8}')"
|
*)
|
||||||
name=${name/'COMMAND'}
|
parent="$(ps -p ${1:-$PPID} -o ppid=)"
|
||||||
name=${name/*\/}
|
name="$(ps -p $parent -o comm=)"
|
||||||
;;
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
*)
|
case "$name" in
|
||||||
parent="$(ps -p ${1:-$PPID} -o ppid=)"
|
"${SHELL/*\/}" | *"sh" | "tmux" | "screen" | "systemd") getterm "$parent" ;;
|
||||||
name="$(ps -p $parent -o comm=)"
|
*) term="$name" ;;
|
||||||
;;
|
esac
|
||||||
esac
|
fi
|
||||||
|
|
||||||
case "$name" in
|
|
||||||
"${SHELL/*\/}" | *"sh" | "tmux" | "screen" | "systemd") getterm "$parent" ;;
|
|
||||||
*) term="$name" ;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
Loading…
Reference in a new issue