about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnton Bambura <jenneron@protonmail.com>2024-02-13 01:54:21 +0200
committerAnton Bambura <jenneron@protonmail.com>2024-02-13 01:54:23 +0200
commit17a4047bf5f1d1276cc65572db735b6711158f28 (patch)
tree2e06192cd4bfce5febad2767c02ac01028d38081
parent219bbbcf96be275ee337663aa05af804376e4015 (diff)
move generating ids part to outside function
it seems that python versions lower than 3.12 have problems interpreting
such expressions in f-strings.
-rwxr-xr-xcros-keyboard-map.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cros-keyboard-map.py b/cros-keyboard-map.py
index e22c65e..3cb4b36 100755
--- a/cros-keyboard-map.py
+++ b/cros-keyboard-map.py
@@ -29,6 +29,9 @@ vivaldi_keys = {
     "E7": "refresh",
 }
 
+def get_ids_string(device_ids):
+    return "\n".join(device_ids)
+
 def get_physmap_data():
     try:
         with open("/sys/bus/platform/devices/i8042/serio0/function_row_physmap", "r") as file:
@@ -60,7 +63,7 @@ def get_functional_row(physmap, use_vivaldi, super_is_held, super_inverted):
 def get_keyd_config(physmap, inverted):
     config = f"""\
 [ids]
-{"\n".join(device_ids)}
+{get_ids_string(device_ids)}
 
 [main]
 {get_functional_row(physmap, use_vivaldi=False, super_is_held=False, super_inverted=inverted)}