Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: invalid literal for int() with base 10: '1080_60.00' #31

Open
endreszabo opened this issue Jul 4, 2021 · 2 comments
Open

Comments

@endreszabo
Copy link

I guess randrctl tries to parse the resolutions as an integer. Sometimes, there are characters other than number in the 'mode' string. For instance my VIRTUAL1 output has the following modes that leads randctrl to fail:

VIRTUAL1 connected (normal left inverted right x axis y axis)
   1280x720_vnc  60.00  
   1920x1080_60.00  60.00  

Full trace:

python /usr/bin/randrctl switch-to 2dp-usb-c-n-at-e
Traceback (most recent call last):
  File "/usr/bin/randrctl", line 10, in <module>
    sys.exit(main())
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/cli.py", line 311, in main
    return cmd(randrctl, args)
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/cli.py", line 155, in cmd_switch_to
    randrctl.switch_to(args.profile_name)
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/ctl.py", line 71, in switch_to
    self._apply(p)
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/ctl.py", line 64, in _apply
    raise e
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/ctl.py", line 60, in _apply
    self.xrandr.apply(p)
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/xrandr.py", line 52, in apply
    args = self._compose_mode_args(profile, self.get_all_outputs())
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/xrandr.py", line 131, in get_all_outputs
    o = self._parse_xrandr_connection(i)
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/xrandr.py", line 234, in _parse_xrandr_connection
    dw, dh = map(lambda s: int(s), display.mode.split('x'))
  File "/home/e/.local/lib/python3.9/site-packages/randrctl/xrandr.py", line 234, in <lambda>
    dw, dh = map(lambda s: int(s), display.mode.split('x'))
ValueError: invalid literal for int() with base 10: '1080_60.00'
@endreszabo
Copy link
Author

How can I help? I really want as I like this project.

@koiuo
Copy link
Owner

koiuo commented Jul 5, 2021

@endreszabo , thanks for reporting and responding with the intent to help. I really appreciate that 🙏

I do not have time to work on this right now. Moreover, at some point I've been half through the rewrite of this tool to a different language (which should've solved issues like this one, as it would rely on Xorg APIs rather than xrandr output), so if I had free time, I'd better invest it there.

At this point the best help would be to prepare a pull-request that fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants