Keyboard Shortcut for switching between multiple monitors?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
superdado
Level 2
Level 2
Posts: 62
Joined: Sat Dec 23, 2017 6:03 am
Location: Italy
Contact:

Keyboard Shortcut for switching between multiple monitors?

Post by superdado »

I'm reviving this post because it's exactly about my need.

In my desktop with LM 18.3, a 970GTX with a 384.90 nvidia driver, I have a 1920x1200 monitor always connected to the 970 DVI and a 1920x1080 projector to the 970 HDMI but I only turn it on for movies at night and I keep it deactivated to avoid moving things to its space.
When I turn the projector on, as previously in Windows, I myself discovered that SUPER + P performs a cycle through different modes of video outputs: inverting aspect ratio (weird result), duplicating, extending,...
Unfortunately this modes doesn't include deactivating the DVI monitor and turning the projector on.
The results of SUPER + P several times look even weirder when I start cycling modes with projector on and dvi monitor deactivated.

This involves, every time, starting Display settings, manually switching monitor and projector and then applying.
Since version 18.3 moreover (I skipped 18.2), automatic monitor identification overlay seem to stay always on top, forcing me to close Display settings window and reopening when I'm done to repeat the steps to get back to desktop DVI monitor and deactivating the projector.
So, is there a way to edit this modes so that I can press SUPER + P several times to switch them?

Looking at my xrandr output...

Code: Select all

Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   640x480       75.00    72.81    59.94  
HDMI-0 connected (normal left inverted right x axis y axis)
   1920x1080     60.00 +  60.00    59.94    50.00    29.97    25.00    23.97    60.00    50.04  
   1600x1200     60.00  
   1440x900      59.89  
   1400x1050     59.98  
   1280x1024     85.02    75.02  
   1280x800      84.88  
   1280x720      60.00    59.94    50.00  
   1024x768      85.00    75.03    70.07    60.00  
   800x600       85.06    75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis
...I tried to change the script (my first time with a bash script!) with no success.
I simplified the script with

Code: Select all

#!/bin/bash
xrandr --output HDMI-0 --pos 1920x1080 --primary
xrandr --output DVI-I-1 --off 
chmodded it and run but again no result.
I learnt something more about xrandr but I have to say that simply executing

Code: Select all

xrandr --output HDMI-0 --primary
in the terminal does nothing.

I tried to find the solution in Nvidia server settings but couldn't.
Is there anybody there - with more than my little knowledge - to help me with this OS I really love and that helped me to get rid of Windows without buying a Mac?! :)
Thank you
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
JeremyB
Level 21
Level 21
Posts: 13851
Joined: Fri Feb 21, 2014 8:17 am

Re: Keyboard Shortcut for switching between multiple monitors?

Post by JeremyB »

Post split from old topic viewtopic.php?f=59&t=158077
Locked

Return to “Graphics Cards & Monitors”