keyd-application-mapper: Add debugging statements

master
Raheman Vaiya 4 years ago
parent 763edacf90
commit 7611355432
  1. 7
      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

Loading…
Cancel
Save