29

I'm a new Linux user trying to change the screen resolution as there is no option under display. I have successfully managed to add new resolutions by fluke by following online guide. I don't have a GPU, I don't know if this is the issue? Below is my xrandr -q output.

root@kali:~# xrandr -q
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1280 x 1024, current 1280 x 1024, maximum 1280 x 1024
default connected 1280x1024+0+0 0mm x 0mm
   1280x1024       0.0* 
  1920x1200_60.00 (0x145)  193.2MHz
        h: width  1920 start 2056 end 2256 total 2592 skew    0 clock   74.6KHz
        v: height 1200 start 1203 end 1209 total 1245           clock   59.9Hz
  1440x900_59.90 (0x156)  106.3MHz
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock   55.8KHz
        v: height  900 start  901 end  904 total  932           clock   59.9Hz
  • xrandr -q is not listed in their manual. – neverMind9 Aug 21 '18 at 9:01
34

Here are the steps you need to add a new custom resolution and apply it. Following steps are for adding a 1920x1080 resolution, but you can use it for any other resolution you want. But make sure your monitor and onboard graphics support that resolution.

# First we need to get the modeline string for xrandr
# Luckily, the tool "gtf" will help you calculate it.
# All you have to do is to pass the resolution & the-
# refresh-rate as the command parameters:
gtf 1920 1080 60

# In this case, the horizontal resolution is 1920px the
# vertical resolution is 1080px & refresh-rate is 60Hz.
# IMPORTANT: BE SURE THE MONITOR SUPPORTS THE RESOLUTION

# Typically, it outputs a line starting with "Modeline"
# e.g. "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync
# Copy this entire string (except for the starting "Modeline")

# Now, use "xrandr" to make the system recognize a new
# display mode. Pass the copied string as the parameter
# to the --newmode option:
xrandr --newmode "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

# Well, the string within the quotes is the nick/alias
# of the display mode - you can as well pass something
# as "MyAwesomeHDResolution". But, careful! :-|

# Then all you have to do is to add the new mode to the
# display you want to apply, like this:
xrandr --addmode VGA1 "1920x1080_60.00"

# VGA1 is the display name, it might differ for you.
# Run "xrandr" without any parameters to be sure.
# The last parameter is the mode-alias/name which
# you've set in the previous command (--newmode)

# It should add the new mode to the display & apply it.
# Usually unlikely, but if it doesn't apply automatically
# then force it with this command:
xrandr --output VGA1 --mode "1920x1080_60.00"

Original source: https://gist.github.com/debloper/2793261

I also wrote a script that does all these steps automatically. You can try it out if the above steps seem too complicated for you: https://gist.github.com/chirag64/7853413

  • 1
    Failed the very last step... – Vishal Kumar Sahu Mar 1 '17 at 16:34
  • What error did you get? Try the automated script that I linked at the end of the answer. – Chirag Bhatia - chirag64 Mar 1 '17 at 16:38
  • When I run your file chmod +x Desktop/xrandr.sh No error or no change I feel. – Vishal Kumar Sahu Mar 1 '17 at 19:23
  • chmod +x Desktop/xrandr.sh only gives you permissions to run that file. You need to run it by running Desktop/xrandr.sh. – Chirag Bhatia - chirag64 Mar 2 '17 at 5:56
  • :o Okay Mean I missed to fire the weapon. – Vishal Kumar Sahu Mar 2 '17 at 8:14
8

The option --size/-s can be used:

xrandr -s 1440x900

Should work with RandR version 1.1 or newer.

  • When i do this the response is : size 1440x900 not found in available modes – nick Sep 6 '15 at 15:22
  • @nick From the output which you included in the question I deduced it should be available. What's the output of xrandr --verbose? – jimmij Sep 6 '15 at 15:26
  • xrandr: Failed to get size of gamma for output default Screen 0: minimum 1024 x 768, current 1024 x 768, maximum 1024 x 768 default connected 1024x768+0+0 (0x138) normal (normal) 0mm x 0mm Identifier: 0x137 Timestamp: 5048 Subpixel: unknown Clones: CRTC: 0 CRTCs: 0 Transform: 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 filter: – nick Sep 6 '15 at 15:35
  • 1024x768 (0x138) 0.0MHz *current h: width 1024 start 0 end 0 total 1024 skew 0 clock 0.0KHz v: height 768 start 0 end 0 total 768 clock 0.0Hz – nick Sep 6 '15 at 15:35
  • So it seems the only available resolution is 1024x768. Is this resolution what you want to set? – jimmij Sep 6 '15 at 15:41
3

This is what I had to do on an #IntelMaker #Joule in order to make it work in the native resolution with a SUNFOUNDER 7 INCH TFT COLOR MONITOR, which is listed as having 1024*600 resolution, but was picked up as 1280x720 instead.

