15 lines
318 B
Bash
Executable file
15 lines
318 B
Bash
Executable file
#!/bin/sh
|
|
|
|
## check if there is an open Emacs window ##
|
|
## dependencies: wname, lsw.
|
|
|
|
ENAME="emacs"
|
|
ECMD='emacsclient -c --alternate-editor=""'
|
|
|
|
TARGET=$(for wid in $(lsw); do
|
|
printf '%s\n' "$wid $(atomx WM_CLASS $wid)"
|
|
done | grep emacs | cut -d ' ' -f1)
|
|
|
|
[ $TARGET ] && wms_mainrole.sh $TARGET \
|
|
|| $ECMD
|
|
|