Refactor a little and use xclip for urxvt clipboard instead of xsel.