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