I'm running Arch Linux 64-bit on a Samsung RV511. I often connect external monitors using xrandr. As I run LXDE with Awesome as a window manager, I need to prepare the xrandr-command by killing certain GUI elements and restarting them afterwards to have them correctly positioned.Here is my script:#!/bin/sh# kill conky and lxpanelkillall lxpanelkillall conky# set monitorxrandr --output LVDS1 --mode 1366x768 --pos 1680x282 --output VGA1 --mode  1680x1050 --pos 0x0 # restart awesomekillall -HUP awesome# restart lxpanel and conkylxpanel -p LXDE &conky &Now I'm running into a strange problem. When I run all of the above commands in the same sequence from the command line, I get a neat monitor configuration. However, when I run the script, the GUI crashes, leaving a strange pattern of wallpaper and panel elements. I get the same problem if I launch the xrandr command without having killed the lxpanel first, which is why i assume the xrandr command somehow does not wait for the kill commands?Or is there a different reason?Edit: adding sleep 3 between the code blocks solved the problem, although I still have no idea what the basic problem is. Anyway, here is my current script for future reference: #!/bin/bash# kill conky and lxpanelkillall lxpanelkillall conkysleep 4# set monitorxrandr --output LVDS1 --mode 1366x768 --pos 1680x282 --output VGA1 --mode  1680x1050 --pos 0x0 sleep 4# restart awesomekillall -HUP awesome# restart lxpanel and conkysleep 4lxpanel -p LXDE &conky &Post-Edit: The problem cannot be considered completely solved after all. Sometimes I have to kill xinit after startup and startx again for it to work. There seems to be some uptime-related problem. Needless to say I have no idea what.
Monitor setup commands do not work in script
linux;shell script;awesome;lxde;multi monitor