awk alias passing a value to a variable

I am trying to turn this into an alias with no luck. I would then like to put the alias into my bashrc file. I know awk is very picky about quotes. I have tried every version of quotes, single quotes, double quotes, and backslashes that I can think of.

VAR=$(xrandr | awk '$2=="connected"{s=$1} END{print s}'); xrandr --output $VAR --mode 1024x768 --rate 60; xrandr --output LVDS1 --left-of $VAR; xrandr --output LVDS1 --primary; unset VAR;

This what it looks like just trying to copy it into an alias. I would really prefer an alias over a function or creating a shellscript.

$ alias xx2='VAR=$(xrandr | awk '$2=="connected"{s=$1} END{print s}'); xrandr --output $VAR --mode 1024x768 --rate 60; xrandr --output LVDS1 --left-of $VAR; xrandr --output LVDS1 --primary; unset VAR;'
bash: alias: END{print: not found
bash: alias: s}); xrandr --output $VAR --mode 1024x768 --rate 60; xrandr --output LVDS1 --left-of $VAR; xrandr --output LVDS1 --primary; unset VAR;: not found

what is the VAR ?

# echo "$VAR"

Nothing. These errors are the problem.

bash: alias: END{print: not found
bash: alias: s}); xrandr --output $VAR --mode 1024x768 --rate 60; xrandr --output LVDS1 --left-of $VAR; xrandr --output LVDS1 --primary; unset VAR;: not found

[quote=cokedude;302650111]
Nothing. These errors are the problem.

bash: alias: END{print: not found
bash: alias: s}); xrandr --output $VAR --mode 1024x768 --rate 60; xrandr --output LVDS1 --left-of $VAR;.......
if your full command executes succesfully then try to use the double quotes instead of single quotes..
# alias xx2=" VAR=$(xrandr | awk '$2=="connected"{s=$1} END{print s}'); xrandr ................xrandr --output LVDS1 --primary; unset VAR; "