Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to get current X screen resolution Post 302382711 by TonyFullerMalv on Thursday 24th of December 2009 02:16:58 PM
Old 12-24-2009
The output from xdpyinfo(1) also includes amongst many other things the line:
Code:
dimensions:    1280x800 pixels (301x192 millimeters)

that provides what you want, as long as you have only 1 screen.

But using xrandr(1) the following would do the trick:
Code:
$ cat ./xrandr_test.sh
LINE=`xrandr -q | grep Screen`
echo LINE = ${LINE}
WIDTH=`echo ${LINE} | awk '{ print $8 }'`
echo WIDTH = ${WIDTH}
HEIGHT=`echo ${LINE} | awk '{ print $10 }' | awk -F"," '{ print $1 }'`
echo HEIGHT = ${HEIGHT}
$ ./xrandr_test.sh
LINE = Screen 0: minimum 320 x 240, current 1280 x 800, maximum 1280 x 800
WIDTH = 1280
HEIGHT = 800
$


Last edited by TonyFullerMalv; 12-24-2009 at 03:24 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Changing Screen Resolution

I have installed Solaris 10 over vmware onto my machine. Now when I want to change my screen resolution it only has one option which is 800x600. Is there a way to change that to a bigger resollution? And if there is, what file do I have to edit and what text editor do I have to use? (1 Reply)
Discussion started by: Aco
1 Replies

2. Solaris

Pre-Login Screen Resolution

I'm trying to configure the resolution that the pre-login screen is set at, I have looked on the net and all I can find is people telling me to edit the 'm46config' file. I cant find this file anywhere in any directory. I'm running Solaris 10 - any ideas how I can alter the resolution? :confused: (1 Reply)
Discussion started by: Dredz
1 Replies

3. UNIX for Dummies Questions & Answers

Changing my Screen Resolution (Not in X)

I have no graphical environment, no X, just a shell... but its WAY bigger than my monitor... what do I do? (3 Replies)
Discussion started by: jjinno
3 Replies

4. Solaris

Someone's got to know... Screen resolution question.

Hi all, Someone please help, I have a machine running Sun Solaris 5.8. X used to run fine, not it can't start. (possible user intervention) It looks to be trying to run at 1280x1024. I don't think the hardware will support it, it seems high. Anyways, how from the commandline, via ssh, can I... (4 Replies)
Discussion started by: komputersman
4 Replies

5. Solaris

Screen Saver Resolution

I am using sun solaris machine i have given the specs of that machine given below Name of athe Platform : SUNW,Ultra-5_10 Machiene hardware :sun4u Processor Type :sparc Operating system : solaris 10 Monitory TYpe : SAMSUNG Sync Master... (2 Replies)
Discussion started by: ambavaram
2 Replies

6. Solaris

screen resolution

how to change screen resolution in CDE prompt (2 Replies)
Discussion started by: tirupathi
2 Replies

7. Red Hat

Screen resolution before and after login

system: Fedora14 on vmware the login screen resolution is 1024*768, but after login the resolution is 800*600. I want to set the login screen resolution as 800*600 too. How to do this? thanks! (2 Replies)
Discussion started by: vistastar
2 Replies

8. UNIX for Dummies Questions & Answers

Changing the screen resolution

I have installed several flavors of Linux and FreeBSD onto my machine. Now when I want to change my screen resolution, it only has one option which is 800x600. Is there a way to change that to a bigger resolution? And if there is, what file do I have to edit and what text editor do I have to use?... (2 Replies)
Discussion started by: figaro
2 Replies

9. Linux

How to change screen Resolution?

Dear all I install Cent OS 5.5 ( Linux OS), with bshell and also Windows OS on the my laptop (ASUA) maximum screen resolution in Windows OS is 1024*760 but in Cent OS 5.5 is 800 *600, I have a program that is necessary to install on Cent OS and I have problem with other Linux distributions... (2 Replies)
Discussion started by: mkhorami76
2 Replies

10. Solaris

Screen Resolution

Hi all. I have a very peculiar problem in Solaris 10. The output of the m64config -prconf command with regards the Card Adapter is the following. Card possible resolutions: 720x400x85, 640x480x60, 640x480x72, 640x480x75 800x600x56, 800x600x60, 800x600x72, 800x600x75, 1024x768x60 ... (0 Replies)
Discussion started by: lynxman
0 Replies
XPSTOPDF(1)							     XPS Tools							       XPSTOPDF(1)

NAME
xpstopdf - XPS to PDF converter SYNOPSIS
xpstopdf [OPTION...] FILE [OUTPUT FILE] DESCRIPTION
xpstopdf converts XPS documents to PDF format. xpstopdf reads the XPS file, FILE, and writes a PDF file, OUTPUT FILE. If OUTPUT FILE is not specified the output filename will be derived from the OUTPUT FILE filename. OPTIONS
-?, --help Show help options. -d DOCUMENT, --document=DOCUMENT The document inside the XPS file to convert. By default, the first document of the XPS file is used. -f PAGE, --first=PAGE The first page to convert. -l PAGE, --last=PAGE The last page to convert. -o, --odd Convert only odd pages. -e, --even Convert only even pages. -r RESOLUTION, --resolution=RESOLUTION Horizontal and vertical resolution in PPI (Pixels Per Inch). The default is 150 PPI. --rx=RESOLUTION Horizontal resolution in PPI (Pixels Per Inch). The default is 150 PPI. --ry=RESOLUTION Vertical resolution in PPI (Pixels Per Inch). The default is 150 PPI. -x X, --crop-x=X The x-coordinate of the crop area top left corner. -y Y, --crop-y=Y The y-coordinate of the crop area top left corner. -w WIDTH, --crop-width=WIDTH The width of crop area. -h HEIGHT, --crop-height=HEIGHT The height of crop area. --paper-width=WIDTH The paper width. --paper-height=HEIGHT The paper height. --expand Expand pages smaller than the paper to fill the paper. By default, pages are not scaled. --no-shrink Don't scale pages which are larger than the paper. By default, pages larger than the paper are shrunk to fit. --no-center Don't center on the paper pages smaller than the paper (after any scaling). By default, pages smaller than the paper are aligned to the lower-left corner. BUGS
Please send bug reports to https://bugzilla.gnome.org/enter_bug.cgi?product=libgxps. SEE ALSO
xpstojpeg(1) xpstopng(1) xpstops(1) xpstosvg(1) XPS Tools 11/19/2011 XPSTOPDF(1)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy