LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   X display resolution after logout (https://www.linuxquestions.org/questions/slackware-14/x-display-resolution-after-logout-308765/)

amwink 04-01-2005 05:39 PM

X display resolution after logout
 
Since I changed my default runlevel to 4, I'm experiencing new challenges...

Now, this is the problem: Most users of this computer are using 1280x960px as default. This is the first setting in xorg.conf. However, one user (cila) is visually impaired and uses 1024x768 + gnome.

Every time cila logs in, the screen resolution is reduced to 1024x768 (as set up in gnome prefs). But after logout, XDM keeps 1024x768. And the next user is obliged to stay with this low resolution until pressing <CTRL><ALT><-> to get 1280x960.

This is not a problem with XDM, because also happens with KDM.

How to make the resolution go back to 1280x960 after cila logout?

Tks

amwink

SciYro 04-03-2005 07:58 PM

make XDM run the command to set the resolution? (randr was it?)

amwink 04-04-2005 04:17 PM

Thanks for your help, but I must confess I didn't understand it... :confused: Could you be more clear? Thanks again.

SciYro 04-04-2005 05:07 PM

was just a question .....

XDM can be configured to run programs when its used, you could have it execute a program to change the screen resolution.

look at /etc/X11/xdm/Xsetup (could be a different name, depending on distro)

that file is ran every time XDM is ran, so by adding a command to change the resolution, it should change the resolution to whatever, every time XDM is ran ...... i should fix that resolution problem of yours

amwink 04-04-2005 09:15 PM

I understand now! Thanks for your patience...

The idea is really good. In fact, if I put a command to set the resoluton to 1280x960 whenever XDM starts, every user will be using this higher resolution, unless a personal configuration overrides it (as cila has set up her gnome to adapt it to her needs).

In Slack, the file to put this command (or a script) is /etc/X11/xdm/Xsetup_0 (similar to the path you suggested).

But, which command? I have absolutely no idea...

Linuxers, please help me :confused: !

Thanks a lot!!

SciYro 04-04-2005 09:20 PM

randr i think will change resolutions, but i really don't know what command, as i never changed resolution before using commands

gbonvehi 04-04-2005 09:34 PM

I think what you're looking for changing the resolution is (SciYro was close): xrandr
To change the resolution just type something like: xrandr -s 1024x768
You can find more info on it's man page.

amwink 04-04-2005 09:38 PM

Tks again.

I've just googled a bit and found this http://keithp.com/~keithp/talks/randr/.

Also, I found some references to 'xrandr' as a way to invoke randr. There's a man page for xrandr, and typing '/usr/X11R6/bin/xrandr -h' gives some more information.

I'm very optimistic and will try to set it up tomorrow. I'll post the result here.

amwink

EDIT: I'm very slow...

amwink 04-05-2005 08:22 PM

I put 'xrandr -s 1280x960' in my /etc/X11/xdm/Xsetup_0. It did not work at first. I did some tests and found something unexpected:

1) If I choose a lower resolution via xrandr (e.g. 800x600), when I quit a session (logout), the XDM screen is 800x600, even if I were using 1024x768 inside gnome.

2) If I choose higher resolution (as 1280x960, as I need), then XDM keeps using the lower resolution of the user (in this case 1024x768 from gnome prefs). The only way I found to put XDM in 1280x960 in this case was killing X with <CTRL><ALT><BKSPC>. It appears that xrandr only works if the resolution is becoming smaller.

However, if I log in as root, open a terminal and change the resolution via xrandr directly at the command prompt, it works 'on the fly' for almost any resolution from 320x200(!) up to 1280x960.

Very strange, isn't it?

As a workaround I'm considering changing the size of fonts and icons of gnome to make everything bigger and convince cila to use 1280x960 instead of 1024x760, even though the fonts inside applications (as AbiWord) will still appear small for her... I'm accepting other suggestions. :)

amwink

gbonvehi 04-05-2005 08:40 PM

How about putting: xrandr -s 1024x760 in her ~/.xsession file (create it if it doesn't exist). For more info take a look at man xdm.

amwink 04-05-2005 09:10 PM

Thanks for your suggestion. I haven't thought about .xsession before.

I did it. Immediately after login, xrandr changes the resolution for gnome, but when the session is finished, the XDM keeps using this lower resolution :(

amwink

gbonvehi 04-05-2005 09:18 PM

You should get more info about this, I don't know how to use it, but seems to be the place to "reset" your resolution.
From xdm man page:
Quote:

RESET PROGRAM
Symmetrical with Xstartup, the Xreset script is run after the user session has terminated. Run as root, it should contain com_
mands that undo the effects of commands in Xstartup, removing entries from /etc/utmp or unmounting directories from file servers.
The environment variables that were passed to Xstartup are also passed to Xreset.

amwink 04-05-2005 09:34 PM

I see the point. I will create a Xreset (maybe Xreset_0?), but only tomorrow and will post the results here. I have no more time today.

amwink

PS: The users of this forum are all sources of wisdom and creativity. Thank you very much!

gbonvehi 04-05-2005 10:07 PM

It seems i've just hit the way you can use the Xreset function. I was reading the man page here: http://linuxreviews.org/man/xdm/
When I saw there was a xdm-config file, in Slackware of course, it's located where it should be, as the man page said: /usr/X11R6/lib/X11/xdm/xdm-config

There it's where you can set Xreset (and others also), you can change the line:
Code:

DisplayManager._0.reset:        /usr/X11R6/lib/X11/xdm/TakeConsole
To something like:
Code:

DisplayManager._0.reset:        /usr/X11R6/lib/X11/xdm/yourscript
Where the content of yourscript (make this file executable) may be something like:
Code:

#!/bin/sh
xrandr -s 1280x960
/usr/X11R6/lib/X11/xdm/TakeConsole

PS: I like helping people because they usually teach me ;)

amwink 04-07-2005 06:35 PM

The instructions above worked PERFECTLY!

Thank you very much!! ¡gracias!

amwink



EDIT: I just had to put the absolute path for xrandr because its dir is not in my PATH:

Code:

#!/bin/sh
/usr/X11R6/bin/xrandr -s 1280x960
/usr/X11R6/lib/X11/xdm/TakeConsole



All times are GMT -5. The time now is 02:16 AM.