Skip to content

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

@endreszabo

Description

@endreszabo

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'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions