Xrandr and compiz crashes desktop

if i have my window manager set to marco, i can use xrandr and setup my screen resolution with no problems, than i can switch to compiz and everything is fine with the new resolution i have set.

But if i have my window manager set to compiz and i do the xrandr command to set my resolution my desktop goes all wacko with distorted colors and i can’t do nothing.

i made a script and added it to startup programs to automatically set my resolution when the computer boots up. and everything is fine if i’m using marco as my window manager. but video’s have a screen tearing effect when i use marco.

so so far the only way i can run compiz with my set resolution is to first load carco, run xrandr and set my resolution then go back and select compiz.

i am a noob to linux so does anyone have a way or script i can run to fix this problem and have it boot up with my resolution settings and compiz without crashing the desktop?

I am running ubuntu mate 15.04 and my video card is asus eah4850/1gb

marco --replace
wait 5
xrandr -s 1024x768 (or whatever you want your resolution to be)
wait 5
compiz --replace

tried it and still getting same results

i had to change wait 5 to sleep 5 for it to work tho, but still same results

Ah yeah…sorry, should have been sleep 5.

Not sure what it is that is not working given your described problem and current solution.

That is to say, unless I have misunderstood, you currently:

switch to marco

reset the resolution

switch to compiz

The script I have offered simply automates all of that

So I am at a loss now…sorry

i have to create my resolution mode since when i go in monitors it says unknow monitor and max res is 1024x768
so should this work?

#!/bin/bash
marco --replace
wait 5
xrandr --newmode “1280x768_60.00” 79.50 1280 1344 1472 1664 768 771 781 798 -hsync +vsync
xrandr --addmode VGA-0 “1280x768_60.00”
xrandr -s 1280x768
wait 5
compiz --replace

forgot the #!/bin/bash

if you have only got a max resolution of 1024 by 768 in the first instance, then are you perhaps only using the on-board Linux video driver. Have you tried loading a propriety driver if one is available? The way to do that would be to open the additional drivers menu. I think it is under system/preferences. When you open it, it will tell you if another driver is available.

Also, when you are posting up a bash script on this board, it is a good idea to select it and then press the “pre-formatted text” button in your post editor. That way, the bin/bash part of it does not come out all weird and large. It’s some peculiarity of the way that this board’s software process the bin/bash. By enclosing it as pre-formatted text, you get round this problem,

for example:

!/bin/bash
marco --replace
wait 5
xrandr --newmode "1280x768_60.00"   79.50  1280 1344 1472 1664  768 771 781 798 -hsync +vsync
xrandr --addmode VGA-0 "1280x768_60.00" 
xrandr -s 1280x768
wait 5
compiz --replace

Also, I notice you appear to have made the same mistake as me and used “wait” instead of “sleep”. You may want to change that

Ya I noticed that, I did look for a driver in additional drivers but it still only had a max res of 1024x768, but I went from ubuntu 15.04 to 14.04lts and I had the same problem but for some reason the script kinda works, I get an error msg quickly filing my screen on log on but as soon as I click my mouse it disappears and the resolution and everything works great, smooth graphics with 3d acceleration.

Problem is with my video card, none of the drivers work for ati because it’s a asus eah 4850 1gb ati card, but when I look up the drivers in use through the terminal commands I see Radeon loaded through the terminal which I guess is the built in linux driver

As long as it’s working at the moment I’m happy, I just ignore the msg saying could not set resolution at boot up because it does set it , so don’t know why I get that msg

This is very important and it is good you have raised it here. Hopefully, Martin Wimpress will read this at some point. You may also wish to report it as a bug.