From d78db511f9c2430c160daca5fd71c8edb68061b6 Mon Sep 17 00:00:00 2001
From: Siraaj Khandkar <siraaj@khandkar.net>
Date: Thu, 29 Sep 2022 06:39:24 -0400
Subject: [PATCH] Clean up any previous xbindkeys instances

---
 home/.xlaunch.d/xbindkeys | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/home/.xlaunch.d/xbindkeys b/home/.xlaunch.d/xbindkeys
index 73cb8e9..2a3569d 100755
--- a/home/.xlaunch.d/xbindkeys
+++ b/home/.xlaunch.d/xbindkeys
@@ -2,4 +2,8 @@
 
 set -e
 
+# XXX Since this script is also named xbindkeys, we avoid suicide by:
+#     1. not using killall;
+#     2. using "command" (or "cmd") instead of "comm".
+ps -eo pid,command | awk '$2 ~ "^xbindkeys" {print $1}' | xargs -I% kill %
 xbindkeys -n
-- 
2.20.1