From a088f696eaa606457c2535a3af5c42ef323d4893 Mon Sep 17 00:00:00 2001 From: root_sti Date: Sat, 16 Dec 2023 01:09:38 -0300 Subject: [PATCH] Actualization 2024 --- wms_editor.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 wms_editor.sh diff --git a/wms_editor.sh b/wms_editor.sh new file mode 100755 index 0000000..2c5b76d --- /dev/null +++ b/wms_editor.sh @@ -0,0 +1,15 @@ +#!/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 +