How can I determine the screen resolution?

Using applications, configuring, problems
Post Reply
Message
Author
jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

How can I determine the screen resolution?

#1 Post by jeffrey »

Normally I would use xdpyinfo but that's not present in Puppy.
I can scan /etc/X11/xorg.conf but that's hardly definitive, especially if multiple resolutions exist. Surely there must be some active method of probing the X server?
TIA
Jeffrey

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

you could try:

xwininfo -root

or:

xvidtune -show

jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

#3 Post by jeffrey »

Thanks, GuestToo.
Your responsiveness is amazing!
I tried everything that looked feasible in /usr/X11R7/bin but didn't notice that xvidtune had a command-line option, only the scary GUI with warning about potential video damage! "xvidtune -show" will solve my problem thanks.
I don't see xwininfo, which would be even more useful. Where did you get it? (I have it on AIX 4 and Fedora Core 5 but don't see it on Puppy.) I copied it from FC5 to Puppy, but get the familiar
/lib/libc.so.6: version 'GLIBC_2.4' not found (required by ./xwininfo)
message, which I've had when trying to run some RPM objects under Puppy. Is there a simple solution to this? I've tried copying FC5's libc.so.6 across to Puppy, but that simply trashes Puppy, which can no longer perform even the simplest commands like ls or ln (needed to reverse the change!). Boot from CD allowed me to restore the original...

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#4 Post by GuestToo »

sorry, i remember now that i copied xwininfo from a Vector live cd ... i used it to get the id of the Rox wallpaper so i could tell xpenguins to run on the Rox window rather than the root window ... which works, but the penguins ignore the application windows, but do recognize the desktop icons

i wrote a simple script which shuts down the Rox pinboard then runs xpenguins, or if xpenguins is runing kills the penguins (literally, they explode) then restarts the Rox pinboard

anyway, that's why i have xwininfo installed ... it's about 13k

sample output:

# xwininfo -root

xwininfo: Window id: 0x3b (the root window) (has no name)

Absolute upper-left X: 0
Absolute upper-left Y: 0
Relative upper-left X: 0
Relative upper-left Y: 0
Width: 800
Height: 600
Depth: 16
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +0+0 -0+0 -0-0 +0-0
-geometry 800x600+0+0

#

jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

#5 Post by jeffrey »

Thanks again.
I found that Red Hat 8's xwininfo is compatible with Puppy 2.14.
Very useful...

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#6 Post by GuestToo »

Is there a simple solution to this?
you might be able to the library file somewhere, for example, in a dir like /root/my-applications/xwininfo ... also the executable ... then you could start xwininfo from a script (in the PATH, like /root/my-applications/bin), something like this:

#!/bin/sh
export LD_LIBRARY_PATH=/root/my-applications/xwininfo:$LD_LIBRARY_PATH
exec /root/my-applications/xwininfo/xwininfo "$@"

when you run the script, xwininfo in /root/my-applications/xwininfo/xwininfo should use the library file in that dir, but the other applications in Puppy should not even know it is there

or you could get a version of the program that is more compatible with Puppy's libraries

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#7 Post by Dougal »

Here's the "original" xwininfo, from Puppy's xorg package.
Attachments
xwininfo.gz
(10.97 KiB) Downloaded 311 times
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#8 Post by MU »

save as "screenres" and make executable (chmod 755 screenres):

Code: Select all

#!/usr/bin/puppybasic

resolution = xwin_screensize()
print resolution[0] , resolution[1]

sh-3.00# ./screenres
1024 768
sh-3.00#

Mark

jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

#9 Post by jeffrey »

Thanks lads.

Post Reply