WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Getting X Windows resolution  (Read 3604 times)

Offline binarydemon

  • Newbie
  • *
  • Posts: 35
Getting X Windows resolution
« on: February 25, 2018, 10:56:59 PM »
Hi,

I was trying to have a script determine the resolution used by X Windows- most of the examples on the internet utilize xdpyinfo or xrandr but neither of these seem to be included in TinyCore x86 by default (I'm sure one of the tcz's in the repository include these, but I'd rather not keep adding bloat).  I see there is a -screen parameter in first line of .xsession, can I pretty much count on that being the working resolution or is there a chance when running that Xvesa command that it might fallback to something else or be overridden by a boot vga= parameter?

Is there another method I might be overlooking?

Check out DOSBox Distro - https://sites.google.com/site/dosboxdistro/

A tinycore LIVEUSB that makes playing your dos games anywhere very simple.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Getting X Windows resolution
« Reply #1 on: February 26, 2018, 12:00:18 AM »
Xorg-7.7-bin contains xdpyinfo and xrandr - if you are concerned about the size, you could always hack the extension to only contain what you need.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11621
Re: Getting X Windows resolution
« Reply #2 on: February 26, 2018, 12:09:20 AM »
Hi binarydemon
If you go here:
http://forum.tinycorelinux.net/index.php/topic,13793.msg77139.html#msg77139
you'll find the C source code for a small desktop clock. You can lift the  GetScreenParams  routine to retrieve screen resolution.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11621
Re: Getting X Windows resolution
« Reply #3 on: February 26, 2018, 12:40:54 PM »
Hi binarydemon
Attached is a small C program for retrieving screen information. Install compiletc, xorg-7.x-dev and sstrip. Then run the
CompileScreenParams script to compile it. Compiled and stripped it's 1700 bytes and outputs the following:
Code: [Select]
tc@box:~/guilib/ScreenParams$ ./ScreenParams
Screen=1920 x 1080  DPIx=95 DPIy=94
tc@box:~/guilib/ScreenParams$

Offline windundgeist

  • Jr. Member
  • **
  • Posts: 55
Re: Getting X Windows resolution
« Reply #4 on: May 29, 2021, 02:06:22 PM »
@Rich

Can I use this script to change the resolution, because the width is a little warped. This causes problems after a certain time, i.e. when working for a long time.

I am working with flux, so the icons are in the center on the bottom of the screen. Don't know if this is X. Here some information about my HW:

Code: [Select]
Graphics:  Device-1: Intel Mobile 4 Series Integrated Graphics
           vendor: Toshiba America Info Systems driver: i915 v: kernel bus ID: 00:02.0
           chip ID: 8086:2a42
           Display: x11 server: X.Org 1.20.4 driver: intel resolution: 1280x800~60Hz
           OpenGL: renderer: Mesa DRI Mobile Intel GM45 Express v: 2.1 Mesa 18.3.6
           direct render: Yes

00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a42] (rev 07) (prog-if 00 [VGA controller])
Subsystem: Toshiba America Info Systems Mobile 4 Series Chipset Integrated Graphics Controller [1179:ff67]
Flags: bus master, fast devsel, latency 0, IRQ 28
Memory at 50000000 (64-bit, non-prefetchable) [size=4M]
Memory at 40000000 (64-bit, prefetchable) [size=256M]
I/O ports at 4140 [size=8]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: i915
Kernel modules: i915

00:02.1 Display controller [0380]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a43] (rev 07)
Subsystem: Toshiba America Info Systems Mobile 4 Series Chipset Integrated Graphics Controller [1179:ff67]
« Last Edit: May 29, 2021, 02:14:31 PM by windundgeist »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11621
Re: Getting X Windows resolution
« Reply #5 on: May 29, 2021, 02:17:24 PM »
Hi windundgeist
No, the program can only retrieve the screen information, not change it.

Offline windundgeist

  • Jr. Member
  • **
  • Posts: 55
Re: Getting X Windows resolution
« Reply #6 on: May 29, 2021, 02:19:10 PM »
Ok. Other possibility to set the 1280x800? With boot code probably? VGA?