davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.22k stars 610 forks source link

Feature request: support for XrandR 1.5+ monitors #749

Closed chrissnell closed 6 years ago

chrissnell commented 6 years ago

Version

Version: 1.4.2

Configuration

https://gist.github.com/chrissnell/48b2bd253b7b1db81b298c5abb7538dc

Launch Command

rofi -show run

Background

XrandR 1.5 introduced the "monitor" concept that allows users to create composite monitors that are composed of several GPU outputs. I use this feature to make my Dell 5K monitor work with dual graphics cards: each half of the screen is plugged into its own GPU and XrandR combines these into a single monitor that i3, polybar, etc., can use.

What Currently Happens

When rofi is run, it appears on one side of my screen (i.e., one of the GPU outputs).

Screenshot

What Should Happen

When rofi is run, it should appear in the center of my screen, spanning both GPU outputs, running on the composite XrandR monitor.

RFE

I'm requesting support for the XrandR monitor object. Monitor selection should be provided via a command-line option (ideally with regex support) because the monitor sometimes needs to be chosen dynamically [1].

I suggest something like -monitor and it could be used like this:

rofi -monitor "Auto-Generated-*" -show run

[1] XrandR/the NVIDIA server sometimes auto-generates a unique monitor name. To make this work with rofi, I would either have to script out something with xrandr and awk or rofi would have to support providing a regex for a monitor name.

Prior Art

i3 and polybar both have support for XrandR 1.5 monitors.

Thanks!

DaveDavenport commented 6 years ago

wonder if I can reproduce this on a single gpu machine.

chrissnell commented 6 years ago

@DaveDavenport Not sure... I just tried running Xnest with two screens and the RANDR extension:

$ Xnest +extension RANDR -scrns 2 :1

...but as soon as I run xrandr -d 1 on it, Xnest segfaults:

(EE) 
(EE) Backtrace:
(EE) 0: Xnest (OsLookupColor+0x139) [0xf88b1667e89]
(EE) 1: /usr/lib/libpthread.so.0 (funlockfile+0x50) [0x670d4a87adef]
(EE) 2: Xnest (ddxUseMsg+0x1721) [0xf88b15695a1]
(EE) 3: Xnest (FreeCursor+0x5b) [0xf88b1620c3b]
(EE) 4: Xnest (RegisterResourceName+0x232) [0xf88b1652442]
(EE) 5: Xnest (FreeClientResources+0x6c) [0xf88b165349c]
(EE) 6: Xnest (FreeAllResources+0x53) [0xf88b1653563]
(EE) 7: Xnest (InitFonts+0x452) [0xf88b1631812]
(EE) 8: /usr/lib/libc.so.6 (__libc_start_main+0xea) [0x670d4a4d1f4a]
(EE) 9: Xnest (_start+0x2a) [0xf88b156613a]
(EE) 
(EE) Segmentation fault at address 0x0
(EE) 
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE) 

I'm willing to give you an account on my desktop and let you VPN in and set up a screenshare if that could help debug.

chrissnell commented 6 years ago

@DaveDavenport you can definitely create an XrandR monitor on a single GPU machine. Just verified this on my laptop:

$ xrandr

Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
eDP1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 350mm x 190mm
   3840x2160     60.00*+
   3200x1800     60.00  
   2880x1620     60.00  
   2560x1440     60.00  
   2048x1536     60.00  
   1920x1440     60.00  
   1856x1392     60.01  
   1792x1344     60.01  
   2048x1152     60.00  
   1920x1080     60.00  
   1600x1200     60.00  
   1400x1050     59.98  
   1600x900      60.00  
   1280x1024     60.02  
   1280x960      60.00  
   1368x768      60.00  
   1280x720      60.00  
   1024x768      60.00  
   1024x576      60.00  
   960x540       60.00  
   800x600       60.32    56.25  
   864x486       60.00  
   640x480       59.94  
   720x405       60.00  
   640x360       60.00  

$ xrandr --screen 0 --setmonitor Composite auto eDP1
DaveDavenport commented 6 years ago

thx.

DaveDavenport commented 6 years ago

Can you try branch i749? I tried to use the monitor instead of output API in randr.

chrissnell commented 6 years ago

Perfect! rofi now appears in the middle of the monitor. Thanks!

DaveDavenport commented 6 years ago

wrong button :D. Thanks! Need to see how to add it so it won't break older versions of xcb, or when server has no support.

DaveDavenport commented 6 years ago

fixed.!

chrissnell commented 6 years ago

Hi @DaveDavenport -- will this ever get merged to master or next? Thanks!

sardemff7 commented 6 years ago

It was merged in next already, in February.

stapelberg commented 5 years ago

I think people might be asking because the feature doesn’t actually work anymore. Sent https://github.com/DaveDavenport/rofi/pull/918 to fix it.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.