From 7611355432bbf932ca4ff393d23542ba9950f639 Mon Sep 17 00:00:00 2001 From: Raheman Vaiya Date: Mon, 11 Apr 2022 02:00:19 -0400 Subject: [PATCH] keyd-application-mapper: Add debugging statements --- scripts/keyd-application-mapper | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/keyd-application-mapper b/scripts/keyd-application-mapper index 2588963..5f1e4f7 100755 --- a/scripts/keyd-application-mapper +++ b/scripts/keyd-application-mapper @@ -22,6 +22,12 @@ CONFIG_PATH = os.getenv('HOME')+'/.config/keyd/app.conf' LOCKFILE = os.getenv('HOME')+'/.config/keyd/app.lock' LOGFILE = os.getenv('HOME')+'/.config/keyd/app.log' + +debug_flag = os.getenv('KEYD_DEBUG') +def dbg(s): + if debug_flag: + print(s) + def die(msg): sys.stderr.write('ERROR: ') sys.stderr.write(msg) @@ -334,6 +340,7 @@ def lookup_bindings(cls, title): bindings = [] for cexp, texp, b in config: if fnmatch(cls, cexp) and fnmatch(title, texp): + dbg(f'\tMatched {cexp}|{texp}') bindings.extend(b) return bindings