aboutsummaryrefslogtreecommitdiff
path: root/.i3-blocks/blocks/process
blob: 078a2416a2436b914284b0497ecc4333104c5dad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

PROG="${BLOCK_INSTANCE:-i3}"

PROG_REGEX="["$(echo "${PROG}" | cut -c 1)"]"$(echo "${PROG}" | cut -c 2-)" "
PROCESS=$(ps -eo pid,cmd | grep -w ${PROG_REGEX})

if [[ "${PROCESS}" ]]; then
  echo "ok"
  echo "ok"
  echo ""
else
  echo "na"
  echo "na"
  echo ""
  exit 33
fi