summaryrefslogtreecommitdiff
path: root/bin
diff options
authorPMR <pmr@pmr-lander>2017-07-03 17:48:30 +0000
committerPMR <pmr@pmr-lander>2017-07-03 17:48:30 +0000
commit4ba702d74b44de712fd9d15f1b5fa581bd796229 (patch)
tree6ed74df6eabe79caab985e467b757d7c16fd1013 /bin
parentbb8f55f4fc49aa8e0b286ca1ca2a660748af5921 (diff)
parentb4f7222fe02caa3b93ee50bb0bf8f560c171ccf0 (diff)
Merge #326353 from ~kissiel/plainbox-provider-checkbox:fix-1691724
Diffstat (limited to 'bin')
-rwxr-xr-xbin/xrandr_cycle9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/xrandr_cycle b/bin/xrandr_cycle
index f7785624..2a5e9158 100755
--- a/bin/xrandr_cycle
+++ b/bin/xrandr_cycle
@@ -100,7 +100,14 @@ except OSError as excp:
"required directories: {}".format(excp))
try:
- shutil.copy(shutter_xml_template, profile_path)
+ if os.path.exists(profile_path) and os.path.isfile(profile_path):
+ try:
+ os.remove(profile_path)
+ except PermissionError as exc:
+ print("Warning: could not remove {}. {}".format(
+ profile_path, exc))
+ else:
+ shutil.copy(shutter_xml_template, profile_path)
except (IOError, OSError) as excp:
print("ERROR: Unable to copy {} to {}: {}".format(shutter_xml_template,
profile_path,