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

11 lines
261 B
Python

import lib.proc as proc
def enable(unit, user):
flags = (['--user'] if user else []) + ['enable', unit]
output = systemd(flags)
def systemd(flags):
cmd = ['systemctl'] + flags
subproc = proc.exec(cmd)
return proc.communicate(subproc, cmd)