Ejemplo n.º 1
0
def neovim(c):
  "Install neovim, a text editor."
  if utils.command_exists(c, 'nvim'):
    return

  utils.apt_install(c, ["neovim", "python3-neovim"])

  # Install plugins with vim-plug.
  print(colors.OKRED + "Run :PlugInstall the next time you open vim to install plugins." + colors.ENDC)
Ejemplo n.º 2
0
def tmux(c):
  """Install tmux, a terminal multiplexer, from source."""
  if os.path.exists(os.path.expanduser("~/bin/tmux")):
    return

  import requests

  # install dependencies.
  utils.apt_install(c, [
      "libevent-dev",
      "ncurses-dev",
      "build-essential",
      "bison",
      "pkg-config",
  ])

  # Downlaod tarball.
  response = requests.get(
      "https://github.com/tmux/tmux/releases/download/3.1b/tmux-3.1b.tar.gz")
  tar_path = "/tmp/tmux.tar.gz"
  with open(tar_path, "wb") as tarfile:
    tarfile.write(response.content)

  # Extract its contents.
  utils.print_run(c, f"tar -zxf {tar_path} --directory /tmp", hide="out")

  with utils.chdir("/tmp/tmux-3.1b"):
    # Build it.
    utils.print_run(c, "./configure --enable-static", hide="out")
    utils.print_run(c, "make", hide="out")

    # Move it $HOME/bin.
    destination_dir = os.path.join(os.path.expanduser("~"), "bin")
    if not os.path.exists(destination_dir):
      os.makedirs(destination_dir)
    utils.print_run(c, f"cp ./tmux {destination_dir}/tmux", hide="out")

  print(colors.OKRED + "Run CTRL+b I the next time you open tmux to install plugins." + colors.ENDC)
Ejemplo n.º 3
0
def ag(c):
  "Install ag, an improved grep."
  if utils.command_exists(c, 'ag'):
    return
  utils.apt_install(c, "silversearcher-ag")
Ejemplo n.º 4
0
def xclip(c):
  "Install xclip, a tool for copying text from terminal to your clipboard."
  if utils.is_apt_installed(c, 'xclip'):
    return
  utils.apt_install(c, "xclip")
Ejemplo n.º 5
0
def python3_dev(c):
  """Install Python 3 headers."""
  if utils.is_apt_installed(c, 'python3-dev'):
    return
  utils.apt_install(c, "python3-dev")
Ejemplo n.º 6
0
def keepass2(c):
  """Install Keepass2, a password storage app."""
  if utils.command_exists(c, 'keepass2'):
    return
  utils.apt_install(c, "keepass2")
Ejemplo n.º 7
0
def htop(c):
  "Install htop, a nicer version of top."
  if utils.command_exists(c, 'htop'):
    return
  utils.apt_install(c, "htop")
Ejemplo n.º 8
0
def git(c):
  "Install git, a version control system."
  if utils.command_exists(c, 'git'):
    return
  utils.apt_install(c, "git")
Ejemplo n.º 9
0
def meld(c):
  """Installs meld, a 3-way merge tool."""
  if utils.command_exists(c, 'meld'):
    return
  utils.apt_install(c, "meld")
Ejemplo n.º 10
0
def cmake(c):
  """Install cmake, a tool for building from source."""
  if utils.command_exists(c, 'cmake'):
    return
  utils.apt_install(c, ["build-essential", "cmake"])
Ejemplo n.º 11
0
def zsh(c):
  "Install zsh, an alternative to bash."
  if utils.command_exists(c, 'zsh'):
    return
  utils.apt_install(c, "zsh")
  utils.print_run(c, "chsh -s $(which zsh)")