neofetch: remove uneeded quotes
This commit is contained in:
parent
93600efc6a
commit
1f035379ff
143
neofetch
143
neofetch
|
@ -1585,111 +1585,112 @@ get_wm() {
|
||||||
# If function was run, stop here.
|
# If function was run, stop here.
|
||||||
((wm_run == 1)) && return
|
((wm_run == 1)) && return
|
||||||
|
|
||||||
case "$uname" in
|
case $uname in
|
||||||
*"OpenBSD"*) ps_flags=(x -c) ;;
|
*OpenBSD*) ps_flags=(x -c) ;;
|
||||||
*) ps_flags=(-e) ;;
|
*) ps_flags=(-e) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "$WAYLAND_DISPLAY" ]]; then
|
if [[ $WAYLAND_DISPLAY ]]; then
|
||||||
wm="$(ps "${ps_flags[@]}" | grep -m 1 -o -F \
|
wm=$(ps "${ps_flags[@]}" | grep -m 1 -o -F \
|
||||||
-e "arcan" \
|
-e arcan \
|
||||||
-e "asc" \
|
-e asc \
|
||||||
-e "clayland" \
|
-e clayland \
|
||||||
-e "dwc" \
|
-e dwc \
|
||||||
-e "fireplace" \
|
-e fireplace \
|
||||||
-e "greenfield" \
|
-e greenfield \
|
||||||
-e "grefsen" \
|
-e grefsen \
|
||||||
-e "lipstick" \
|
-e lipstick \
|
||||||
-e "maynard" \
|
-e maynard \
|
||||||
-e "mazecompositor" \
|
-e mazecompositor \
|
||||||
-e "motorcar" \
|
-e motorcar \
|
||||||
-e "orbital" \
|
-e orbital \
|
||||||
-e "orbment" \
|
-e orbment \
|
||||||
-e "perceptia" \
|
-e perceptia \
|
||||||
-e "rustland" \
|
-e rustland \
|
||||||
-e "sway" \
|
-e sway \
|
||||||
-e "ulubis" \
|
-e ulubis \
|
||||||
-e "velox" \
|
-e velox \
|
||||||
-e "wavy" \
|
-e wavy \
|
||||||
-e "way-cooler" \
|
-e way-cooler \
|
||||||
-e "wayfire" \
|
-e wayfire \
|
||||||
-e "wayhouse" \
|
-e wayhouse \
|
||||||
-e "westeros" \
|
-e westeros \
|
||||||
-e "westford" \
|
-e westford \
|
||||||
-e "weston")"
|
-e weston)
|
||||||
|
|
||||||
elif [[ "$DISPLAY" && "$os" != "Mac OS X" && "$os" != "FreeMiNT" ]]; then
|
elif [[ $DISPLAY && $os != "Mac OS X" && $os != FreeMiNT ]]; then
|
||||||
if type -p xprop &>/dev/null; then
|
type -p xprop &>/dev/null && {
|
||||||
id="$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)"
|
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)
|
||||||
id="${id##* }"
|
id=${id##* }
|
||||||
wm="$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)"
|
wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)
|
||||||
wm="${wm/*WM_NAME = }"
|
wm=${wm/*WM_NAME = }
|
||||||
wm="${wm/\"}"
|
wm=${wm/\"}
|
||||||
wm="${wm/\"*}"
|
wm=${wm/\"*}
|
||||||
fi
|
}
|
||||||
|
|
||||||
# Rename window managers to their proper values.
|
# Rename window managers to their proper values.
|
||||||
[[ "$wm" =~ "WINDOWMAKER" ]] && wm="wmaker"
|
[[ $wm == *WINDOWMAKER* ]] && wm=wmaker
|
||||||
[[ "$wm" =~ "GNOME Shell" ]] && wm="Mutter"
|
[[ $wm == *"GNOME Shell"* ]] && wm=Mutter
|
||||||
|
|
||||||
# Fallback for non-EWMH WMs.
|
# Fallback for non-EWMH WMs.
|
||||||
[[ -z "$wm" ]] && \
|
[[ $wm ]] ||
|
||||||
wm="$(ps "${ps_flags[@]}" | grep -m 1 -o \
|
wm=$(ps "${ps_flags[@]}" | grep -m 1 -o \
|
||||||
|
-e "[s]owm" \
|
||||||
-e "[c]atwm" \
|
-e "[c]atwm" \
|
||||||
-e "[f]vwm" \
|
-e "[f]vwm" \
|
||||||
-e "[d]wm" \
|
-e "[d]wm" \
|
||||||
-e "[2]bwm" \
|
-e "[2]bwm" \
|
||||||
-e "[m]onsterwm" \
|
-e "[m]onsterwm" \
|
||||||
-e "[t]inywm")"
|
-e "[t]inywm")
|
||||||
|
|
||||||
else
|
else
|
||||||
case "$os" in
|
case $os in
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
ps_line="$(ps -e | grep -o \
|
ps_line=$(ps -e | grep -o \
|
||||||
-e "[S]pectacle" \
|
-e "[S]pectacle" \
|
||||||
-e "[A]methyst" \
|
-e "[A]methyst" \
|
||||||
-e "[k]wm" \
|
-e "[k]wm" \
|
||||||
-e "[c]hun[k]wm" \
|
-e "[c]hun[k]wm" \
|
||||||
-e "[y]abai" \
|
-e "[y]abai" \
|
||||||
-e "[R]ectangle")"
|
-e "[R]ectangle")
|
||||||
|
|
||||||
case "$ps_line" in
|
case $ps_line in
|
||||||
*"chunkwm"*) wm="chunkwm" ;;
|
*chunkwm*) wm=chunkwm ;;
|
||||||
*"kwm"*) wm="Kwm" ;;
|
*kwm*) wm=Kwm ;;
|
||||||
*"yabai"*) wm="yabai" ;;
|
*yabai*) wm=yabai ;;
|
||||||
*"Amethyst"*) wm="Amethyst" ;;
|
*Amethyst*) wm=Amethyst ;;
|
||||||
*"Spectacle"*) wm="Spectacle" ;;
|
*Spectacle*) wm=Spectacle ;;
|
||||||
*"Rectangle"*) wm="Rectangle" ;;
|
*Rectangle*) wm=Rectangle ;;
|
||||||
*) wm="Quartz Compositor" ;;
|
*) wm="Quartz Compositor" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Windows")
|
Windows)
|
||||||
wm="$(tasklist | grep -m 1 -o -F \
|
wm=$(tasklist | grep -m 1 -o -F \
|
||||||
-e "bugn" \
|
-e bugn \
|
||||||
-e "Windawesome" \
|
-e Windawesome \
|
||||||
-e "blackbox" \
|
-e blackbox \
|
||||||
-e "emerge" \
|
-e emerge \
|
||||||
-e "litestep")"
|
-e litestep)
|
||||||
|
|
||||||
[[ "$wm" == "blackbox" ]] && wm="bbLean (Blackbox)"
|
[[ $wm == blackbox ]] && wm="bbLean (Blackbox)"
|
||||||
wm="${wm:+$wm, }Explorer"
|
wm=${wm:+$wm, }Explorer
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"FreeMiNT")
|
FreeMiNT)
|
||||||
freemint_wm=(/proc/*)
|
freemint_wm=(/proc/*)
|
||||||
case "${freemint_wm[*]}" in
|
|
||||||
*xaaes*) wm="XaAES" ;;
|
case ${freemint_wm[*]} in
|
||||||
*myaes*) wm="MyAES" ;;
|
*xaaes*) wm=XaAES ;;
|
||||||
*naes*) wm="N.AES" ;;
|
*myaes*) wm=MyAES ;;
|
||||||
geneva) wm="Geneva" ;;
|
*naes*) wm=N.AES ;;
|
||||||
|
geneva) wm=Geneva ;;
|
||||||
*) wm="Atari AES" ;;
|
*) wm="Atari AES" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Log that the function was run.
|
|
||||||
wm_run=1
|
wm_run=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue