old_contents: 
  def add_username_segment():
      import os
      if powerline.args.shell == 'bash':
          user_prompt = ' \\u '
      elif powerline.args.shell == 'zsh':
          user_prompt = ' %n '
      else:
          user_prompt = ' %s ' % os.getenv('USER')
  
      if os.getenv('USER') == 'root':
          bgcolor = Color.USERNAME_ROOT_BG
      else:
          bgcolor = Color.USERNAME_BG
  
      powerline.append(user_prompt, Color.USERNAME_FG, bgcolor)
  
  add_username_segment()
  
new_contents: 
  def add_username_segment():
      import os
      import pwd
      if powerline.args.shell == 'bash':
          user_prompt = ' \\u '
      elif powerline.args.shell == 'zsh':
          user_prompt = ' %n '
      else:
          user_prompt = ' %s ' % os.getenv('USER')
  
      if pwd.getpwuid(os.getuid())[ 0 ] == 'root':
          bgcolor = Color.USERNAME_ROOT_BG
      else:
          bgcolor = Color.USERNAME_BG
  
      powerline.append(user_prompt, Color.USERNAME_FG, bgcolor)
  
  add_username_segment()
  
subject: fix root bg-color after "su" command