haad / arandr

ARandR: Another XRandR GUI
GNU General Public License v3.0
51 stars 2 forks source link

"FileLoadError: Not a known mode" loadling saved setting #7

Open jeremyjjbrown opened 7 months ago

jeremyjjbrown commented 7 months ago

OS: Ubuntu 22.04 DE: XFCE with i3 as WM arandr: 0.1.10 xrandr program version 1.5.1 Server reports RandR version 1.6

Screens can be set with arandr but the screenlayout sh script errors

07:19:40 L-mjolnir:~
  arandr .screenlayout/screens.sh

(arandr:3282): Gtk-WARNING **: 07:19:47.493: Theme parsing error: gtk.css:8673:21: Not using units is deprecated. Assuming 'px'.

(arandr:3282): Gdk-CRITICAL **: 07:19:47.536: gdk_atom_intern: assertion 'atom_name != NULL' failed

(arandr:3282): Gdk-CRITICAL **: 07:19:47.536: gdk_atom_intern: assertion 'atom_name != NULL' failed
Traceback (most recent call last):
  File "/usr/bin/arandr", line 42, in <module>
    main()
  File "/usr/lib/python3/dist-packages/screenlayout/gui.py", line 344, in main
    app = Application(
  File "/usr/lib/python3/dist-packages/screenlayout/gui.py", line 164, in __init__
    self.filetemplate = self.widget.load_from_file(file)
  File "/usr/lib/python3/dist-packages/screenlayout/widget.py", line 120, in load_from_file
    template = self._xrandr.load_from_string(data)
  File "/usr/lib/python3/dist-packages/screenlayout/xrandr.py", line 102, in load_from_string
    self._load_from_commandlineargs(lines[xrandrlines[0]].strip())
  File "/usr/lib/python3/dist-packages/screenlayout/xrandr.py", line 140, in _load_from_commandlineargs
    raise FileLoadError("Not a known mode: %s" % part[1])
screenlayout.auxiliary.FileLoadError: Not a known mode: 2560x1440

07:19:48 L-mjolnir:~
  cat .screenlayout/screens.sh
#!/bin/sh
xrandr --output eDP-1 --primary --mode 1920x1200 --pos 0x1440 --rotate normal --output HDMI-1 --off --output DP-1 --off --output DP-2 --off --output DP-3 --off --output DP-4 --mode 2560x1440 --pos 2560x0 --rotate normal --output DP-1-1 --off --output DP-1-1-5 --off --output DP-1-1-6 --off --output DP-1-2 --off --output DP-1-3 --off --output DP-3-1 --off --output DP-3-1-5 --off --output DP-3-1-6 --mode 2560x1440 --pos 0x0 --rotate normal --output DP-3-2 --off --output DP-3-3 --off

07:25:49 L-mjolnir:~
 bash .screenlayout/screens.sh
xrandr: cannot find mode 2560x1440
07:25:01 L-mjolnir:~
  xrandr
Screen 0: minimum 320 x 200, current 5120 x 2640, maximum 16384 x 16384
eDP-1 connected primary 1920x1200+0+1440 (normal left inverted right x axis y axis) 301mm x 188mm
   1920x1200     60.00*+  60.00    40.00
   1920x1080     60.00
   1600x1200     60.00
   1680x1050     60.00
   1400x1050     60.00
   1600x900      60.00
   1280x1024     60.00
   1400x900      60.00
   1280x960      60.00
   1440x810      60.00
   1368x768      60.00
   1280x800      60.00
   1280x720      60.00
   1024x768      60.00
   960x720       60.00
   928x696       60.00
   896x672       60.00
   1024x576      60.00
   960x600       60.00
   960x540       60.00
   800x600       60.00
   840x525       60.00
   864x486       60.00
   700x525       60.00
   800x450       60.00
   640x512       60.00
   700x450       60.00
   640x480       60.00
   720x405       60.00
   684x384       60.00
   640x360       60.00
   512x384       60.00
   512x288       60.00
   480x270       60.00
   400x300       60.00
   432x243       60.00
   320x240       60.00
   360x202       59.99
   320x180       59.99
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
   3840x2160     60.00 +  60.00    60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98
   2560x1440     59.95*
   2048x1280     59.92
   1920x1080     60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98
   1600x900      60.00
   1280x1024     75.02    60.02
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    60.00    59.94
   720x400       70.08
DP-4 disconnected (normal left inverted right x axis y axis)
DP-4-1 disconnected (normal left inverted right x axis y axis)
DP-4-1-5 disconnected (normal left inverted right x axis y axis)
DP-4-1-6 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
   3840x2160     60.00 +  60.00    60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98
   2560x1440     59.95*
   2048x1280     59.92
   1920x1080     60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98
   1600x900      60.00
   1280x1024     75.02    60.02
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    60.00    59.94
   720x400       70.08
DP-4-2 disconnected (normal left inverted right x axis y axis)
DP-4-3 disconnected (normal left inverted right x axis y axis)
sukima commented 4 days ago

I'm having the exact same problem. What is arandr doing that xrandr is unable to do?

sukima commented 4 days ago

After a little experimenting, The difference that arandr does that the saved xrandr scripts do not is xrandr -q

Apparently that command must be performed before any modes are available to xrandr

sukima commented 3 days ago

If you edit the saved scripts and place xrandr -q >/dev/null before the xrandr commend arandr produces it worked for me,

#!/bin/sh
xrandr -q > /dev/null # <= Add this
xrandr --output eDP-1 --off --output DP-1 --off --output HDMI-1 --off --output HDMI-2 --mode 3440x1440 --pos 0x0 --rotate normal --output DP-2 --off --output DP-3 --off --output DP-4 --off --output DP-1-0 --off --output DP-1-1 --off