1

I am literally a day or two old with Xubuntu 16.04 and am learning the basics of how to get things done. I have found one way to get my monitor to (temporarily) display 1280 x 1024 but have to repeat the process with every restart.

mike@mike-OptiPlex-GX270:~$ xrandr
Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      60.00* 
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
mike@mike-OptiPlex-GX270:~$ cvt 1280 1024
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
mike@mike-OptiPlex-GX270:~$ xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
mike@mike-OptiPlex-GX270:~$ xrandr --addmode VGA1 1280x1024_60.00
mike@mike-OptiPlex-GX270:~$ xrandr --output VGA1 --mode 1280x1024_60.00

How do I make these changes permanent? I have read related threads but need step by step instructions for my specific setup.

Also, I want to continue using LightDM because the computer only has 1.5 gb ram.

Thanks in advance.

1 Answers1

1

This thread may help you : How can I make xrandr customization permanent? . Basiquely, if you are using lighdm, follow the following steps:

Step 1: Create the script

Create a script like this:

sudo mkdir -p /opt/screen_config/
sudo touch /opt/screen_config/mycustomdesktopvideo.sh
sudo chmod +x /opt/screen_config/mycustomdesktopvideo.sh
# I don't remember xfce editor, replace maybe gedit with leafpad
sudo gedit /opt/screen_config/mycustomdesktopvideo.sh

and put in this file :

#!/usr/bin/env bash
xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA1 1280x1024_60.00
xrandr --output VGA1 --mode 1280x1024_60.00

Then, test it:

/opt/screen_config/mycustomdesktopvideo.sh

This should resize your desktop.

Step 2: Load it at startup,

Now, edit the file /etc/lightdm/lightdm.conf with the following code, and put in the [SeatDefaults] section the line

session-setup-script=/usr/share/mycustomdesktopvideo.sh

At the end it should looks like something like this:

[SeatDefaults]
session-setup-script=/usr/share/mycustomdesktopvideo.sh

Reboot, it should work.

If it fails

If you have a bug at startup, don't re-install: press Ctrl+Alt+F2, login, and with

sudo nano /etc/lightdm/lightdm.conf

remove the line session-setup-script=.... Then press Ctrl+Alt+F7 and try to login.

tobiasBora
  • 2,448
  • I added everything in the first block to everything that was in the config file on a fresh install. This ended up with a blank screen on reboot. Just reinstalled Xubuntu. When you say "put in" do you mean "replace?" Maybe I made a goof considering I am total noob with Linux/Xubuntu. – earthpages Jan 19 '17 at 20:34
  • I added clearer information. If you have question, just ask. – tobiasBora Jan 19 '17 at 21:24
  • Results - Step 1 worked without having to add the test... /opt/screen_config/mycustomdesktopvideo.sh ***** Step 2 - edited the file but there was a bug ***** Ctrl+Alt+F2 made life much simpler! ***** It may not be permanent but you gave me an easier way to get what i want at beginning of session. I also appreciate learning about Ctrl+Alt+F2 instead of reinstall! – earthpages Jan 20 '17 at 01:06
  • Why didn't you run the test ? It is usefull to see if it raises errors. Could you please run "/opt/screen_config/mycustomdesktopvideo.sh" and tell me if it raises an error ? I'm sorry I cannot test from my side... – tobiasBora Jan 20 '17 at 12:14
  • I used.. sudo nano /opt/screen_config/mycustomdesktopvideo.sh <Error *** /opt/screen_config/mycustomdesktopvideo.sh /opt/screen_config/mycustomdesktopvideo.sh: line 1: /bash: No such file or directory X Error of failed request: BadName (named color or font does not exist) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 16 (RRCreateMode) Serial number of failed request: 25 Current serial number in output stream: 25 *Error> File is in directory. Also a protected file .mycustomdesktopvideo.sh.swp * Reboot gives log-in box that doesn't work.. auto-login is default – earthpages Jan 21 '17 at 02:35
  • I'm not sure you run the good command ^^ For the moment, remove the line we added in /etc/lightdm/lightdm.conf, log in, open a terminal (it's often Ctrl + Alt + T), and type "/opt/screen_config/mycustomdesktopvideo.sh". If you have an error, please run "bash /opt/screen_config/mycustomdesktopvideo.sh" to see if the result is different. If you still have an error, could you try to run in terminal only the command "xrandr --output VGA1 --mode 1280x1024_60.00" ? If it works, try to remove the two lines "newmode" and "addmode" in the script and run again "/opt/screen_config/mycustomdesktopvideo.sh – tobiasBora Jan 21 '17 at 14:18
  • I've been trying different OS hence my delay. I'm now using Puppy Slacko (USB) which enables me to click on script you gave me and get the change immediately. No need to worry about start-up. One click is good! I did try your suggestions and got an error. I think it was a permissions issue. Can't remember exactly. I wanted to wait a while to make sure I did what you said correctly. Your suspicions were not unfounded! Learning Linux has been like rebirth. :) Slow and confused at first. Much appreciated. ps - I find that WinXP with K-Meleon is fastest. We need K-Meleon for Linux (without Wine)! – earthpages Jan 29 '17 at 22:51