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

Portrait mode: fit to screen #6

Open
ilazaridis opened this issue Dec 20, 2019 · 1 comment
Open

Portrait mode: fit to screen #6

ilazaridis opened this issue Dec 20, 2019 · 1 comment

Comments

@ilazaridis
Copy link

ilazaridis commented Dec 20, 2019

First of all, thanks for your time and your effort.
It seems to work quite good.

Now, my setup is 3 screens.
2 on landscape mode and one on portrait mode.
On the one on portrait mode, the wallpaper is off because it doesn't fit to the screen.

I guess this piece information can be fetched somehow from xrandr and resize or fit to screen accordingly.

@ilazaridis ilazaridis changed the title Fit to screen Portrait mode: fit to screen Dec 20, 2019
@ShikherVerma
Copy link
Owner

Hi @ilazaridis 👋

You're right, that information is included in the output.

normal orientation xrandr output
Screen 0: minimum 320 x 200, current 2966 x 900, maximum 16384 x 16384
eDP-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
   1366x768      60.00*+  40.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   700x450       59.96    59.88  
   640x480       60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   640x400       59.88    59.98  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DVI-I-1-1 connected 1600x900+1366+0 (normal left inverted right x axis y axis) 382mm x 215mm
   1600x900      60.01*+
   1440x900      59.90  
   1280x800      59.91  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
  1024x768 (0x4d) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x5c) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x5d) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  640x480 (0x69) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
one screen in portrait mode xrandr output
Screen 0: minimum 320 x 200, current 2266 x 1600, maximum 16384 x 16384
eDP-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
   1366x768      60.00*+  40.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   700x450       59.96    59.88  
   640x480       60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   640x400       59.88    59.98  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DVI-I-1-1 connected 900x1600+1366+0 right (normal left inverted right x axis y axis) 382mm x 215mm
   1600x900      60.01*+
   1440x900      59.90  
   1280x800      59.91  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
  1024x768 (0x4d) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x5c) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x5d) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  640x480 (0x69) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz

Diff:

# Normal
DVI-I-1-1 connected 1600x900+1366+0 (normal left inverted right x axis y axis) 382mm x 215mm
# Rotated
DVI-I-1-1 connected 900x1600+1366+0 right (normal left inverted right x axis y axis) 382mm x 215mm

Currently the script uses regex to looks for lines which have information on the current screen settings
i.e. these lines:

   1366x768      60.00*+  40.00  
   1366x768      60.00*+  40.00  

What you could do is add another regex which looks for connected displays. i.e. these lines:

Screen 0: minimum 320 x 200, current 2966 x 900, maximum 16384 x 16384
DVI-I-1-1 connected 900x1600+1366+0 right (normal left inverted right x axis y axis) 382mm x 215mm

Notice that the second line contains right keyword before (normal left inverted right x axis y axis). Using a regex match, the orientation can be taken from these lines here and set to a variable, which can be used later to correctly crop and combine the background image.

I'm not using i3 anymore so I can't fix this myself sorry 😓 But you are welcome to fix this yourself and send a PR :) That would be awesome!

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

No branches or pull requests

2 participants