Skip to content

Commit

Permalink
keyd-application-mapper: Add debugging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
rvaiya committed Apr 11, 2022
1 parent 763edac commit 7611355
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/keyd-application-mapper
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7611355

Please sign in to comment.