1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00

fix(dwm): for emacs 2 processes are supposed to be running

This commit is contained in:
Ryan Kes 2020-12-20 16:14:11 +01:00
parent af5f5af0cd
commit 2b7692d1e2

View File

@ -2,16 +2,19 @@
###---Start app if not running already---###
start_if_not_running() {
count=1
###---iceweasel/firefox is weird---###
if [ "$1" = "iceweasel" ]; then
PROCESS_NAME="iceweasel|MainThread"
elif [ "$1" = "element-desktop-nightly" ]; then
PROCESS_NAME="element-desktop"
elif [ "$1" = "emacs" ]; then
count=2
else
PROCESS_NAME=$1
fi
if [ "$(pgrep -u "$(id -u)" -x "$PROCESS_NAME" | wc -l)" -lt 1 ]; then
if [ "$(pgrep -u "$(id -u)" -x "$PROCESS_NAME" | wc -l)" -lt $count ]; then
if command -v "$1"; then
eval "$1 &"
fi