First, Intel Joule with Linux 4.4.15-yocto-standard x86_64 doesn't seem to have gtf(1), so, I had to use a different machine to calculate the appropriate numbers:

$ gtf 1024 600 60

  # 1024x600 @ 60.00 Hz (GTF) hsync: 37.32 kHz; pclk: 48.96 MHz
  Modeline "1024x600_60.00"  48.96  1024 1064 1168 1312  600 601 604 622  -HSync +Vsync

$ 

Then, create a file with the appropriate commands:

# cat > 1024x600.sh
xrandr --newmode "1024x600_60.00"  48.96  1024 1064 1168 1312  600 601 604 622  -HSync +Vsync
xrandr --addmode HDMI1 "1024x600_60.00"
xrandr --output HDMI1 --mode "1024x600_60.00"
^D
# chmod +x 1024x600.sh

Then, startx or startxfce4, and run ./1024x600.sh, after which, the following will be reported by xrandr(1).

# xrandr
Screen 0: minimum 8 x 8, current 1024 x 600, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 697mm x 392mm
   1280x720      60.00 +  50.00    59.94  
   1920x1080     60.00    50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1280x1024     75.02  
   1440x900      74.98    59.90  
   1024x768      75.08    70.07    60.00  
   1024x600      60.00  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x576i      50.00  
   720x480       60.00    59.94  
   720x480i      60.00    59.94  
   640x480       75.00    72.81    60.00    59.94  
   720x400       70.08  
   1024x600_60.00  60.00* 
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
# 
  • Answer includes irrelevant personal user and host names, and doesn't clearly separate commands from their output - all of which can be confusing to the readers. A standard method of conveying that something is a command would be prefixing it simply with $. Kali's default WM is also GNOME, not XFCE, maybe it should be made clear that startxfce4 command is only for users running XFCE version 4. The likelihood that many other users will be running exactly Linux 4.4.15-yocto-standard x86_64 doesn't seem high to me, so I'd instead write that gtf (or cvt) might have to be installed first. – miyalys May 21 '18 at 10:57
2

I had the same problem. In Display setting maximum resolution was 1280x720. So:

  1. using xrandr command I have seen name of this monitor and resolution list.
  2. I 've executed the script: xrandr --output {name of monitor} --mode {resolution}

For example:

xrandr --output DP-2-1 --mode 2560x1440
1

save this bash script on your desktop and name it xrander then type on terminal (bash xrander.sh 1024 720 60) and press enter!

#!/bin/bash
# xrandr.sh
#If no argument is specified, ask for it and exit
if [[ -z "$@" ]];
then
echo "An argument is needed to run this script";
exit
else
arg="$@"
#Basic check to make sure argument number is valid. If not, display error and exit
if [[ $(($(echo $arg | grep -o "\s" | wc --chars) / 2 )) -ne 2 ]];
then
echo "Invalid Parameters. You need to specify parameters in the format "width height refreshRate""
echo "For example setResolution "2560 1440 60""
exit
fi

#Save stuff in variables and then use xrandr with those variables
modename=$(echo $arg | sed 's/\s/_/g')
display=$(xrandr | grep -Po '.+(?=\sconnected)')
if [[ "$(xrandr|grep $modename)" = "" ]];
then
xrandr --newmode $modename $(gtf $(echo $arg) | grep -oP '(?<="\s\s).+') &&
xrandr --addmode $display $modename
fi
xrandr --output $display --mode $modename

#If no error occurred, display success message
if [[ $? -eq 0 ]];
then
echo "Display changed successfully to $arg"
fi
fi
0

I ran:

xrandr --verbose

which gave me a list of size tags and corresponding pixel values

then I used

xrandr -s 6

to select the 1920x1080 resolution

0

My problem is the notebook resolution have this:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 ...
   1366x768      60.00*+  47.98  <=== MaxResolution (Default/Primary)
   1360x768      59.80    59.96  
   1280x720      60.00 ...

My primary/default screen is 1366x768.

But I would like to test a resolution 1920x1080 (DesireResolution) in my notebook.

I tried everything.

I couldn' t find a solution because my notebook don't accept addmode or newmode commands from xrandr to increase resolution, like this stackexchange question request.

So I did some maths!

1920/1366 = 1.4055636896
1080/768 = 1.40625

basically DesireResolution/MaxResolution

and run this command

xrandr --output eDP1 --mode 1366x768 --panning 1920x1080 --scale 1.40556369x1.40625

If you need restore original resolution

xrandr --output eDP1 --mode 1366x768 --panning 1366x768 --scale 1x1

You can adapt to any resolution you want.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.