Comments (7)
Thanks for filing this report!
- What is on line 1343 in your autorandr.py? Mine only has 1058 lines.
- If you run autorandr with the
--debug
flag it will print which commands exactly it attempts to execute. - Does executing those commands manually from a command line work for you?
from autorandr.
Mine has only 1058 lines as well. I don't know why the error message says line 1343.
this is what happens when using the --debug
flag.
$ autorandr --change --force --debug
jaque (detected) (current)
| Differences between the two profiles:
\-
laptop
docked
ultrawide
Going to run:
Failed to apply profile 'jaque' (line 1343):
[Errno 8] Exec format error
This appears to be a bug. Please help improving autorandr by reporting it upstream:
https://github.com/phillipberndt/autorandr/issues
Please attach the output of `xrandr --verbose` to your bug report if appropriate.
from autorandr.
The latest master version should give you a better error message (containing the file where the error occurred; obviously it's not autorandr.py).
Also, please try patching the function call_and_retry
starting in line 554: Above line 572, which says
retval = subprocess.call(*args, **kwargs_redirected)
Add
print({ "args": args, "kwargs": kwargs_redirected})
This should output the command that is being run. Does calling it manually work?
from autorandr.
This is how my call_and_retry
function looks like (did pull
):
553 def call_and_retry(*args, **kwargs):
554 """Wrapper around subprocess.call that retries failed calls.
555
556 This function calls subprocess.call and on non-zero exit states,
557 waits a second and then retries once. This mitigates #47,
558 a timing issue with some drivers.
559 """
560 kwargs_redirected = dict(kwargs)
561 if hasattr(subprocess, "DEVNULL"):
562 kwargs_redirected["stdout"] = getattr(subprocess, "DEVNULL")
563 else:
564 kwargs_redirected["stdout"] = open(os.devnull, "w")
565 kwargs_redirected["stderr"] = kwargs_redirected["stdout"]
566 retval = subprocess.call(*args, **kwargs_redirected)
567 if retval != 0:
568 time.sleep(1)
569 retval = subprocess.call(*args, **kwargs)
570 return retval
Added the print
553 def call_and_retry(*args, **kwargs):
554 """Wrapper around subprocess.call that retries failed calls.
555
556 This function calls subprocess.call and on non-zero exit states,
557 waits a second and then retries once. This mitigates #47,
558 a timing issue with some drivers.
559 """
560 kwargs_redirected = dict(kwargs)
561 if hasattr(subprocess, "DEVNULL"):
562 kwargs_redirected["stdout"] = getattr(subprocess, "DEVNULL")
563 else:
564 kwargs_redirected["stdout"] = open(os.devnull, "w")
565 kwargs_redirected["stderr"] = kwargs_redirected["stdout"]
566 print({ "args": args, "kwargs": kwargs_redirected})
567 retval = subprocess.call(*args, **kwargs_redirected)
568 if retval != 0:
569 time.sleep(1)
570 retval = subprocess.call(*args, **kwargs)
571 return retval
Then:
$ autorandr --change --force [01:54:33]
aguila (detected) (current)
jaque (current)
laptop
docked
ultrawide
{'args': (['xrandr', '--output', 'DP1', '--gamma', '1.0:1.0:1.0', '--mode', '1920x1200', '--panning', '0x0', '--pos', '0x0', '--rate', '59.95', '--reflect', 'normal', '--rotate', 'normal', '--output', 'HDMI2', '--gamma', '1.0:1.0:1.0', '--mode', '1920x1200', '--panning', '0x0', '--pos', '1920x0', '--rate', '59.95', '--reflect', 'normal', '--rotate', 'normal'],), 'kwargs': {'stderr': <open file '/dev/null', mode 'w' at 0x7fa35987f6f0>, 'stdout': <open file '/dev/null', mode 'w' at 0x7fa35987f6f0>}}
{'args': (['xrandr', '--output', 'eDP1', '--gamma', '1.0:1.0:1.0', '--mode', '1920x1080', '--panning', '0x0', '--pos', '0x1200', '--rate', '60.06', '--reflect', 'normal', '--rotate', 'normal'],), 'kwargs': {'stderr': <open file '/dev/null', mode 'w' at 0x7fa35987f6f0>, 'stdout': <open file '/dev/null', mode 'w' at 0x7fa35987f6f0>}}
Failed to apply profile 'aguila' (line 1343; /usr/lib/python2.7/subprocess.py):
[Errno 8] Exec format error
This appears to be a bug. Please help improving autorandr by reporting it upstream:
https://github.com/phillipberndt/autorandr/issues
Please attach the output of `xrandr --verbose` to your bug report if appropriate.
Note: I added a new profile aguila
that supersets jaque
. The latter is the one I was using originally.
from autorandr.
Interesting; so the first command works and the second raises an OS error..
So what exactly happens if you run
xrandr --output DP1 --gamma 1.0:1.0:1.0 --mode 1920x1200 --panning 0x0 --pos 0x0 --rate 59.95 --reflect normal --rotate normal --output HDMI2 --gamma 1.0:1.0:1.0 --mode 1920x1200 --panning 0x0 --pos 1920x0 --rate 59.95 --reflect normal --rotate normal && \
xrandr --output eDP1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --panning 0x0 --pos 0x1200 --rate 60.06 --reflect normal --rotate normal
Does this work without raising any errors?
Another thing, please try replacing "xrandr" in the script with the absolute path to xrandr, i.e. "/usr/bin/xrandr"
Third idea: Do you by any chance have a postswitch / preswitch / etc. script in your configuration? Does running that script manually (directly, i.e. /path/to/postswitch
instead of sh /path/to/postswitch
) work?
from autorandr.
Went directly to third idea. This was my ~/.autorandr/postswitch
:
#!/bin/bash
~/.config/bspwm/scripts/refresh_monitors.sh
Which just calls more scripts, one of them did rise some errors. So I redirected outputs.
#!/bin/bash
~/.config/bspwm/scripts/refresh_monitors.sh &> /dev/null
And now it works just fine. So it was my bad.
from autorandr.
Good to hear. That still means that I should improve the error message. I just pushed a commit that should state which script exactly failed.
from autorandr.
Related Issues (20)
- /home/thinker/./autorandr:49: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.version import LooseVersion as Version HOT 1
- Question: should autorandr systemd service change profile when external monitor is unplugged? HOT 2
- Use of --skip-options breaks --current HOT 1
- Parsing XRandR output failed HOT 1
- Detected Wayland session 'wayland-0'. Exiting.
- Failed to apply profile because xrandr cannot find mode
- postscript loses authentication for systemctl commands after suspending HOT 1
- Unhandled exception (local variable 'output' referenced before assignment) HOT 1
- Broken regexes due to missing `r` string literal HOT 6
- Unable to save lid state when using NVIDIA GPU (no eDP / LVDS output)
- Total system crash + soundloop could be caused by autorandr
- Total system crash + soundloop could be caused by autorandr
- No XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE events HOT 2
- Prevent profile change with screen lock HOT 1
- Additional Documentation HOT 7
- autorandr.service "Failed to load profile: 'xxx' : Profile not found" althoug profile exists HOT 1
- Failed to apply profile due to `--crtc` option HOT 2
- Incorrect profile settings HOT 1
- autorandr /usr/bin/autorandr:210: SyntaxWarning: invalid escape sequence '\s' XRANDR_OUTPUT_REGEXP = """(?x) /usr/bin/autorandr:236: SyntaxWarning: invalid escape sequence '\s' """ + XRANDR_PROPERTIES_REGEXP + """ | # Properties to include in the profile /usr/bin/autorandr:248: SyntaxWarning: invalid escape sequence '\S' XRANDR_OUTPUT_MODES_REGEXP = """(?x) /usr/bin/autorandr:592: SyntaxWarning: invalid escape sequence '\s' version = re.search("xrandr program version\s+([0-9\.]+)", version_string).group(1) /usr/bin/autorandr:888: SyntaxWarning: invalid escape sequence '\+' match = re.match("(?P<w>[0-9]+)x(?P<h>[0-9]+)(?:\+(?P<x>[0-9]+))?(?:\+(?P<y>[0-9]+))?.*", output.options["panning"]) HOT 4
- please support appimage , or binary file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autorandr.