mirror of
https://github.com/sezanzeb/input-remapper
synced 2024-11-08 07:10:36 +00:00
some small log improvements
This commit is contained in:
parent
b316f09cfa
commit
0ed8d9e44b
@ -97,6 +97,7 @@ def main(options, daemon):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
preset_path = os.path.join(presets_dir, device, preset + '.json')
|
preset_path = os.path.join(presets_dir, device, preset + '.json')
|
||||||
|
logger.info('Starting injection: "%s", "%s"', device, preset_path)
|
||||||
daemon.start_injecting(device, preset_path, config_dir)
|
daemon.start_injecting(device, preset_path, config_dir)
|
||||||
|
|
||||||
if options.command == START:
|
if options.command == START:
|
||||||
@ -109,6 +110,7 @@ def main(options, daemon):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
preset_path = os.path.abspath(os.path.expanduser(options.preset))
|
preset_path = os.path.abspath(os.path.expanduser(options.preset))
|
||||||
|
logger.info('Starting injection: "%s", "%s"', options.device, preset_path)
|
||||||
daemon.start_injecting(options.device, preset_path, config_dir)
|
daemon.start_injecting(options.device, preset_path, config_dir)
|
||||||
|
|
||||||
if options.command == STOP:
|
if options.command == STOP:
|
||||||
|
@ -64,7 +64,10 @@ NO_GRAB = 6
|
|||||||
def is_numlock_on():
|
def is_numlock_on():
|
||||||
"""Get the current state of the numlock."""
|
"""Get the current state of the numlock."""
|
||||||
try:
|
try:
|
||||||
xset_q = subprocess.check_output(['xset', 'q']).decode()
|
xset_q = subprocess.check_output(
|
||||||
|
['xset', 'q'],
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
).decode()
|
||||||
num_lock_status = re.search(
|
num_lock_status = re.search(
|
||||||
r'Num Lock:\s+(.+?)\s',
|
r'Num Lock:\s+(.+?)\s',
|
||||||
xset_q
|
xset_q
|
||||||
|
@ -56,7 +56,10 @@ class SystemMapping:
|
|||||||
self.clear()
|
self.clear()
|
||||||
xmodmap_dict = {}
|
xmodmap_dict = {}
|
||||||
try:
|
try:
|
||||||
xmodmap = subprocess.check_output(['xmodmap', '-pke']).decode()
|
xmodmap = subprocess.check_output(
|
||||||
|
['xmodmap', '-pke'],
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
).decode()
|
||||||
xmodmap = xmodmap.lower()
|
xmodmap = xmodmap.lower()
|
||||||
mappings = re.findall(r'(\d+) = (.+)\n', xmodmap + '\n')
|
mappings = re.findall(r'(\d+) = (.+)\n', xmodmap + '\n')
|
||||||
for keycode, names in mappings:
|
for keycode, names in mappings:
|
||||||
|
Loading…
Reference in New Issue
Block a user