wms/wms_editor.sh
2023-12-16 01:09:38 -03:00

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