From 0df4d1b969f15ac14eefc8df9b4a04c35f5e58a2 Mon Sep 17 00:00:00 2001 From: GaugeK Date: Sun, 9 Aug 2020 04:48:32 +1000 Subject: [PATCH] support monads --- fet.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fet.sh b/fet.sh index 5de3ff1..2d86368 100755 --- a/fet.sh +++ b/fet.sh @@ -25,21 +25,22 @@ while [ ! "$term" ]; do done ## WM -# requires the WM to include 'wm' +# requires the WM to include 'wm' or 'monad' (for you leon) pg() { ab= for i in /proc/[0-9]*; do ab="$ab ${i##*/}" read -r a < "$i"/comm case $a in - *$1*) echo "$a" "${i##*/}"; break;; + *$1*|*${2:-$1}*) echo "$a" "${i##*/}"; break;; esac done } + [ "$DISPLAY" ] && { xorg="$(pg Xorg)" xorg="${xorg##* }" - aa="$(pg wm)" + aa="$(pg wm monad)" # make sure it was started near enough after the X server [ "${aa##* }" -gt "$xorg" ] && [ "${aa##* }" -lt "$((xorg + 20))" ] &&