]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - autorandr.py
Print error when user script fails
[deb_pkgs/autorandr.git] / autorandr.py
index a23d1a6089911b758fd5a13572584f539d95e635..217b2b44e859a9da48809365543149cb437bd674 100755 (executable)
@@ -1054,7 +1054,7 @@ def generate_virtual_profile(configuration, modes, profile_name):
                     configuration[output].options["off"] = None
     elif profile_name in ("horizontal", "vertical", "horizontal-reverse", "vertical-reverse"):
         shift = 0
-        if profile_name == "horizontal":
+        if profile_name.startswith("horizontal"):
             shift_index = "width"
             pos_specifier = "%sx0"
         else:
@@ -1185,8 +1185,8 @@ def exec_scripts(profile_path, script_name, meta_information=None):
             if os.access(script, os.X_OK | os.F_OK):
                 try:
                     all_ok &= subprocess.call(script, env=env) != 0
-                except:
-                    raise AutorandrException("Failed to execute user command: %s" % (script,))
+                except Exception as e:
+                    raise AutorandrException("Failed to execute user command: %s error: %s" % (script,str(e)))
                 ran_scripts.add(script_name)
 
         script_folder = os.path.join(folder, "%s.d" % script_name)
@@ -1198,8 +1198,8 @@ def exec_scripts(profile_path, script_name, meta_information=None):
                     if os.access(script, os.X_OK | os.F_OK):
                         try:
                             all_ok &= subprocess.call(script, env=env) != 0
-                        except:
-                            raise AutorandrException("Failed to execute user command: %s" % (script,))
+                        except Exception as e:
+                            raise AutorandrException("Failed to execute user command: %s error: %s" % (script,str(e)))
                         ran_scripts.add(check_name)
 
     return all_ok