174
First generate a "modeline" by using cvt
Syntax is: cvt width height refreshrate
cvt 1680 1050 60
this gives you:
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
Now tell this to xrandr:
xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 ...
35
On Ubuntu 18.04, I found two different keybindings for SUPER+P, which can be disabled with dconf-editor.
First, you need to install dconf-editor, if it's not already installed. This can be done in the terminal with the following command:
sudo apt install dconf-editor
Then you can launch it from the terminal:
dconf-editor
Within dconf-editor:
Navigate ...
27
You have several choices but perhaps the easiest is to place your command exactly as you have given above in your $HOME/.xprofile file. From here it will be executed every time you login.
By default this file does not exist in Ubuntu and so may need to be created manually and then be made executable. The following commands will do this:
touch $HOME/....
25
Adding complicated commands to Startup Applications
In General, you can add commands to run on start up (log in) by choosing: Dash > Startup Applications > Add. In this case, you have a complicated command to run.
There are two options to do that:
write a separate script:
#!/bin/bash
cvt 1368 768
# xrandr only works in X11 sessions, not Wayland
[ "$...
answered Jun 18 '15 at 6:46
Jacob Vlijm
74.9k1111 gold badges172172 silver badges272272 bronze badges
23
The accepted answer applies the same configuration regardless of the status of connected displays. This didn't work for me, as I'm connected to different displays at work and at home. autorandr allows automatic xrandr configurations for different display setup. To use autorandr,
Install with sudo apt install autorandr (tested on Ubuntu 18.04)
Configure your ...
21
Disclaimer: I do not know if it works for all graphic drivers. Intel driver here, in 13.04.
First of all get the normal screen you have active:
xrandr --current
My output is:
Screen 0: minimum 320 x 200, current 1024 x 600, maximum 32767 x 32767
LVDS1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 220mm x 129mm
1024x600 60.0*+...
21
Try this:
xrandr --output eDPI1 --mode 1024x768 --pos 0x0 --rotate normal --output HDMI2 --mode 1366x768 --pos 1024x384 --rotate normal
answered May 19 '15 at 18:48
Sergiy Kolodyazhnyy
90.4k1717 gold badges216216 silver badges415415 bronze badges
20
How to set a custom resolution previously specified. After executing the other steps defined to create the resolution, run:
xrandr -s 1680x1050
18
I also encountered this problem (used to have a Dell 23" screen)
First, determine which interface is connected to your display:
$ xrandr -q
The command output will be:
mukolla@pk:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
LVDS connected (normal left inverted right x axis y axis)
1366x768 60.0 +
...
18
NOTE: I also posted this answer here
I found a very simple workaround that works perfectly for me running 13.04. on a laptop with a 24" external screen that is not permanently connected.
I'll just copy from here
log in
use xrandr or the Displays control utility to configure your monitors how you'd like them to be configured in the login screen
...
17
Minimum Info
You are going to ask a question then add the link generated by this command
sudo apt-get install pastebinit; sudo sh -c "lsb_release -sd; dmidecode -s system-product-name; echo ==; lshw -c display; echo ==; xrandr --verbose; echo ==; cat /etx/X11/xorg.conf" | tee ~/Desktop/ubuntu-graphic-info.txt | pastebinit
Without dumping to a file ...
15
Changing the scaling factor from 1x1 to 0.9999x0.9999 did the trick for me
xrandr --output eDP-1 --scale 0.9999x0.9999
15
December 9, 2018 Update
I found source code for program sct which allows user to set color temperature. It has "cribbed the code" from redshift and provides mapping for red, green and blue values:
/* cribbed from redshift, but truncated with 500K steps */
static const struct { float r; float g; float b; } whitepoints[] = {
{ 1.00000000, 0....
answered Aug 1 '18 at 4:12
WinEunuuchs2Unix
81k2222 gold badges171171 silver badges322322 bronze badges
14
From man grep (emphasis mine):
grep searches the named input FILEs (or standard input if no files are
named, or if a single hyphen-minus (-) is given as file name) for lines
containing a match to the given PATTERN. By default, grep prints the
matching lines.
And from the GNU docs (again, emphasis mine):
2.4 grep Programs
grep searches the named ...
12
I had this "BadMatch" problem:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 18 (RRAddOutputMode)
Serial number of failed request: 27
Current serial number in output stream: 28
And solved it by editing xorg.conf manually.
Add or correction ...
12
I had the same problem with my 144hz monitor. You might try using a full set of parameters. For example, to get my 2560x1440 screen to operate at 144hz, I had to do the following:
Run xrandr to find the name of your connected display output. In this case, DP-0 is my connected DisplayPort:
$ xrandr
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 16384 ...
12
I am not sure how you are going to apply it in your application ("enable a user to have their desired resolution without requiring graphics drivers" ?), but:
A terminal command to list connected screens
xrandr | grep " connected " | awk '{ print$1 }'
This wil give you the connected screens for further processing, like:
VGA-0
DVI-I-1
Since you mention ...
answered Jun 22 '15 at 12:17
Jacob Vlijm
74.9k1111 gold badges172172 silver badges272272 bronze badges
11
You don't need sudo to register the new mode with xrandr, try without sudo.
Then you'll have to apply the new resolution with:
xrandr --addmode <your_connection_type> 1200x1000_60.00
Where <your_connection_type> is usually VGA1, DP1 or HDMI1. Check the output of xrandr to know the exact name of the connected output.
answered Mar 30 '14 at 12:04
Sylvain Pineau
56.4k1717 gold badges132132 silver badges169169 bronze badges
11
I tried a similar thing and after some debugging I think I figured out what's going on. Your script probably is run and probably does set the resolution correctly. However, since it is run by the login manager, it runs before Unity has finished setting up your desktop environment and Unity reads its own settings and resets the resolution to what you had. So, ...
11
Strange, but I found answer first!
You use
$ xrandr --output $monitorName --rotate $direction
where $monitorName can be found in output of
$ xrandr
and $direction is left for counter-clockwise or right for clockwise.
Edit: Using grep, it is possible to write a script like this:
#!/bin/bash
screen="HDMI1"
descr=$(xrandr | grep "$screen")
if echo "$...
11
Actually, unlike libXrandr.so.2, the xrandr program is far from being mission-critical. It's just an X client — an unprivileged app you could install into your home directory to avoid clobbering the system one. Here's how you could do it (as a normal, non-root user!):
cd ~/Downloads
wget https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.1.tar....
10
When you do:
xrandr | grep " connected "
you are basically redirecting the standard output (file descriptor 1, /dev/stdout) of xrandr to the standard input (file descriptor 0, /dev/stdin) of grep, this is the job of the pipe.
As grep takes input from standard input when no file name is given, your command will succeed as far as the file is concerned.
You ...
9
You can change resolution when you connect to monitor-less PC via VNC by executing the following command:
xrandr --fb 1280x1024
Source:
http://www.x.org/archive/X11R7.5/doc/man/man1/xrandr.1.html
9
How to set a custom resolution previously specified when running multiple monitors. After executing the other steps defined to create the resolution, run:
xrandr --output DVI-0 --mode 1680x1050
Replace DVI-0 with your device-id, e.g. VGA-0
9
xrandr --output LVDS1 --auto
did it
9
According to this at the Now automate it on login section, I have made my own script 45custom_xrandr-settings and placed it into /etc/X11/Xsession.d/. It works fine for me under Ubuntu 14.04 LTS. You could place the code below after the case command described in that section.
PRI_OUTPUT="DVI-0";
# Make and force resolution
myNewMode=$(cvt 1366 768 60 | grep ...
8
In order to disable global <Super>p keybindings, and NOT any other media keys (tested in Ubuntu 15.04) I had to 'emtpy' the following dconf keys. I ran (in a terminal):
dconf write /org/gnome/settings-daemon/plugins/media-keys/video-out ''
dconf write /org/gnome/settings-daemon/plugins/media-keys/screenshot ''
Before, I searched with the next bash ...
8
An alternative way to run a command if a screen is connected or disconnected
An alternative solution would be to run a tiny background script. Running the script below in the background, I could not measure any increase in processor load whatsoever.
It is an easy an convenient way to run a script, or any other command, whenever a second screen is connected ...
answered May 30 '15 at 18:11
Jacob Vlijm
74.9k1111 gold badges172172 silver badges272272 bronze badges
8
If your screen is switching off it might be struggling to keep sync with the output signal.
There are two main reasons for this , the first is refresh rates being too high for the screen to keep up with and the second is the cables are not good enough. There is an outside chance your graphics card can't cope with multiple screens but most are powerful ...
7
Thanks to thom and thirdender this is basically a single command configuration based on the most voted answer.
RES="1920 1200 60" && \
DISP=$(xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/") && \
MODELINE=$(cvt $(echo $RES) | grep -e "Modeline [^(]" | sed -r 's/.*Modeline (.*)/\1/') && \
MODERES=$(echo $...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
xrandr × 760display-resolution × 289
display × 263
multiple-monitors × 239
xorg × 122
nvidia × 108
hdmi × 75
monitor × 46
screen × 38
14.04 × 35
external-monitor × 30
16.04 × 29
18.04 × 28
12.04 × 25
drivers × 25
intel-graphics × 23
command-line × 22
brightness × 22
gnome × 21
lubuntu × 20
amd-graphics × 19
kubuntu × 18
20.04 × 16
graphics × 14
dell × 14