code: def _clipboard(self, pri=False):
          
          # Copy highlighted url to clipboard
          fpo = self.top.body.focus_position
          url_idx = len([i for i in self.items[:fpo + 1]
                         if isinstance(i, urwid.Columns)]) - 1
          if self.compact is False and fpo <= 1:
              return
          url = self.urls[url_idx]
          if pri is True:
              cmds = ("xsel -i", "xclip -i")
          else:
              cmds = ("xsel -ib", "xclip -i -selection clipboard")
          for cmd in cmds:
              try:
                  proc = Popen(shlex.split(cmd), stdin=PIPE)
                  proc.communicate(input=url.encode(sys.getdefaultencoding()))
                  self._footer_start_thread("Copied url to {} selection".format(
                      "primary" if pri is True else "clipboard"), 5)
              except OSError:
                  continue
              break
docs: C