1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-28 05:27:06 -05:00
dotfiles/lib/pacman.py

16 lines
416 B
Python

import lib.proc as proc
def get_installed():
return [line.split(' ')[0] for line in pacman(['-Q']).split('\n')[:-1]]
def install(package):
output = pacman(['-S', package], True)
def install_all(packages):
output = pacman(['-S'] + packages, True)
def pacman(flags, sudo = False):
cmd = ['pacman', '--noconfirm'] + flags
subproc = proc.exec(cmd, sudo)
return proc.communicate(subproc, cmd)