mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 09:10:04 +01:00
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>
This commit is contained in:
parent
48d6e959ff
commit
89c2f29d2c
1 changed files with 8 additions and 4 deletions
|
|
@ -337,10 +337,14 @@ def setup_quirks(recording):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
overrides.parent.mkdir(exist_ok=True)
|
overrides.parent.mkdir(exist_ok=True)
|
||||||
with overrides.open("w+") as fd:
|
try:
|
||||||
fd.write("# This file was generated by libinput replay\n")
|
with overrides.open("w+") as fd:
|
||||||
fd.write("# Unless libinput replay is running right now, remove this file.\n")
|
fd.write("# This file was generated by libinput replay\n")
|
||||||
fd.write("\n\n".join(quirks))
|
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
|
return overrides
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue