It rather depends on what you mean by "by hand".
There is more than one way to do it. You can use the residuals:
> etasq(xyaov)
Partial eta^2
x 0.4854899
Residuals NA
> 1 - var(xyaov$residuals)/var(y)
[1] 0.4854899
(You didn't set a seed, so we don't have exactly the same result).
Almost equivalently, you can use the predicted values:
> var(predict(xyaov)) / var(y)
[1] 0.4854899
You can use the sums of squares from the ANOVA model (which is given by the rather unintuitive):
> summary(xyaov)[[1]][[2]][[1]] / (summary(xyaov)[[1]][[2]][[2]] + summary(xyaov)[[1]][[2]][[1]] )
[1] 0.4854899
You can use summary.lm and get the R^2 (because R-squared is eta squared):
> summary.lm(xyaov)$r.squared
[1] 0.4854899
You can do it with no reference to the aov() function by calculating the mean for each group, then the residual, then eta squared based on that:
xy <- as.data.frame(cbind(x, y))
xy$y <- as.numeric(as.character(xy$y)) #I don't understand why this line is needed
x.means <- as.data.frame(tapply(y, x, mean))
x.means$x <- row.names(x.means)
xy <- merge(x.means, xy, by="x")
xy$resid <- xy[, 2] - xy$y
1 - var(xy$resid) / var(xy$y)
[1] 0.4854899