summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJosé Expósito <jose.exposito89@gmail.com>2025-07-09 10:52:39 +0200
committerMarge Bot <marge-bot@fdo.invalid>2025-07-09 21:34:54 +0000
commit89c2f29d2c767b30306be1c862cd45a5e9828fc9 (patch)
tree8b3c7bf6015a1957ba3c7d52d156a378844d4ffc /tools
parent48d6e959ff85b0f0cf72bcc38c7d799bbb413233 (diff)
tools/libinput-replay: Warn if writing to local-overrides fails
Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1153 Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1264>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/libinput-replay.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/libinput-replay.py b/tools/libinput-replay.py
index c120f2c7..a88c47ea 100755
--- a/tools/libinput-replay.py
+++ b/tools/libinput-replay.py
@@ -337,10 +337,14 @@ def setup_quirks(recording):
sys.exit(1)
overrides.parent.mkdir(exist_ok=True)
- with overrides.open("w+") as fd:
- fd.write("# This file was generated by libinput replay\n")
- fd.write("# Unless libinput replay is running right now, remove this file.\n")
- fd.write("\n\n".join(quirks))
+ try:
+ with overrides.open("w+") as fd:
+ fd.write("# This file was generated by libinput replay\n")
+ fd.write("# Unless libinput replay is running right now, remove this file.\n")
+ fd.write("\n\n".join(quirks))
+ except IOError:
+ error("Warning: Couldn't write to {}, please re-run as root".format(overrides))
+ return None
return overrides